From: Simon Josefsson Date: Fri, 10 Sep 2010 07:28:46 +0000 (+0000) Subject: Fix bug that prevented salting during AES key generation X-Git-Tag: yubikey-personalisation_1.3.5-1~4^2~16 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27a18bc8ce4df4a4500223a6f9a54815a3f46c70;p=yubikey-personalization Fix bug that prevented salting during AES key generation from passwords from working. Reported by Ben. --- diff --git a/NEWS b/NEWS index 9362685..27a4090 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ Yubikey-personalize NEWS -- History of user-visible changes. -*- outline -*- * Version 1.3.4 (unreleased) +** Fix bug that prevented salting during AES key generation +** from passwords from working. Reported by Ben. + ** Add contrib/ sub-directory and contrib/programming.sh from David Dindorp. See contrib/README for more information. diff --git a/ykpers.c b/ykpers.c index a2fae76..5dbc693 100644 --- a/ykpers.c +++ b/ykpers.c @@ -1,6 +1,6 @@ /* -*- mode:C; c-file-style: "bsd" -*- */ /* - * Copyright (c) 2008, 2009, Yubico AB + * Copyright (c) 2008, 2009, 2010, Yubico AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -178,8 +178,8 @@ int ykp_AES_key_from_passphrase(YKP_CONFIG *cfg, const char *passphrase, size_t read_bytes = 0; while (read_bytes < sizeof(_salt)) { - size_t n = fread(&cfg->ykcore_config.key[read_bytes], - 1, KEY_SIZE - read_bytes, + size_t n = fread(&_salt[read_bytes], + 1, sizeof (_salt) - read_bytes, random_file); read_bytes += n; }