Secret Service Integration Fixes (#3761)

* FdoSecrets: create prompt object only when necessary

* FdoSecrets: negotiationOutput should always return a valid QVariant otherwise QDBus will fail to create a reply, causing timeout in client.

* FdoSecrets: include in debug info
This commit is contained in:
Aetf
2019-11-07 21:28:49 -05:00
committed by Jonathan White
parent 5d2766e016
commit 329701a34e
4 changed files with 15 additions and 8 deletions

View File

@@ -108,6 +108,9 @@ namespace Tools
#ifdef WITH_XC_TOUCHID #ifdef WITH_XC_TOUCHID
extensions += "\n- " + QObject::tr("TouchID"); extensions += "\n- " + QObject::tr("TouchID");
#endif #endif
#ifdef WITH_XC_FDOSECRETS
extensions += "\n- " + QObject::tr("Secret Service Integration");
#endif
if (extensions.isEmpty()) if (extensions.isEmpty())
extensions = " " + QObject::tr("None"); extensions = " " + QObject::tr("None");

View File

@@ -303,7 +303,9 @@ namespace FdoSecrets
toUnlock << coll; toUnlock << coll;
} }
} }
prompt = new UnlockCollectionsPrompt(this, toUnlock); if (!toUnlock.isEmpty()) {
prompt = new UnlockCollectionsPrompt(this, toUnlock);
}
return unlocked; return unlocked;
} }
@@ -339,7 +341,9 @@ namespace FdoSecrets
toLock << coll; toLock << coll;
} }
} }
prompt = new LockCollectionsPrompt(this, toLock); if (!toLock.isEmpty()) {
prompt = new LockCollectionsPrompt(this, toLock);
}
return locked; return locked;
} }

View File

@@ -44,11 +44,6 @@ namespace
namespace FdoSecrets namespace FdoSecrets
{ {
QVariant CipherPair::negotiationOutput() const
{
return {};
}
DhIetf1024Sha256Aes128CbcPkcs7::DhIetf1024Sha256Aes128CbcPkcs7(const QByteArray& clientPublicKeyBytes) DhIetf1024Sha256Aes128CbcPkcs7::DhIetf1024Sha256Aes128CbcPkcs7(const QByteArray& clientPublicKeyBytes)
: m_valid(false) : m_valid(false)
{ {

View File

@@ -35,7 +35,7 @@ namespace FdoSecrets
virtual SecretStruct encrypt(const SecretStruct& input) = 0; virtual SecretStruct encrypt(const SecretStruct& input) = 0;
virtual SecretStruct decrypt(const SecretStruct& input) = 0; virtual SecretStruct decrypt(const SecretStruct& input) = 0;
virtual bool isValid() const = 0; virtual bool isValid() const = 0;
virtual QVariant negotiationOutput() const; virtual QVariant negotiationOutput() const = 0;
}; };
class PlainCipher : public CipherPair class PlainCipher : public CipherPair
@@ -57,6 +57,11 @@ namespace FdoSecrets
{ {
return true; return true;
} }
QVariant negotiationOutput() const override
{
return QStringLiteral("");
}
}; };
class DhIetf1024Sha256Aes128CbcPkcs7 : public CipherPair class DhIetf1024Sha256Aes128CbcPkcs7 : public CipherPair