aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2015-07-02 03:14:40 +0000
committerNIIBE Yutaka <[email protected]>2015-07-02 03:14:40 +0000
commit45c49a0030c7a01ec011ce810ddb3aaef734e9bf (patch)
tree56047a760e49aeaa4e79f59118308dad821ecb0c /scd/app-openpgp.c
parentPost release updates (diff)
downloadgnupg-45c49a0030c7a01ec011ce810ddb3aaef734e9bf.tar.gz
gnupg-45c49a0030c7a01ec011ce810ddb3aaef734e9bf.zip
scd: Support AES decryption for OpenPGPcard v3.0.
* scd/app-openpgp.c (do_decipher): Support AES decryption.
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 467389d5a..f5911f3c6 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -4101,7 +4101,10 @@ do_decipher (app_t app, const char *keyidstr,
if (rc)
return rc;
- if (app->app_local->keyattr[1].key_type == KEY_TYPE_RSA)
+ if (indatalen == 16 + 1 || indatalen == 32 + 1)
+ /* PSO:DECIPHER with symmetric key. */
+ padind = -1;
+ else if (app->app_local->keyattr[1].key_type == KEY_TYPE_RSA)
{
/* We might encounter a couple of leading zeroes in the
cryptogram. Due to internal use of MPIs these leading zeroes