diff options
| author | Werner Koch <[email protected]> | 2020-01-13 16:53:49 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2020-01-13 16:53:49 +0000 |
| commit | 60502c3606ee425d07c84b175ab310368c12b0ad (patch) | |
| tree | 304132e714b9e140a1f443550b4e3b713d4f59b8 /scd/scdaemon.h | |
| parent | agent: Avoid multiple calls to scd for KEYINFO. (diff) | |
| download | gnupg-60502c3606ee425d07c84b175ab310368c12b0ad.tar.gz gnupg-60502c3606ee425d07c84b175ab310368c12b0ad.zip | |
scd:piv: Implement PIN cache.
* scd/command.c (pincache_put): Add arg pinlen and change all callers
to provide it.
* scd/app-piv.c (cache_pin): New.
(pin_from_cache): New.
(ask_and_prepare_chv): Add args no_cache and r_unpaddedpinlen. Take
PIN from the cache. Return the unpadded length.
(verify_chv): Add arg ctrl. Cache the PIN.
(do_change_chv): Clear PIN cache.
--
The PIV pins are padded but we want to store the unpadded PIN. Thus
the changes to the function.
Code has has been tested by commenting the no_cache parameter because
we the current test certificate was created for PIV.9C which requires
a verification for each use. More testing is required.
GnuPG-bug-id: 4791
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/scdaemon.h')
| -rw-r--r-- | scd/scdaemon.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scd/scdaemon.h b/scd/scdaemon.h index 4a3ede37e..1c46d673a 100644 --- a/scd/scdaemon.h +++ b/scd/scdaemon.h @@ -138,7 +138,7 @@ void send_keyinfo (ctrl_t ctrl, int data, const char *keygrip_str, const char *serialno, const char *idstr); void pincache_put (ctrl_t ctrl, int slot, const char *appname, - const char *pinref, const char *pin); + const char *pinref, const char *pin, unsigned int pinlen); gpg_error_t pincache_get (ctrl_t ctrl, int slot, const char *appname, const char *pinref, char **r_pin); |
