log "unspecified" flags differently

This commit is contained in:
Vincent Breitmoser 2014-09-22 17:02:53 +02:00
parent f6ac887ce0
commit 862c9a8b3c
3 changed files with 14 additions and 2 deletions

View File

@ -389,9 +389,17 @@ public class ProviderHelper {
// see above
if (masterKeyId == keyId) {
log(LOG_TYPES_FLAG_MASTER[(c?1:0) + (e?2:0) + (s?4:0) + (a?8:0)]);
if (key.getKeyUsage() == null) {
log(LogType.MSG_IP_MASTER_FLAGS_UNSPECIFIED);
} else {
log(LOG_TYPES_FLAG_SUBKEY[(c?1:0) + (e?2:0) + (s?4:0) + (a?8:0)]);
log(LOG_TYPES_FLAG_MASTER[(c?1:0) + (e?2:0) + (s?4:0) + (a?8:0)]);
}
} else {
if (key.getKeyUsage() == null) {
log(LogType.MSG_IP_SUBKEY_FLAGS_UNSPECIFIED);
} else {
log(LOG_TYPES_FLAG_SUBKEY[(c ? 1 : 0) + (e ? 2 : 0) + (s ? 4 : 0) + (a ? 8 : 0)]);
}
}
Date creation = key.getCreationTime();

View File

@ -242,6 +242,7 @@ public abstract class OperationResult implements Parcelable {
MSG_IP_MASTER (LogLevel.DEBUG, R.string.msg_ip_master),
MSG_IP_MASTER_EXPIRED (LogLevel.DEBUG, R.string.msg_ip_master_expired),
MSG_IP_MASTER_EXPIRES (LogLevel.DEBUG, R.string.msg_ip_master_expires),
MSG_IP_MASTER_FLAGS_UNSPECIFIED (LogLevel.DEBUG, R.string.msg_ip_master_flags_unspecified),
MSG_IP_MASTER_FLAGS_CESA (LogLevel.DEBUG, R.string.msg_ip_master_flags_cesa),
MSG_IP_MASTER_FLAGS_CESX (LogLevel.DEBUG, R.string.msg_ip_master_flags_cesx),
MSG_IP_MASTER_FLAGS_CEXA (LogLevel.DEBUG, R.string.msg_ip_master_flags_cexa),
@ -261,6 +262,7 @@ public abstract class OperationResult implements Parcelable {
MSG_IP_SUBKEY (LogLevel.DEBUG, R.string.msg_ip_subkey),
MSG_IP_SUBKEY_EXPIRED (LogLevel.DEBUG, R.string.msg_ip_subkey_expired),
MSG_IP_SUBKEY_EXPIRES (LogLevel.DEBUG, R.string.msg_ip_subkey_expires),
MSG_IP_SUBKEY_FLAGS_UNSPECIFIED (LogLevel.DEBUG, R.string.msg_ip_subkey_flags_cesa),
MSG_IP_SUBKEY_FLAGS_CESA (LogLevel.DEBUG, R.string.msg_ip_subkey_flags_cesa),
MSG_IP_SUBKEY_FLAGS_CESX (LogLevel.DEBUG, R.string.msg_ip_subkey_flags_cesx),
MSG_IP_SUBKEY_FLAGS_CEXA (LogLevel.DEBUG, R.string.msg_ip_subkey_flags_cexa),

View File

@ -561,6 +561,7 @@
<string name="msg_ip_master">"Processing master key %s"</string>
<string name="msg_ip_master_expired">"Keyring expired on %s"</string>
<string name="msg_ip_master_expires">"Keyring expires on %s"</string>
<string name="msg_ip_master_flags_unspecified">"Master flags: unspecified (assuming all)"</string>
<string name="msg_ip_master_flags_cesa">"Master flags: certify, encrypt, sign, authenticate"</string>
<string name="msg_ip_master_flags_cesx">"Master flags: certify, encrypt, sign"</string>
<string name="msg_ip_master_flags_cexa">"Master flags: certify, encrypt, authenticate"</string>
@ -580,6 +581,7 @@
<string name="msg_ip_subkey">"Processing subkey %s"</string>
<string name="msg_ip_subkey_expired">"Subkey expired on %s"</string>
<string name="msg_ip_subkey_expires">"Subkey expires on %s"</string>
<string name="msg_ip_subkey_flags_unspecified">"Subkey flags: unspecified (assuming all)"</string>
<string name="msg_ip_subkey_flags_cesa">"Subkey flags: certify, encrypt, sign, authenticate"</string>
<string name="msg_ip_subkey_flags_cesx">"Subkey flags: certify, encrypt, sign"</string>
<string name="msg_ip_subkey_flags_cexa">"Subkey flags: certify, encrypt, authenticate"</string>