diff options
| author | Werner Koch <[email protected]> | 2009-04-01 14:38:22 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2009-04-01 14:38:22 +0000 |
| commit | 9d6a2a60c2c3828b20c5b2114ee644515db30cf8 (patch) | |
| tree | a876f867e6e83afdc528da86decaf2e7be9eb2d7 /scd/app-openpgp.c | |
| parent | Ported changes from 1.4. (diff) | |
| download | gnupg-9d6a2a60c2c3828b20c5b2114ee644515db30cf8.tar.gz gnupg-9d6a2a60c2c3828b20c5b2114ee644515db30cf8.zip | |
Prepare for OpenPGP cards with extended length support.
Diffstat (limited to 'scd/app-openpgp.c')
| -rw-r--r-- | scd/app-openpgp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 2c89e8c3c..6f48cb8ce 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -1772,9 +1772,11 @@ do_setattr (app_t app, const char *name, will reread the data from the card and thus get synced in case of errors (e.g. data truncated by the card). */ flush_cache_item (app, table[idx].tag); - /* For command chaining we use a value of 254 for this card. */ - if (app->app_local->cardcap.cmd_chaining && valuelen > 254) - exmode = -254; + + if (app->app_local->cardcap.ext_lc_le && valuelen > 254) + exmode = 1; /* Use extended length w/o a limit. */ + else if (app->app_local->cardcap.cmd_chaining && valuelen > 254) + exmode = -254; /* Command chaining with max. 254 bytes. */ else exmode = 0; rc = iso7816_put_data (app->slot, exmode, table[idx].tag, value, valuelen); @@ -2432,7 +2434,9 @@ do_writekey (app_t app, ctrl_t ctrl, goto leave; /* Store the key. */ - if (app->app_local->cardcap.cmd_chaining && template_len > 254) + if (app->app_local->cardcap.ext_lc_le && template_len > 254) + exmode = 1; /* Use extended length w/o a limit. */ + else if (app->app_local->cardcap.cmd_chaining && template_len > 254) exmode = -254; else exmode = 0; |
