mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-20 03:12:05 +01:00
Prevent third-party assigned user-ids from being accidentally returned as primary user-id
Fixes #293
This commit is contained in:
parent
520fcd7cbf
commit
52c8439da5
1 changed files with 5 additions and 5 deletions
|
@ -289,16 +289,16 @@ public class KeyRingInfo {
|
|||
return null;
|
||||
}
|
||||
|
||||
String firstUserId = userIds.get(0);
|
||||
if (userIds.size() == 1) {
|
||||
return firstUserId;
|
||||
}
|
||||
|
||||
String firstUserId = null;
|
||||
for (String userId : userIds) {
|
||||
PGPSignature certification = signatures.userIdCertifications.get(userId);
|
||||
if (certification == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (firstUserId == null) {
|
||||
firstUserId = userId;
|
||||
}
|
||||
Date creationTime = certification.getCreationTime();
|
||||
|
||||
if (certification.getHashedSubPackets().isPrimaryUserID()) {
|
||||
|
|
Loading…
Reference in a new issue