diff options
Diffstat (limited to 'g10/app-openpgp.c')
-rw-r--r-- | g10/app-openpgp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/g10/app-openpgp.c b/g10/app-openpgp.c index 2c10cd9bf..9ab949345 100644 --- a/g10/app-openpgp.c +++ b/g10/app-openpgp.c @@ -3316,7 +3316,7 @@ do_decipher (app_t app, const char *keyidstr, const char *s; int n; const char *fpr = NULL; - int exmode; + int exmode, le_value; if (!keyidstr || !*keyidstr || !indatalen) return gpg_error (GPG_ERR_INV_VALUE); @@ -3399,16 +3399,22 @@ do_decipher (app_t app, const char *keyidstr, indatalen = fixuplen + indatalen; padind = -1; /* Already padded. */ } - + if (app->app_local->cardcap.ext_lc_le && indatalen > 254 ) - exmode = 1; /* Extended length w/o a limit. */ + { + exmode = 1; /* Extended length w/o a limit. */ + le_value = app->app_local->extcap.max_rsp_data; + } else if (app->app_local->cardcap.cmd_chaining && indatalen > 254) - exmode = -254; /* Command chaining with max. 254 bytes. */ + { + exmode = -254; /* Command chaining with max. 254 bytes. */ + le_value = 0; + } else - exmode = 0; + exmode = le_value = 0; rc = iso7816_decipher (app->slot, exmode, - indata, indatalen, padind, + indata, indatalen, le_value, padind, outdata, outdatalen); xfree (fixbuf); } |