mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Fixed storing trust of share and persistent message
This commit is contained in:
parent
8c5da624e5
commit
18e234aefc
@ -367,21 +367,23 @@ ShareObserver::Result ShareObserver::importSingedContainerInto(const KeeShareSet
|
|||||||
case UntrustedForever:
|
case UntrustedForever:
|
||||||
case TrustedForever: {
|
case TrustedForever: {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
const auto trusted =
|
const auto trusted = trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted
|
||||||
trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted : KeeShareSettings::Trust::Untrusted;
|
: KeeShareSettings::Trust::Untrusted;
|
||||||
for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) {
|
for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) {
|
||||||
if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) {
|
if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) {
|
||||||
scopedCertificate.certificate.signer = trust.second.signer;
|
scopedCertificate.certificate.signer = trust.second.signer;
|
||||||
scopedCertificate.path = reference.path;
|
scopedCertificate.path = reference.path;
|
||||||
scopedCertificate.trust = trusted;
|
scopedCertificate.trust = trusted;
|
||||||
found = true;
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted};
|
foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted};
|
||||||
// we need to update with the new signer
|
|
||||||
KeeShare::setForeign(foreign);
|
|
||||||
}
|
}
|
||||||
|
// update foreign certificates with new settings
|
||||||
|
KeeShare::setForeign(foreign);
|
||||||
|
|
||||||
if (trust.first == TrustedForever) {
|
if (trust.first == TrustedForever) {
|
||||||
qDebug("Synchronize %s %s with %s",
|
qDebug("Synchronize %s %s with %s",
|
||||||
qPrintable(reference.path),
|
qPrintable(reference.path),
|
||||||
@ -452,21 +454,23 @@ ShareObserver::Result ShareObserver::importUnsignedContainerInto(const KeeShareS
|
|||||||
case UntrustedForever:
|
case UntrustedForever:
|
||||||
case TrustedForever: {
|
case TrustedForever: {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
const auto trusted =
|
const auto trusted = trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted
|
||||||
trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted : KeeShareSettings::Trust::Untrusted;
|
: KeeShareSettings::Trust::Untrusted;
|
||||||
for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) {
|
for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) {
|
||||||
if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) {
|
if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) {
|
||||||
scopedCertificate.certificate.signer = trust.second.signer;
|
scopedCertificate.certificate.signer = trust.second.signer;
|
||||||
scopedCertificate.path = reference.path;
|
scopedCertificate.path = reference.path;
|
||||||
scopedCertificate.trust = trusted;
|
scopedCertificate.trust = trusted;
|
||||||
found = true;
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted};
|
foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted};
|
||||||
// we need to update with the new signer
|
|
||||||
KeeShare::setForeign(foreign);
|
|
||||||
}
|
}
|
||||||
|
// update foreign certificates with new settings
|
||||||
|
KeeShare::setForeign(foreign);
|
||||||
|
|
||||||
if (trust.first == TrustedForever) {
|
if (trust.first == TrustedForever) {
|
||||||
qDebug("Synchronize %s %s with %s",
|
qDebug("Synchronize %s %s with %s",
|
||||||
qPrintable(reference.path),
|
qPrintable(reference.path),
|
||||||
|
@ -127,6 +127,8 @@ void EditGroupWidgetKeeShare::showSharingState()
|
|||||||
.arg(supportedExtensions.join(", ")),
|
.arg(supportedExtensions.join(", ")),
|
||||||
MessageWidget::Warning);
|
MessageWidget::Warning);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
m_ui->messageWidget->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto active = KeeShare::active();
|
const auto active = KeeShare::active();
|
||||||
|
Loading…
Reference in New Issue
Block a user