1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-10 23:49:50 +02:00

scd:openpgp: Fix PIN pin2hash_if_kdf.

* scd/app-openpgp.c (pin2hash_if_kdf): DEK had been changed to pointer
to allocated memory, so, we need to use DEKLEN for the length.

--

GnuPG-bug-id: 7121
Fixes-commit: 20e85585ed
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-05-16 10:28:38 +09:00
parent 97b37db144
commit bb57c808b2
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -2534,7 +2534,7 @@ pin2hash_if_kdf (app_t app, int chvno, const char *pin,
err = gcry_kdf_derive (pin, pinlen,
GCRY_KDF_ITERSALTED_S2K,
DIGEST_ALGO_SHA256, salt, 8,
s2k_count, sizeof (dek), dek);
s2k_count, deklen, dek);
if (!err)
{
*r_pinlen = deklen;