diff options
author | Dominik George <nik@naturalnet.de> | 2019-04-16 18:53:39 +0200 |
---|---|---|
committer | Dominik George <nik@naturalnet.de> | 2019-04-16 18:53:39 +0200 |
commit | 255f6e2fcbd6aa60b0a5d108b0f8dadd84d57a33 (patch) | |
tree | bc25d3baf15b19f143541dd7e70b06e0f1bf2ece /src | |
parent | 1ad0648f2f834453acd7230419580535501e433f (diff) |
Use key fingerprint as ID instead of “long” ID.
Diffstat (limited to 'src')
-rw-r--r-- | src/pass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pass.cpp b/src/pass.cpp index 7eb8d7a4..c4cc7894 100644 --- a/src/pass.cpp +++ b/src/pass.cpp @@ -127,7 +127,7 @@ void Pass::GenerateGPGKeys(QString batch) { */ QList<UserInfo> Pass::listKeys(QStringList keystrings, bool secret) { QList<UserInfo> users; - QStringList args = {"--no-tty", "--with-colons"}; + QStringList args = {"--no-tty", "--with-colons", "--with-fingerprint"}; args.append(secret ? "--list-secret-keys" : "--list-keys"); foreach (QString keystring, keystrings) { @@ -156,6 +156,8 @@ QList<UserInfo> Pass::listKeys(QStringList keystrings, bool secret) { current_user.expiry.setTime_t(props[6].toUInt()); } else if (current_user.name.isEmpty() && props[0] == "uid") { current_user.name = props[9]; + } else if ((props[0] == "fpr") && props[9].endsWith(current_user.key_id)) { + current_user.key_id = props[9]; } } if (!current_user.key_id.isEmpty()) |