mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 11:35:07 -05:00
import-log: better way to check self trust, and fix log level filtering
This commit is contained in:
parent
8d75d3e00e
commit
47368f1d24
@ -399,21 +399,12 @@ public class ProviderHelper {
|
|||||||
}
|
}
|
||||||
mIndent -= 1;
|
mIndent -= 1;
|
||||||
|
|
||||||
log(LogLevel.DEBUG, LogType.MSG_IP_TRUST_RETRIEVE);
|
|
||||||
// get a list of owned secret keys, for verification filtering
|
// get a list of owned secret keys, for verification filtering
|
||||||
LongSparseArray<UncachedPublicKey> trustedKeys =
|
LongSparseArray<UncachedPublicKey> trustedKeys =
|
||||||
getUncachedMasterKeys(KeyRingData.buildSecretKeyRingUri());
|
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[] {
|
log(LogLevel.INFO, LogType.MSG_IP_TRUST_USING, new String[] {
|
||||||
Integer.toString(trustedKeys.size())
|
Integer.toString(trustedKeys.size())
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// classify and order user ids. primary are moved to the front, revoked to the back,
|
// classify and order user ids. primary are moved to the front, revoked to the back,
|
||||||
// otherwise the order in the keyfile is preserved.
|
// 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...
|
// no self cert is bad, but allowed by the rfc...
|
||||||
if (item.selfCert != null) {
|
if (item.selfCert != null) {
|
||||||
operations.add(buildCertOperations(
|
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
|
// don't bother with trusted certs if the uid is revoked, anyways
|
||||||
if (item.isRevoked) {
|
if (item.isRevoked) {
|
||||||
|
@ -133,7 +133,6 @@ public class OperationResultParcel implements Parcelable {
|
|||||||
MSG_IP_SUCCESS (R.string.msg_ip_success),
|
MSG_IP_SUCCESS (R.string.msg_ip_success),
|
||||||
MSG_IP_TRUST_RETRIEVE (R.string.msg_ip_trust_retrieve),
|
MSG_IP_TRUST_RETRIEVE (R.string.msg_ip_trust_retrieve),
|
||||||
MSG_IP_TRUST_USING (R.string.msg_ip_trust_using),
|
MSG_IP_TRUST_USING (R.string.msg_ip_trust_using),
|
||||||
MSG_IP_TRUST_USING_SEC (R.string.msg_ip_trust_using_sec),
|
|
||||||
MSG_IP_UID_CERT_BAD (R.string.msg_ip_uid_cert_bad),
|
MSG_IP_UID_CERT_BAD (R.string.msg_ip_uid_cert_bad),
|
||||||
MSG_IP_UID_CERT_ERROR (R.string.msg_ip_uid_cert_error),
|
MSG_IP_UID_CERT_ERROR (R.string.msg_ip_uid_cert_error),
|
||||||
MSG_IP_UID_CERT_GOOD (R.string.msg_ip_uid_cert_good),
|
MSG_IP_UID_CERT_GOOD (R.string.msg_ip_uid_cert_good),
|
||||||
@ -210,9 +209,8 @@ public class OperationResultParcel implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsWarnings() {
|
public boolean containsWarnings() {
|
||||||
int warn = LogLevel.WARN.ordinal();
|
|
||||||
for(LogEntryParcel entry : new IterableIterator<LogEntryParcel>(iterator())) {
|
for(LogEntryParcel entry : new IterableIterator<LogEntryParcel>(iterator())) {
|
||||||
if (entry.mLevel.ordinal() >= warn) {
|
if (entry.mLevel == LogLevel.WARN || entry.mLevel == LogLevel.ERROR) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,6 @@
|
|||||||
<string name="msg_ip_reinsert_secret">Re-inserting secret key</string>
|
<string name="msg_ip_reinsert_secret">Re-inserting secret key</string>
|
||||||
<string name="msg_ip_trust_retrieve">Retrieving trusted keys</string>
|
<string name="msg_ip_trust_retrieve">Retrieving trusted keys</string>
|
||||||
<string name="msg_ip_trust_using">Using %s trusted keys</string>
|
<string name="msg_ip_trust_using">Using %s trusted keys</string>
|
||||||
<string name="msg_ip_trust_using_sec">Secret key available, self certificates are trusted</string>
|
|
||||||
<string name="msg_ip_uid_cert_bad">Encountered bad certificate!</string>
|
<string name="msg_ip_uid_cert_bad">Encountered bad certificate!</string>
|
||||||
<string name="msg_ip_uid_cert_error">Error processing certificate!</string>
|
<string name="msg_ip_uid_cert_error">Error processing certificate!</string>
|
||||||
<string name="msg_ip_uid_cert_good">Found good certificate from %s</string>
|
<string name="msg_ip_uid_cert_good">Found good certificate from %s</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user