1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-14 07:34:52 +02:00

Prevent third-party assigned user-ids from being accidentally returned as primary user-id

Fixes #293
This commit is contained in:
Paul Schaub 2022-07-10 23:02:00 +02:00
parent 520fcd7cbf
commit 52c8439da5
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -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()) {