Skip to content

Commit

Permalink
Update TouchID Quick Unlockto use new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
HexF committed Jan 12, 2023
1 parent b43df21 commit df99937
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/quickunlock/TouchID.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class TouchID : public QuickUnlockInterface
TouchID(TouchID const&) = delete;
void operator=(TouchID const&) = delete;

void reset();
QString errorString() const;

bool storeKey(const QString& databasePath, const QByteArray& passwordKey);
bool getKey(const QString& databasePath, QByteArray& passwordKey);
bool hasKey(const QString& databasePath) const;
Expand Down
16 changes: 11 additions & 5 deletions src/quickunlock/TouchID.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ inline CFMutableDictionaryRef makeDictionary() {
return keyPrefix + pathHash;
}

QString TouchID::errorString() const
{
// TODO
return "";
}

void TouchID::reset()
{
m_encryptedMasterKeys.clear();
}

/**
* Generates a random AES 256bit key and uses it to encrypt the PasswordKey that
* protects the database. The encrypted PasswordKey is kept in memory while the
Expand Down Expand Up @@ -342,10 +353,5 @@ inline CFMutableDictionaryRef makeDictionary() {
*/
void TouchID::reset(const QString& databasePath)
{
if (databasePath.isEmpty()) {
m_encryptedMasterKeys.clear();
return;
}

m_encryptedMasterKeys.remove(databasePath);
}

0 comments on commit df99937

Please sign in to comment.