summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/lib/crypt_modules/Makefile.crypt_modules6
-rw-r--r--usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c17
-rw-r--r--usr/src/lib/crypt_modules/sha256/crypt_sha.c11
-rw-r--r--usr/src/lib/crypt_modules/sunmd5/sunmd5.c36
4 files changed, 32 insertions, 38 deletions
diff --git a/usr/src/lib/crypt_modules/Makefile.crypt_modules b/usr/src/lib/crypt_modules/Makefile.crypt_modules
index 56fea36cc1..d21af46c19 100644
--- a/usr/src/lib/crypt_modules/Makefile.crypt_modules
+++ b/usr/src/lib/crypt_modules/Makefile.crypt_modules
@@ -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 @@ LIBS= $(DYNLIB)
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -D_REENTRANT
-LINTFLAGS += -y
-LINTFLAGS64 += -y
ROOTLIBDIR= $(ROOT)/usr/lib/security
ROOTLIBDIR64= $(ROOT)/usr/lib/security/$(MACH64)
diff --git a/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c b/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c
index df12b10bbf..d77b78377c 100644
--- a/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c
+++ b/usr/src/lib/crypt_modules/bsdmd5/bsdmd5.c
@@ -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 @@ static void
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 @@ crypt_genhash_impl(char *ctbuffer,
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 @@ crypt_genhash_impl(char *ctbuffer,
*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,
diff --git a/usr/src/lib/crypt_modules/sha256/crypt_sha.c b/usr/src/lib/crypt_modules/sha256/crypt_sha.c
index b5b4901cd9..31426ac196 100644
--- a/usr/src/lib/crypt_modules/sha256/crypt_sha.c
+++ b/usr/src/lib/crypt_modules/sha256/crypt_sha.c
@@ -112,7 +112,7 @@ static void
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 @@ getrounds(const char *s)
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 @@ getrounds(const char *s)
}
+/* ARGSUSED4 */
char *
crypt_genhash_impl(char *ctbuffer,
size_t ctbufflen,
@@ -243,7 +244,7 @@ crypt_genhash_impl(char *ctbuffer,
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 @@ crypt_genhash_impl(char *ctbuffer,
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 @@ crypt_genhash_impl(char *ctbuffer,
return (ctbuffer);
}
+
+/* ARGSUSED3 */
char *
crypt_gensalt_impl(char *gsbuffer,
size_t gsbufflen,
diff --git a/usr/src/lib/crypt_modules/sunmd5/sunmd5.c b/usr/src/lib/crypt_modules/sunmd5/sunmd5.c
index 73bfad0f87..4520d33dcd 100644
--- a/usr/src/lib/crypt_modules/sunmd5/sunmd5.c
+++ b/usr/src/lib/crypt_modules/sunmd5/sunmd5.c
@@ -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 @@ static void
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 @@ getrounds(const char *s)
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 @@ getrounds(const char *s)
return ((uint32_t)val);
}
-/*ARGSUSED*/
+/* ARGSUSED3 */
char *
crypt_gensalt_impl(char *gsbuffer,
size_t gsbufflen,
@@ -401,15 +397,15 @@ crypt_genhash_impl(char *ctbuffer,
#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 @@ crypt_genhash_impl(char *ctbuffer,
(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 @@ crypt_genhash_impl(char *ctbuffer,
#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);