From 0fa72604a12a82d08e916903373d224979f362bf Mon Sep 17 00:00:00 2001 From: simon75j Date: Fri, 10 Sep 2010 07:28:46 +0000 Subject: [PATCH] Fix bug that prevented salting during AES key generation from passwords from working. Reported by Ben. git-svn-id: https://yubikey-personalization.googlecode.com/svn/trunk@259 b62f149e-849f-11dd-9899-c7ba65f7c4c7 --- NEWS | 3 +++ ykpers.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.39.5