[openssh-commits] [openssh] 11/11: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Sun May 10 11:59:19 AEST 2015


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit d028d5d3a697c71b21e4066d8672cacab3caa0a8
Author: Damien Miller <djm at mindrot.org>
Date:   Tue May 5 19:10:58 2015 +1000

    upstream commit
    
       - tedu at cvs.openbsd.org 2015/01/12 03:20:04
         [bcrypt_pbkdf.c]
         rename blocks to words. bcrypt "blocks" are unrelated to blowfish blocks,
         nor are they the same size.
---
 openbsd-compat/bcrypt_pbkdf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/openbsd-compat/bcrypt_pbkdf.c b/openbsd-compat/bcrypt_pbkdf.c
index 905fc5d..0a07f9a 100644
--- a/openbsd-compat/bcrypt_pbkdf.c
+++ b/openbsd-compat/bcrypt_pbkdf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcrypt_pbkdf.c,v 1.12 2015/01/08 00:30:07 deraadt Exp $ */
+/* $OpenBSD: bcrypt_pbkdf.c,v 1.13 2015/01/12 03:20:04 tedu Exp $ */
 /*
  * Copyright (c) 2013 Ted Unangst <tedu at openbsd.org>
  *
@@ -63,8 +63,8 @@
  * wise caller could do; we just do it for you.
  */
 
-#define BCRYPT_BLOCKS 8
-#define BCRYPT_HASHSIZE (BCRYPT_BLOCKS * 4)
+#define BCRYPT_WORDS 8
+#define BCRYPT_HASHSIZE (BCRYPT_WORDS * 4)
 
 static void
 bcrypt_hash(u_int8_t *sha2pass, u_int8_t *sha2salt, u_int8_t *out)
@@ -72,7 +72,7 @@ bcrypt_hash(u_int8_t *sha2pass, u_int8_t *sha2salt, u_int8_t *out)
 	blf_ctx state;
 	u_int8_t ciphertext[BCRYPT_HASHSIZE] =
 	    "OxychromaticBlowfishSwatDynamite";
-	uint32_t cdata[BCRYPT_BLOCKS];
+	uint32_t cdata[BCRYPT_WORDS];
 	int i;
 	uint16_t j;
 	size_t shalen = SHA512_DIGEST_LENGTH;
@@ -87,14 +87,14 @@ bcrypt_hash(u_int8_t *sha2pass, u_int8_t *sha2salt, u_int8_t *out)
 
 	/* encryption */
 	j = 0;
-	for (i = 0; i < BCRYPT_BLOCKS; i++)
+	for (i = 0; i < BCRYPT_WORDS; i++)
 		cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext),
 		    &j);
 	for (i = 0; i < 64; i++)
 		blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t));
 
 	/* copy out */
-	for (i = 0; i < BCRYPT_BLOCKS; i++) {
+	for (i = 0; i < BCRYPT_WORDS; i++) {
 		out[4 * i + 3] = (cdata[i] >> 24) & 0xff;
 		out[4 * i + 2] = (cdata[i] >> 16) & 0xff;
 		out[4 * i + 1] = (cdata[i] >> 8) & 0xff;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list