diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 22:29:47 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 22:29:47 +0100 |
commit | 84b234af3720368fcf6c61dcd61b8a7d8986a1b4 (patch) | |
tree | 8379e3b2b7e0f03a6675ea7a27f517d1cee3382a /OpenKeychain/src/main/java/org | |
parent | ce58eb4b032c6919239bf407ed6cbd2dfeadfbbb (diff) | |
download | open-keychain-84b234af3720368fcf6c61dcd61b8a7d8986a1b4.tar.gz open-keychain-84b234af3720368fcf6c61dcd61b8a7d8986a1b4.tar.bz2 open-keychain-84b234af3720368fcf6c61dcd61b8a7d8986a1b4.zip |
Display error on certification attempt with yubikey
Closes #978
Diffstat (limited to 'OpenKeychain/src/main/java/org')
2 files changed, 6 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java index 9af6713ba..3bd412c36 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java @@ -7,6 +7,7 @@ import org.sufficientlysecure.keychain.keyimport.HkpKeyserver; import org.sufficientlysecure.keychain.keyimport.Keyserver.AddKeyException; import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKeyRing; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey; +import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey.SecretKeyType; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing; import org.sufficientlysecure.keychain.pgp.Progressable; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; @@ -57,6 +58,10 @@ public class CertifyOperation extends BaseOperation { mProviderHelper.getCanonicalizedSecretKeyRing(parcel.mMasterKeyId); log.add(LogType.MSG_CRT_UNLOCK, 1); certificationKey = secretKeyRing.getSecretKey(); + if (certificationKey.getSecretKeyType() == SecretKeyType.DIVERT_TO_CARD) { + log.add(LogType.MSG_CRT_ERROR_DIVERT, 2); + return new CertifyResult(CertifyResult.RESULT_ERROR, log); + } if (!certificationKey.unlock(passphrase)) { log.add(LogType.MSG_CRT_ERROR_UNLOCK, 2); return new CertifyResult(CertifyResult.RESULT_ERROR, log); 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 920c83ef7..dc45fabc3 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 @@ -575,6 +575,7 @@ public abstract class OperationResult implements Parcelable { MSG_CRT_ERROR_MASTER_NOT_FOUND (LogLevel.ERROR, R.string.msg_crt_error_master_not_found), MSG_CRT_ERROR_NOTHING (LogLevel.ERROR, R.string.msg_crt_error_nothing), MSG_CRT_ERROR_UNLOCK (LogLevel.ERROR, R.string.msg_crt_error_unlock), + MSG_CRT_ERROR_DIVERT (LogLevel.ERROR, R.string.msg_crt_error_divert), MSG_CRT (LogLevel.START, R.string.msg_crt), MSG_CRT_MASTER_FETCH (LogLevel.DEBUG, R.string.msg_crt_master_fetch), MSG_CRT_SAVE (LogLevel.DEBUG, R.string.msg_crt_save), |