scd: Improve KDF-DO support

* scd/app-openpgp.c (pin2hash_if_kdf): Check the content of KDF DO.

--

Length check added by gniibe.

Signed-off-by: Arnaud Fontaine <arnaud.fontaine@ssi.gouv.fr>
This commit is contained in:
Arnaud Fontaine 2018-02-08 19:03:08 +01:00 committed by NIIBE Yutaka
parent 0a3bec2c25
commit 25f3b69129
1 changed files with 2 additions and 1 deletions

View File

@ -2072,7 +2072,8 @@ pin2hash_if_kdf (app_t app, int chvno, char *pinvalue, int *r_pinlen)
size_t buflen;
if (app->app_local->extcap.kdf_do
&& (relptr = get_one_do (app, 0x00F9, &buffer, &buflen, NULL)))
&& (relptr = get_one_do (app, 0x00F9, &buffer, &buflen, NULL))
&& buflen == 110 && (buffer[2] == 0x03))
{
char *salt;
unsigned long s2k_count;