save all signature relations in KeySignatures table

This commit is contained in:
Vincent Breitmoser
2018-07-02 14:37:05 +02:00
parent a7e6dc35a8
commit dca5dfe3aa

View File

@@ -309,8 +309,7 @@ public class KeyWritableRepository extends KeyRepository {
} }
// do we have a trusted key for this? // keep a note about the issuer of this key signature
if (trustedKeys.indexOfKey(certId) < 0) {
if (!signerKeyIds.contains(certId)) { if (!signerKeyIds.contains(certId)) {
operations.add(ContentProviderOperation.newInsert(KeySignatures.CONTENT_URI) operations.add(ContentProviderOperation.newInsert(KeySignatures.CONTENT_URI)
.withValue(KeySignatures.MASTER_KEY_ID, masterKeyId) .withValue(KeySignatures.MASTER_KEY_ID, masterKeyId)
@@ -318,6 +317,9 @@ public class KeyWritableRepository extends KeyRepository {
.build()); .build());
signerKeyIds.add(certId); signerKeyIds.add(certId);
} }
boolean isSignatureFromTrustedKey = trustedKeys.indexOfKey(certId) >= 0;
if (!isSignatureFromTrustedKey) {
unknownCerts += 1; unknownCerts += 1;
continue; continue;
} }