Dont import more than 100 User IDs (OKC-01-002)

This commit is contained in:
Dominik Schürmann
2015-09-25 01:38:43 +02:00
parent b10b14d9bc
commit 29e9b2fa1e
3 changed files with 8 additions and 2 deletions

View File

@@ -457,11 +457,15 @@ public class UncachedKeyRing implements Serializable {
// check for duplicate user ids
if (processedUserIds.contains(userId)) {
log.add(LogType.MSG_KC_UID_DUP,
indent, userId);
log.add(LogType.MSG_KC_UID_DUP, indent, userId);
// strip out the first found user id with this name
modified = PGPPublicKey.removeCertification(modified, rawUserId);
}
if (processedUserIds.size() > 100) {
log.add(LogType.MSG_KC_UID_TOO_MANY, indent, userId);
// strip out the user id
modified = PGPPublicKey.removeCertification(modified, rawUserId);
}
processedUserIds.add(userId);
PGPSignature selfCert = null;