From f691ef2a262012898c3f0b61fa9357a59292288b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 11 Jan 2016 08:13:51 +0100 Subject: Error out when editing a stripped key --- .../java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src') 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 40a17a918..c42608a6b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -460,6 +460,11 @@ public class PgpKeyOperation { } } + if (isDummy(masterSecretKey) && ! saveParcel.isRestrictedOnly()) { + log.add(LogType.MSG_EK_ERROR_DUMMY, indent); + return new PgpEditKeyResult(PgpEditKeyResult.RESULT_ERROR, log, null); + } + if (isDummy(masterSecretKey) || saveParcel.isRestrictedOnly()) { log.add(LogType.MSG_MF_RESTRICTED_MODE, indent); return internalRestricted(sKR, saveParcel, log, indent + 1); @@ -1128,7 +1133,7 @@ public class PgpKeyOperation { progress(R.string.progress_modify, 0); - // Make sure the saveParcel includes only operations available without passphrae! + // Make sure the saveParcel includes only operations available without passphrase! if (!saveParcel.isRestrictedOnly()) { log.add(LogType.MSG_MF_ERROR_RESTRICTED, indent); return new PgpEditKeyResult(PgpEditKeyResult.RESULT_ERROR, log, null); -- cgit v1.2.3