mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Merge branch 'develop'
Conflicts: CMakeLists.txt cmake/CLangFormat.cmake snapcraft.yaml src/CMakeLists.txt src/core/Database.cpp src/core/Database.h src/core/Tools.cpp src/crypto/CryptoHash.h src/crypto/ssh/ASN1Key.h src/crypto/ssh/OpenSSHKey.cpp src/format/Kdbx4Reader.cpp src/gui/DatabaseTabWidget.cpp src/gui/DatabaseTabWidget.h src/gui/DatabaseWidget.cpp src/gui/DatabaseWidget.h src/gui/DetailsWidget.cpp src/gui/DetailsWidget.ui src/gui/EditWidgetProperties.cpp src/gui/EntryPreviewWidget.cpp src/gui/EntryPreviewWidget.ui src/gui/FileDialog.cpp src/gui/dbsettings/DatabaseSettingsDialog.cpp src/gui/dbsettings/DatabaseSettingsDialog.h src/gui/group/EditGroupWidget.cpp src/gui/group/EditGroupWidget.h src/sshagent/ASN1Key.h src/sshagent/OpenSSHKey.cpp src/sshagent/SSHAgent.cpp tests/CMakeLists.txt
This commit is contained in:
@@ -190,7 +190,7 @@ void KdbxXmlWriter::writeBinaries()
|
||||
m_xml.writeAttribute("ID", QString::number(i.value()));
|
||||
|
||||
QByteArray data;
|
||||
if (m_db->compressionAlgo() == Database::CompressionGZip) {
|
||||
if (m_db->compressionAlgorithm() == Database::CompressionGZip) {
|
||||
m_xml.writeAttribute("Compressed", "True");
|
||||
|
||||
QBuffer buffer;
|
||||
@@ -356,12 +356,14 @@ void KdbxXmlWriter::writeEntry(const Entry* entry)
|
||||
for (const QString& key : attributesKeyList) {
|
||||
m_xml.writeStartElement("String");
|
||||
|
||||
// clang-format off
|
||||
bool protect =
|
||||
(((key == "Title") && m_meta->protectTitle()) || ((key == "UserName") && m_meta->protectUsername())
|
||||
|| ((key == "Password") && m_meta->protectPassword())
|
||||
|| ((key == "URL") && m_meta->protectUrl())
|
||||
|| ((key == "Notes") && m_meta->protectNotes())
|
||||
|| entry->attributes()->isProtected(key));
|
||||
|| ((key == "Password") && m_meta->protectPassword())
|
||||
|| ((key == "URL") && m_meta->protectUrl())
|
||||
|| ((key == "Notes") && m_meta->protectNotes())
|
||||
|| entry->attributes()->isProtected(key));
|
||||
// clang-format on
|
||||
|
||||
writeString("Key", key);
|
||||
|
||||
@@ -369,7 +371,7 @@ void KdbxXmlWriter::writeEntry(const Entry* entry)
|
||||
QString value;
|
||||
|
||||
if (protect) {
|
||||
if (m_randomStream) {
|
||||
if (!m_innerStreamProtectionDisabled && m_randomStream) {
|
||||
m_xml.writeAttribute("Protected", "True");
|
||||
bool ok;
|
||||
QByteArray rawData = m_randomStream->process(entry->attributes()->value(key).toUtf8(), &ok);
|
||||
@@ -596,3 +598,24 @@ void KdbxXmlWriter::raiseError(const QString& errorMessage)
|
||||
m_error = true;
|
||||
m_errorStr = errorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable inner stream protection and write protected fields
|
||||
* in plaintext instead. This is useful for plaintext XML exports
|
||||
* where the inner stream key is not available.
|
||||
*
|
||||
* @param disable true to disable protection
|
||||
*/
|
||||
void KdbxXmlWriter::disableInnerStreamProtection(bool disable)
|
||||
{
|
||||
m_innerStreamProtectionDisabled = disable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if inner stream protection is disabled and protected
|
||||
* fields will be saved in plaintext
|
||||
*/
|
||||
bool KdbxXmlWriter::innerStreamProtectionDisabled() const
|
||||
{
|
||||
return m_innerStreamProtectionDisabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user