[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:38:37 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/dfa826621247
changeset: 369:dfa826621247
user:      ray at terran.dlink.ua
date:      Fri Mar 02 17:00:58 2012 +0200
description:
Update to FreeBSD-HEAD @232391

diffstat:

 head/secure/lib/libcrypt/crypt-blowfish.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r e6f773cb401d -r dfa826621247 head/secure/lib/libcrypt/crypt-blowfish.c
--- a/head/secure/lib/libcrypt/crypt-blowfish.c	Fri Mar 02 17:00:47 2012 +0200
+++ b/head/secure/lib/libcrypt/crypt-blowfish.c	Fri Mar 02 17:00:58 2012 +0200
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/secure/lib/libcrypt/crypt-blowfish.c 231986 2012-02-22 01:23:14Z kevlo $");
 
 /* This password hashing algorithm was designed by David Mazieres
  * <dm at lcs.mit.edu> and works as follows:
@@ -72,7 +72,6 @@
 static void decode_base64(u_int8_t *, u_int16_t, const u_int8_t *);
 
 static char    encrypted[_PASSWORD_LEN];
-static char    error[] = ":";
 
 static const u_int8_t Base64Code[] =
 "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -160,8 +159,8 @@
 		salt++;
 
 		if (*salt > BCRYPT_VERSION) {
-			/* How do I handle errors ? Return ':' */
-			return error;
+			/* How do I handle errors ? Return NULL */
+			return NULL;
 		}
 
 		/* Check for minor versions */
@@ -173,7 +172,7 @@
 				 salt++;
 				 break;
 			 default:
-				 return error;
+				 return NULL;
 			 }
 		} else
 			 minr = 0;
@@ -183,13 +182,13 @@
 
 		if (salt[2] != '$')
 			/* Out of sync with passwd entry */
-			return error;
+			return NULL;
 
 		/* Computer power doesnt increase linear, 2^x should be fine */
 		logr = (u_int8_t)atoi(salt);
 		rounds = 1 << logr;
 		if (rounds < BCRYPT_MINROUNDS)
-			return error;
+			return NULL;
 
 		/* Discard num rounds + "$" identifier */
 		salt += 3;


More information about the Zrouter-src-freebsd mailing list