]> err.no Git - yubikey-personalization.old/commitdiff
Fix bug that prevented salting during AES key generation
authorsimon75j <simon75j@b62f149e-849f-11dd-9899-c7ba65f7c4c7>
Fri, 10 Sep 2010 07:28:46 +0000 (07:28 +0000)
committersimon75j <simon75j@b62f149e-849f-11dd-9899-c7ba65f7c4c7>
Fri, 10 Sep 2010 07:28:46 +0000 (07:28 +0000)
from passwords from working.  Reported by Ben.

git-svn-id: https://yubikey-personalization.googlecode.com/svn/trunk@259 b62f149e-849f-11dd-9899-c7ba65f7c4c7

NEWS
ykpers.c

diff --git a/NEWS b/NEWS
index 93626859ef66efa13949800f14a528750610f939..27a4090f03e769ba8e08d4559c061c99b882c872 100644 (file)
--- 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.
 
index a2fae760d3585b8c578c3628232ba55a975eb6b1..5dbc6933f6fdccbf3647f89934c206497a028b72 100644 (file)
--- 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;
                                        }