From 45c49a0030c7a01ec011ce810ddb3aaef734e9bf Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 2 Jul 2015 12:14:40 +0900 Subject: [PATCH] scd: Support AES decryption for OpenPGPcard v3.0. * scd/app-openpgp.c (do_decipher): Support AES decryption. --- scd/app-openpgp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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