diff options
author | Werner Koch <[email protected]> | 2019-04-03 13:30:10 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-04-03 13:30:10 +0000 |
commit | ec6a6779236a89d4784a6bb7de0def9cc0f9e8a4 (patch) | |
tree | 69e7cc27c2e651f5b76dc20b97d90632d050897a /g10/pubkey-enc.c | |
parent | scd: New standard attributes $ENCRKEYID and $SIGNKEYID. (diff) | |
download | gnupg-ec6a6779236a89d4784a6bb7de0def9cc0f9e8a4.tar.gz gnupg-ec6a6779236a89d4784a6bb7de0def9cc0f9e8a4.zip |
gpg: Allow decryption using PIV cards.
* g10/call-agent.c (struct getattr_one_parm_s): New.
(getattr_one_status_cb): New.
(agent_scd_getattr_one): New.
* g10/pubkey-enc.c (get_it): Allow the standard leading zero byte from
pkcs#1.
* g10/skclist.c (enum_secret_keys): Handle non-OpenPGP cards.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/pubkey-enc.c')
-rw-r--r-- | g10/pubkey-enc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 055c39b8f..f61fa7abe 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -319,6 +319,16 @@ get_it (ctrl_t ctrl, err = gpg_error (GPG_ERR_WRONG_SECKEY); goto leave; } + + /* FIXME: Actually the leading zero is required but due to + * the way we encode the output in libgcrypt as an MPI we + * are not able to encode that leading zero. However, when + * using a Smartcard we are doing it the right way and + * therefore we have to skip the zero. This should be fixed + * in gpg-agent of course. */ + if (!frame[n]) + n++; + if (frame[n] == 1 && frame[nframe - 1] == 2) { log_info (_("old encoding of the DEK is not supported\n")); |