From 8a188a79dc289052b66f44ff6b57437d59a0cfa6 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 13 Sep 2014 21:43:37 +0200 Subject: [PATCH] log warning on bad uid encoding --- .../org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java | 5 +++++ .../keychain/service/results/OperationResultParcel.java | 1 + OpenKeychain/src/main/res/values/strings.xml | 1 + 3 files changed, 7 insertions(+) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java index fe4e7ffa7..3a8514faa 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java @@ -438,6 +438,11 @@ public class UncachedKeyRing { badCerts += 1; continue; } + // warn user if the signature was made with bad encoding + if (!cert.verifySignature(masterKey, userId)) { + log.add(LogLevel.WARN, LogType.MSG_KC_UID_WARN_ENCODING, + indent, userId); + } } catch (PgpGeneralException e) { log.add(LogLevel.WARN, LogType.MSG_KC_UID_BAD_ERR, indent, userId); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java index 1a77d96d3..46823a24d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java @@ -339,6 +339,7 @@ public class OperationResultParcel implements Parcelable { MSG_KC_UID_REVOKE_DUP (R.string.msg_kc_uid_revoke_dup), MSG_KC_UID_REVOKE_OLD (R.string.msg_kc_uid_revoke_old), MSG_KC_UID_REMOVE (R.string.msg_kc_uid_remove), + MSG_KC_UID_WARN_ENCODING (R.string.msg_kc_uid_warn_encoding), // keyring consolidation diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 378d68c21..9e9b47c7c 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -661,6 +661,7 @@ "No valid self-certificate found for user id '%s', removing from ring" "Removing invalid user id '%s'" "Removing duplicate user id '%s'. The secret key contained two of them. This may result in missing certificates!" + "User id does not verify as UTF-8!" "New public subkey found, but secret subkey dummy generation is not supported!"