From 862c9a8b3ccaadcc712b288b19db49fd5afd533a Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 22 Sep 2014 17:02:53 +0200 Subject: log "unspecified" flags differently --- .../sufficientlysecure/keychain/provider/ProviderHelper.java | 12 ++++++++++-- .../keychain/service/results/OperationResult.java | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenKeychain/src/main/java/org') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java index 6856f087d..f8600d9d4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java @@ -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_MASTER[(c?1:0) + (e?2:0) + (s?4:0) + (a?8:0)]); + } } else { - log(LOG_TYPES_FLAG_SUBKEY[(c?1:0) + (e?2:0) + (s?4:0) + (a?8:0)]); + 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(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java index fc8fbd4e4..69516eafd 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java @@ -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), -- cgit v1.2.3