diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2019-04-17 10:16:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-17 10:16:22 +0200 |
commit | 3698ff096cffec3541253ba1e745c389df0118c2 (patch) | |
tree | 4e18932917b18c251fdd2e9ee2b3a915ecd9a362 | |
parent | c8c998f6d887f1c128a2034da598a7a60f750e26 (diff) | |
parent | 255f6e2fcbd6aa60b0a5d108b0f8dadd84d57a33 (diff) |
Merge pull request #452 from Natureshadow/gpg-use-fpr
Use key fingerprint as ID instead of “long” ID.
-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()) |