diff options
Diffstat (limited to 'g10/seckey-cert.c')
-rw-r--r-- | g10/seckey-cert.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c index dff463c53..65be7a468 100644 --- a/g10/seckey-cert.c +++ b/g10/seckey-cert.c @@ -297,11 +297,14 @@ check_secret_key( PKT_secret_key *sk, int n ) /**************** * check whether the secret key is protected. * Returns: 0 not protected, -1 on error or the protection algorithm + * -2 indicates a card stub. */ int is_secret_key_protected( PKT_secret_key *sk ) { - return sk->is_protected? sk->protect.algo : 0; + return sk->is_protected? + sk->protect.s2k.mode == 1002? -2 + : sk->protect.algo : 0; } |