Module Name:    src
Committed By:   dholland
Date:           Sat Aug 10 18:42:29 UTC 2013

Modified Files:
        src/lib/libcrypt: Makefile crypt-sha1.c

Log Message:
Silence -Wpointer-sign on crypt-sha1.c.
This requires casts, which is not entirely desirable; however, this way
at least no *more* pointer sign issues can creep in.

Output object files are unchanged on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libcrypt/Makefile
cvs rdiff -u -r1.6 -r1.7 src/lib/libcrypt/crypt-sha1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcrypt/Makefile
diff -u src/lib/libcrypt/Makefile:1.24 src/lib/libcrypt/Makefile:1.25
--- src/lib/libcrypt/Makefile:1.24	Fri Aug 10 04:30:47 2012
+++ src/lib/libcrypt/Makefile	Sat Aug 10 18:42:29 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2012/08/10 04:30:47 joerg Exp $
+#	$NetBSD: Makefile,v 1.25 2013/08/10 18:42:29 dholland Exp $
 
 USE_SHLIBDIR=	yes
 
@@ -24,5 +24,3 @@ LDSTATIC?= -static
 .else
 .include <bsd.lib.mk>
 .endif
-
-COPTS.crypt-sha1.c+=	-Wno-pointer-sign

Index: src/lib/libcrypt/crypt-sha1.c
diff -u src/lib/libcrypt/crypt-sha1.c:1.6 src/lib/libcrypt/crypt-sha1.c:1.7
--- src/lib/libcrypt/crypt-sha1.c:1.6	Mon Jun 24 04:21:20 2013
+++ src/lib/libcrypt/crypt-sha1.c	Sat Aug 10 18:42:29 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: crypt-sha1.c,v 1.6 2013/06/24 04:21:20 riastradh Exp $ */
+/* $NetBSD: crypt-sha1.c,v 1.7 2013/08/10 18:42:29 dholland Exp $ */
 
 /*
  * Copyright (c) 2004, Juniper Networks, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: crypt-sha1.c,v 1.6 2013/06/24 04:21:20 riastradh Exp $");
+__RCSID("$NetBSD: crypt-sha1.c,v 1.7 2013/08/10 18:42:29 dholland Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -130,6 +130,8 @@ __crypt_sha1 (const char *pw, const char
     int dl;
     unsigned int iterations;
     unsigned int i;
+    /* XXX silence -Wpointer-sign (would be nice to fix this some other way) */
+    const unsigned char *pwu = (const unsigned char *)pw;
 
     /*
      * Salt format is
@@ -166,9 +168,9 @@ __crypt_sha1 (const char *pw, const char
     /*
      * Then hmac using <pw> as key, and repeat...
      */
-    __hmac_sha1(passwd, dl, pw, pl, hmac_buf);
+    __hmac_sha1((unsigned char *)passwd, dl, pwu, pl, hmac_buf);
     for (i = 1; i < iterations; i++) {
-	__hmac_sha1(hmac_buf, SHA1_SIZE, pw, pl, hmac_buf);
+	__hmac_sha1(hmac_buf, SHA1_SIZE, pwu, pl, hmac_buf);
     }
     /* Now output... */
     pl = snprintf(passwd, sizeof(passwd), "%s%u$%.*s$",

Reply via email to