Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 01:09:42 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221471 - head/lib/libcrypt
Message-ID:  <201105050109.p4519geI074956@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Thu May  5 01:09:42 2011
New Revision: 221471
URL: http://svn.freebsd.org/changeset/base/221471

Log:
  s/shaN_crypt/crypt_shaN/g to be a more consistent with the existing naming.
  
  Reviewed by:	markm

Modified:
  head/lib/libcrypt/crypt-sha256.c
  head/lib/libcrypt/crypt-sha512.c
  head/lib/libcrypt/crypt.c
  head/lib/libcrypt/crypt.h

Modified: head/lib/libcrypt/crypt-sha256.c
==============================================================================
--- head/lib/libcrypt/crypt-sha256.c	Thu May  5 00:52:19 2011	(r221470)
+++ head/lib/libcrypt/crypt-sha256.c	Thu May  5 01:09:42 2011	(r221471)
@@ -60,7 +60,7 @@ static const char sha256_rounds_prefix[]
 #define ROUNDS_MAX 999999999
 
 static char *
-sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
+crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen)
 {
 	u_long srounds;
 	int n;
@@ -268,12 +268,12 @@ sha256_crypt_r(const char *key, const ch
 
 /* This entry point is equivalent to crypt(3). */
 char *
-sha256_crypt(const char *key, const char *salt)
+crypt_sha256(const char *key, const char *salt)
 {
 	/* We don't want to have an arbitrary limit in the size of the
 	 * password. We can compute an upper bound for the size of the
 	 * result in advance and so we can prepare the buffer we pass to
-	 * `sha256_crypt_r'. */
+	 * `crypt_sha256_r'. */
 	static char *buffer;
 	static int buflen;
 	int needed;
@@ -293,7 +293,7 @@ sha256_crypt(const char *key, const char
 		buflen = needed;
 	}
 
-	return sha256_crypt_r(key, salt, buffer, buflen);
+	return crypt_sha256_r(key, salt, buffer, buflen);
 }
 
 #ifdef TEST
@@ -459,7 +459,7 @@ main(void)
 	}
 
 	for (cnt = 0; cnt < ntests2; ++cnt) {
-		char *cp = sha256_crypt(tests2[cnt].input, tests2[cnt].salt);
+		char *cp = crypt_sha256(tests2[cnt].input, tests2[cnt].salt);
 
 		if (strcmp(cp, tests2[cnt].expected) != 0) {
 			printf("test %d: expected \"%s\", got \"%s\"\n",

Modified: head/lib/libcrypt/crypt-sha512.c
==============================================================================
--- head/lib/libcrypt/crypt-sha512.c	Thu May  5 00:52:19 2011	(r221470)
+++ head/lib/libcrypt/crypt-sha512.c	Thu May  5 01:09:42 2011	(r221471)
@@ -60,7 +60,7 @@ static const char sha512_rounds_prefix[]
 #define ROUNDS_MAX 999999999
 
 static char *
-sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
+crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen)
 {
 	u_long srounds;
 	int n;
@@ -280,12 +280,12 @@ sha512_crypt_r(const char *key, const ch
 
 /* This entry point is equivalent to crypt(3). */
 char *
-sha512_crypt(const char *key, const char *salt)
+crypt_sha512(const char *key, const char *salt)
 {
 	/* We don't want to have an arbitrary limit in the size of the
 	 * password. We can compute an upper bound for the size of the
 	 * result in advance and so we can prepare the buffer we pass to
-	 * `sha512_crypt_r'. */
+	 * `crypt_sha512_r'. */
 	static char *buffer;
 	static int buflen;
 	int needed;
@@ -305,7 +305,7 @@ sha512_crypt(const char *key, const char
 		buflen = needed;
 	}
 
-	return sha512_crypt_r(key, salt, buffer, buflen);
+	return crypt_sha512_r(key, salt, buffer, buflen);
 }
 
 #ifdef TEST
@@ -482,7 +482,7 @@ main(void)
 	}
 
 	for (cnt = 0; cnt < ntests2; ++cnt) {
-		char *cp = sha512_crypt(tests2[cnt].input, tests2[cnt].salt);
+		char *cp = crypt_sha512(tests2[cnt].input, tests2[cnt].salt);
 
 		if (strcmp(cp, tests2[cnt].expected) != 0) {
 			printf("test %d: expected \"%s\", got \"%s\"\n",

Modified: head/lib/libcrypt/crypt.c
==============================================================================
--- head/lib/libcrypt/crypt.c	Thu May  5 00:52:19 2011	(r221470)
+++ head/lib/libcrypt/crypt.c	Thu May  5 01:09:42 2011	(r221471)
@@ -64,12 +64,12 @@ static const struct {
 	},
 	{
 		"sha256",
-		sha256_crypt,
+		crypt_sha256,
 		"$5$"
 	},
 	{
 		"sha512",
-		sha512_crypt,
+		crypt_sha512,
 		"$6$"
 	},
 	{

Modified: head/lib/libcrypt/crypt.h
==============================================================================
--- head/lib/libcrypt/crypt.h	Thu May  5 00:52:19 2011	(r221470)
+++ head/lib/libcrypt/crypt.h	Thu May  5 01:09:42 2011	(r221471)
@@ -36,8 +36,8 @@ char *crypt_des(const char *pw, const ch
 char *crypt_md5(const char *pw, const char *salt);
 char *crypt_nthash(const char *pw, const char *salt);
 char *crypt_blowfish(const char *pw, const char *salt);
-char *sha256_crypt (const char *pw, const char *salt);
-char *sha512_crypt (const char *pw, const char *salt);
+char *crypt_sha256 (const char *pw, const char *salt);
+char *crypt_sha512 (const char *pw, const char *salt);
 
 extern void _crypt_to64(char *s, u_long v, int n);
 extern void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105050109.p4519geI074956>