token-import: bind only relevant subkeys

This commit is contained in:
Vincent Breitmoser
2017-09-11 01:55:03 +02:00
parent e0b5d97356
commit bd2e6aa698
5 changed files with 21 additions and 5 deletions

View File

@@ -18,6 +18,7 @@
package org.sufficientlysecure.keychain.operations;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import android.content.Context;
@@ -77,6 +78,11 @@ public class PromoteKeyOperation extends BaseReadWriteOperation<PromoteKeyringPa
// sort for binary search
for (CanonicalizedPublicKey key : pubRing.publicKeyIterator()) {
long subKeyId = key.getKeyId();
// we ignore key ids from empty fingerprints here
if (subKeyId == 0L) {
continue;
}
if (naiveIndexOf(subKeyIds, subKeyId) != null) {
log.add(LogType.MSG_PR_SUBKEY_MATCH, 1,
KeyFormattingUtils.convertKeyIdToHex(subKeyId));