From 2ed25ab8f332f56b24182acf5d8cfe04211bde72 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Thu, 5 Jan 2017 11:10:11 +0100 Subject: [PATCH] Update RSA key size error for security tokens --- .../keychain/operations/results/OperationResult.java | 2 +- .../org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java | 4 ++-- OpenKeychain/src/main/res/values/strings.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java index aaaeaff23..1164d3ff6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java @@ -565,7 +565,7 @@ public abstract class OperationResult implements Parcelable { MSG_MF_ERROR_DUPLICATE_KEYTOCARD_FOR_SLOT(LogLevel.ERROR, R.string.msg_mf_error_duplicate_keytocard_for_slot), MSG_MF_ERROR_INVALID_FLAGS_FOR_KEYTOCARD(LogLevel.ERROR, R.string.msg_mf_error_invalid_flags_for_keytocard), MSG_MF_ERROR_BAD_SECURITY_TOKEN_ALGO(LogLevel.ERROR, R.string.edit_key_error_bad_security_token_algo), - MSG_MF_ERROR_BAD_SECURITY_TOKEN_SIZE(LogLevel.ERROR, R.string.edit_key_error_bad_security_token_size), + MSG_MF_ERROR_BAD_SECURITY_TOKEN_RSA_KEY_SIZE(LogLevel.ERROR, R.string.edit_key_error_bad_security_token_size), MSG_MF_ERROR_BAD_SECURITY_TOKEN_CURVE(LogLevel.ERROR, R.string.edit_key_error_bad_security_token_curve), MSG_MF_ERROR_BAD_SECURITY_TOKEN_STRIPPED(LogLevel.ERROR, R.string.edit_key_error_bad_security_token_stripped), MSG_MF_MASTER (LogLevel.DEBUG, R.string.msg_mf_master), diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index ed5d925ec..cae4eca08 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -1657,9 +1657,9 @@ public class PgpKeyOperation { case PublicKeyAlgorithmTags.RSA_ENCRYPT: case PublicKeyAlgorithmTags.RSA_SIGN: case PublicKeyAlgorithmTags.RSA_GENERAL: - // Key size must be at least 2048 + // Key size must be at least 2048 since OpenPGP card specification 3.x if (publicKey.getBitStrength() < 2048) { - log.add(LogType.MSG_MF_ERROR_BAD_SECURITY_TOKEN_SIZE, indent + 1); + log.add(LogType.MSG_MF_ERROR_BAD_SECURITY_TOKEN_RSA_KEY_SIZE, indent + 1); return false; } break; diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 6cdb18d12..c832953fc 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -785,7 +785,7 @@ "Add at least one identity!" "Add at least one subkey!" "Algorithm not supported by Security Token!" - "Key size not supported by Security Token!" + "RSA key lower than 2048 bits is not supported by Security Token since OpenPGP card specification 3.x!" "Curve not supported by Security Token!" "Cannot move key to Security Token (either stripped or already on Security Token)!"