changeset 10935:fb2b65d50333

4988677 crypt modules still are not lint-clean
author Dan OpenSolaris Anderson <opensolaris@drydog.com>
date Mon, 02 Nov 2009 17:07:53 -0800
parents e209937a4f19
children e52b5709a64a
files usr/src/lib/crypt_modules/Makefile.crypt_modules usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c usr/src/lib/crypt_modules/sha256/crypt_sha.c usr/src/lib/crypt_modules/sunmd5/sunmd5.c
diffstat 4 files changed, 32 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/crypt_modules/Makefile.crypt_modules	Mon Nov 02 15:39:20 2009 -0800
+++ b/usr/src/lib/crypt_modules/Makefile.crypt_modules	Mon Nov 02 17:07:53 2009 -0800
@@ -19,11 +19,9 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 #
 # Common build macros used by (most every) crypt module.
@@ -35,8 +33,6 @@
 
 CFLAGS		+= $(CCVERBOSE)
 CPPFLAGS	+= -D_REENTRANT
-LINTFLAGS	+= -y
-LINTFLAGS64	+= -y
 
 ROOTLIBDIR=	$(ROOT)/usr/lib/security
 ROOTLIBDIR64=	$(ROOT)/usr/lib/security/$(MACH64)
--- a/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c	Mon Nov 02 15:39:20 2009 -0800
+++ b/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c	Mon Nov 02 17:07:53 2009 -0800
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,10 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * Portions of this code:
  * ----------------------------------------------------------------------------
@@ -62,12 +59,13 @@
 to64(char *s, uint64_t v, int n)
 {
 	while (--n >= 0) {
-		*s++ = itoa64[v&0x3f];
+		*s++ = itoa64[v & 0x3f];
 		v >>= 6;
 	}
 }
 
 
+/* ARGSUSED4 */
 char *
 crypt_genhash_impl(char *ctbuffer,
 	    size_t ctbufflen,
@@ -117,7 +115,7 @@
 		MD5Update(&ctx, final, pl > 16 ? 16 : pl);
 
 	/* Don't leave anything around in vm they could use. */
-	memset(final, 0, sizeof (final));
+	(void) memset(final, 0, sizeof (final));
 
 	/* Then something really weird... */
 	for (i = strlen(plaintext); i; i >>= 1) {
@@ -174,12 +172,13 @@
 	*p = '\0';
 
 	/* Don't leave anything around in vm they could use. */
-	memset(final, 0, sizeof (final));
+	(void) memset(final, 0, sizeof (final));
 
 	return (ctbuffer);
 }
 
 
+/* ARGSUSED2 */
 char *
 crypt_gensalt_impl(char *gsbuffer,
 	    size_t gsbufflen,
--- a/usr/src/lib/crypt_modules/sha256/crypt_sha.c	Mon Nov 02 15:39:20 2009 -0800
+++ b/usr/src/lib/crypt_modules/sha256/crypt_sha.c	Mon Nov 02 17:07:53 2009 -0800
@@ -112,7 +112,7 @@
 to64(char *s, uint64_t v, int n)
 {
 	while (--n >= 0) {
-		*s++ = b64t[v&0x3f];
+		*s++ = b64t[v & 0x3f];
 		v >>= 6;
 	}
 }
@@ -146,7 +146,7 @@
 	errno = 0;
 	val = strtol(p, &e, 10);
 	/*
-	 * An error occured or there is non-numeric stuff at the end
+	 * An error occurred or there is non-numeric stuff at the end
 	 * which isn't one of the crypt(3c) special chars ',' or '$'
 	 */
 	if (errno != 0 || val < 0 ||
@@ -158,6 +158,7 @@
 }
 
 
+/* ARGSUSED4 */
 char *
 crypt_genhash_impl(char *ctbuffer,
 	    size_t ctbufflen,
@@ -243,7 +244,7 @@
 	for (i = plaintext_len; i >= MIXCHARS; i -= MIXCHARS) {
 		Pp = (char *)(memcpy(Pp, DP, MIXCHARS)) + MIXCHARS;
 	}
-	memcpy(Pp, DP, i);
+	(void) memcpy(Pp, DP, i);
 
 	/* 17. - 19. */
 	DIGESTInit(&ctxDS);
@@ -256,7 +257,7 @@
 	for (i = salt_len; i >= MIXCHARS; i -= MIXCHARS) {
 		Sp = (char *)(memcpy(Sp, DS, MIXCHARS)) + MIXCHARS;
 	}
-	memcpy(Sp, DS, i);
+	(void) memcpy(Sp, DS, i);
 
 	/*  21. */
 	for (i = 0; i < rounds; i++) {
@@ -350,6 +351,8 @@
 	return (ctbuffer);
 }
 
+
+/* ARGSUSED3 */
 char *
 crypt_gensalt_impl(char *gsbuffer,
 	    size_t gsbufflen,
--- a/usr/src/lib/crypt_modules/sunmd5/sunmd5.c	Mon Nov 02 15:39:20 2009 -0800
+++ b/usr/src/lib/crypt_modules/sunmd5/sunmd5.c	Mon Nov 02 17:07:53 2009 -0800
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,13 +19,10 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -116,7 +112,7 @@
 to64(char *s, uint64_t v, int n)
 {
 	while (--n >= 0) {
-		*s++ = itoa64[v&0x3f];
+		*s++ = itoa64[v & 0x3f];
 		v >>= 6;
 	}
 }
@@ -150,7 +146,7 @@
 	errno = 0;
 	val = strtol(p, &e, 10);
 	/*
-	 * An error occured or there is non-numeric stuff at the end
+	 * An error occurred or there is non-numeric stuff at the end
 	 * which isn't one of the crypt(3c) special chars ',' or '$'
 	 */
 	if (errno != 0 || val < 0 ||
@@ -163,7 +159,7 @@
 	return ((uint32_t)val);
 }
 
-/*ARGSUSED*/
+/* ARGSUSED3 */
 char *
 crypt_gensalt_impl(char *gsbuffer,
 	    size_t gsbufflen,
@@ -401,15 +397,15 @@
 
 #if ALGDEBUG
 		for (i = 0; i < 15; i++) {
-			printf("%1x-", data.indirect_4[i]);
+			(void) printf("%1x-", data.indirect_4[i]);
 		}
-		printf("%1x ", data.indirect_4[15]);
+		(void) printf("%1x ", data.indirect_4[15]);
 		for (i = 0; i < 15; i++) {
-			printf("%02x-", data.indirect_7[i]);
+			(void) printf("%02x-", data.indirect_7[i]);
 		}
-		printf("%02x ", data.indirect_7[15]);
-		printf("%02x/%02x ", data.indirect_a, data.indirect_b);
-		printf("%d^%d\n", data.bit_a, data.bit_b);
+		(void) printf("%02x ", data.indirect_7[15]);
+		(void) printf("%02x/%02x ", data.indirect_a, data.indirect_b);
+		(void) printf("%d^%d\n", data.bit_a, data.bit_b);
 #endif
 
 
@@ -420,14 +416,14 @@
 			    (unsigned char *) constant_phrase,
 			    sizeof (constant_phrase));
 #if ALGDEBUG
-			printf("mixing constant_phrase\n");
+			(void) printf("mixing constant_phrase\n");
 #endif
 		}
 
 
 		/* digest a decimal sprintf of the current roundcount */
 
-		snprintf(data.roundascii, ROUND_BUFFER_LEN, "%d", round);
+		(void) snprintf(data.roundascii, ROUND_BUFFER_LEN, "%d", round);
 		MD5Update(&data.context,
 		    (unsigned char *) data.roundascii, strlen(data.roundascii));
 
@@ -440,9 +436,9 @@
 #if ALGDEBUG
 	/* print the digest */
 	for (i = 0; i < 16; i++) {
-		printf("%02x", data.digest[i]);
+		(void) printf("%02x", data.digest[i]);
 	}
-	printf("\n");
+	(void) printf("\n");
 #endif
 
 	(void) snprintf(ctbuffer, ctbufflen, "%s$", puresalt);