summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Fontaine <arnaud.fontaine@ssi.gouv.fr>2018-02-08 19:03:08 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2018-02-13 01:28:13 +0100
commit25f3b69129015c54392636818c8846e236f5cb2c (patch)
tree6aa5691a97411fedfd347ed10d79312782dec4dd
parentscd: Fix handling for Data Object with no data. (diff)
downloadgnupg2-25f3b69129015c54392636818c8846e236f5cb2c.tar.xz
gnupg2-25f3b69129015c54392636818c8846e236f5cb2c.zip
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>
Diffstat (limited to '')
-rw-r--r--scd/app-openpgp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 5b1b0d339..f3065edf0 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -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;