import-log: better way to check self trust, and fix log level filtering

This commit is contained in:
Vincent Breitmoser
2014-06-12 01:37:49 +02:00
parent 8d75d3e00e
commit 47368f1d24
3 changed files with 6 additions and 17 deletions

View File

@@ -399,21 +399,12 @@ public class ProviderHelper {
}
mIndent -= 1;
log(LogLevel.DEBUG, LogType.MSG_IP_TRUST_RETRIEVE);
// get a list of owned secret keys, for verification filtering
LongSparseArray<UncachedPublicKey> trustedKeys =
getUncachedMasterKeys(KeyRingData.buildSecretKeyRingUri());
// special case: available secret keys verify themselves!
if (secretRing != null) {
trustedKeys.put(secretRing.getMasterKeyId(), secretRing.getPublicKey());
log(LogLevel.INFO, LogType.MSG_IP_TRUST_USING_SEC, new String[]{
Integer.toString(trustedKeys.size())
});
} else {
log(LogLevel.INFO, LogType.MSG_IP_TRUST_USING, new String[] {
Integer.toString(trustedKeys.size())
});
}
log(LogLevel.INFO, LogType.MSG_IP_TRUST_USING, new String[] {
Integer.toString(trustedKeys.size())
});
// classify and order user ids. primary are moved to the front, revoked to the back,
// otherwise the order in the keyfile is preserved.
@@ -513,7 +504,8 @@ public class ProviderHelper {
// no self cert is bad, but allowed by the rfc...
if (item.selfCert != null) {
operations.add(buildCertOperations(
masterKeyId, userIdRank, item.selfCert, Certs.VERIFIED_SELF));
masterKeyId, userIdRank, item.selfCert,
secretRing != null ? Certs.VERIFIED_SECRET : Certs.VERIFIED_SELF));
}
// don't bother with trusted certs if the uid is revoked, anyways
if (item.isRevoked) {