merge: check fingerprints on merge operation! (this needs a testcase!)

This commit is contained in:
Vincent Breitmoser 2014-08-14 16:27:50 +02:00
parent d2b9e95c80
commit a19784ed7e
2 changed files with 4 additions and 2 deletions

View File

@ -45,6 +45,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.Iterator;
@ -692,7 +693,8 @@ public class UncachedKeyRing {
long masterKeyId = other.getMasterKeyId();
if (getMasterKeyId() != masterKeyId) {
if (getMasterKeyId() != masterKeyId
|| Arrays.equals(getFingerprint(), other.getFingerprint())) {
log.add(LogLevel.ERROR, LogType.MSG_MG_HETEROGENEOUS, indent);
return null;
}

View File

@ -616,7 +616,7 @@
<string name="msg_mg_public">Merging into public keyring %s</string>
<string name="msg_mg_secret">Merging into secret keyring %s</string>
<string name="msg_mg_fatal_encode">Fatal error encoding signature</string>
<string name="msg_mg_heterogeneous">Tried to consolidate heterogeneous keyrings</string>
<string name="msg_mg_heterogeneous">Tried to merge keyrings with differing fingerprints!</string>
<string name="msg_mg_new_subkey">Adding new subkey %s</string>
<string name="msg_mg_found_new">Found %s new certificates in keyring</string>
<string name="msg_mg_unchanged">No new certificates</string>