canonicalize: compare user ids as string rather than bytes
This commit is contained in:
@@ -362,18 +362,18 @@ public class UncachedKeyRing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<byte[]> processedUserIds = new ArrayList<byte[]>();
|
ArrayList<String> processedUserIds = new ArrayList<String>();
|
||||||
for (byte[] rawUserId : new IterableIterator<byte[]>(masterKey.getRawUserIDs())) {
|
for (byte[] rawUserId : new IterableIterator<byte[]>(masterKey.getRawUserIDs())) {
|
||||||
String userId = Utf8Util.fromUTF8ByteArrayReplaceBadEncoding(rawUserId);
|
String userId = Utf8Util.fromUTF8ByteArrayReplaceBadEncoding(rawUserId);
|
||||||
|
|
||||||
// check for duplicate user ids
|
// check for duplicate user ids
|
||||||
if (processedUserIds.contains(rawUserId)) {
|
if (processedUserIds.contains(userId)) {
|
||||||
log.add(LogType.MSG_KC_UID_DUP,
|
log.add(LogType.MSG_KC_UID_DUP,
|
||||||
indent, userId);
|
indent, userId);
|
||||||
// strip out the first found user id with this name
|
// strip out the first found user id with this name
|
||||||
modified = PGPPublicKey.removeCertification(modified, rawUserId);
|
modified = PGPPublicKey.removeCertification(modified, rawUserId);
|
||||||
}
|
}
|
||||||
processedUserIds.add(rawUserId);
|
processedUserIds.add(userId);
|
||||||
|
|
||||||
PGPSignature selfCert = null;
|
PGPSignature selfCert = null;
|
||||||
revocation = null;
|
revocation = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user