mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-01-09 19:57:57 +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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String firstUserId = userIds.get(0);
|
String firstUserId = null;
|
||||||
if (userIds.size() == 1) {
|
|
||||||
return firstUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String userId : userIds) {
|
for (String userId : userIds) {
|
||||||
PGPSignature certification = signatures.userIdCertifications.get(userId);
|
PGPSignature certification = signatures.userIdCertifications.get(userId);
|
||||||
if (certification == null) {
|
if (certification == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstUserId == null) {
|
||||||
|
firstUserId = userId;
|
||||||
|
}
|
||||||
Date creationTime = certification.getCreationTime();
|
Date creationTime = certification.getCreationTime();
|
||||||
|
|
||||||
if (certification.getHashedSubPackets().isPrimaryUserID()) {
|
if (certification.getHashedSubPackets().isPrimaryUserID()) {
|
||||||
|
|
Loading…
Reference in a new issue