summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcrypt
diff options
context:
space:
mode:
authorraf <none@none>2008-06-06 14:02:15 -0700
committerraf <none@none>2008-06-06 14:02:15 -0700
commit7257d1b4d25bfac0c802847390e98a464fd787ac (patch)
treec73fc17df920bc2ca9438c25fea3529890296afd /usr/src/lib/libcrypt
parent455903679f53d12d92035adc60bc7c3d95e6b6a2 (diff)
downloadillumos-joyent-7257d1b4d25bfac0c802847390e98a464fd787ac.tar.gz
PSARC 2008/309 expunge synonyms.h
6700179 expunge synonyms.h --HG-- rename : usr/src/cmd/sgs/libelf/common/syn.h => deleted_files/usr/src/cmd/sgs/libelf/common/syn.h rename : usr/src/cmd/sgs/librtld/common/lintsup.c => deleted_files/usr/src/cmd/sgs/librtld/common/lintsup.c rename : usr/src/cmd/sgs/rtld/common/_synonyms.h => deleted_files/usr/src/cmd/sgs/rtld/common/_synonyms.h rename : usr/src/common/atomic/atomic_asm_weak.h => deleted_files/usr/src/common/atomic/atomic_asm_weak.h rename : usr/src/lib/common/inc/c_synonyms.h => deleted_files/usr/src/lib/common/inc/c_synonyms.h rename : usr/src/lib/libc/amd64/gen/lexp10.c => deleted_files/usr/src/lib/libc/amd64/gen/lexp10.c rename : usr/src/lib/libc/amd64/gen/llog10.c => deleted_files/usr/src/lib/libc/amd64/gen/llog10.c rename : usr/src/lib/libc/amd64/gen/ltostr.c => deleted_files/usr/src/lib/libc/amd64/gen/ltostr.c rename : usr/src/lib/libc/i386/gen/lexp10.c => deleted_files/usr/src/lib/libc/i386/gen/lexp10.c rename : usr/src/lib/libc/i386/gen/llog10.c => deleted_files/usr/src/lib/libc/i386/gen/llog10.c rename : usr/src/lib/libc/i386/gen/ltostr.c => deleted_files/usr/src/lib/libc/i386/gen/ltostr.c rename : usr/src/lib/libc/inc/synonyms.h => deleted_files/usr/src/lib/libc/inc/synonyms.h rename : usr/src/lib/libc/sparcv9/gen/lexp10.c => deleted_files/usr/src/lib/libc/sparcv9/gen/lexp10.c rename : usr/src/lib/libc/sparcv9/gen/llog10.c => deleted_files/usr/src/lib/libc/sparcv9/gen/llog10.c rename : usr/src/lib/libc_psr/inc.flg => deleted_files/usr/src/lib/libc_psr/inc.flg rename : usr/src/lib/libcrypt/inc/des_synonyms.h => deleted_files/usr/src/lib/libcrypt/inc/des_synonyms.h rename : usr/src/lib/libgen/inc/gen_synonyms.h => deleted_files/usr/src/lib/libgen/inc/gen_synonyms.h rename : usr/src/lib/libtsnet/common/synonyms.h => deleted_files/usr/src/lib/libtsnet/common/synonyms.h rename : usr/src/tools/scripts/check_fnames.sh => deleted_files/usr/src/tools/scripts/check_fnames.sh rename : usr/src/lib/libc/sparc/gen/lexp10.c => usr/src/lib/libc/port/gen/lexp10.c rename : usr/src/lib/libc/sparc/gen/llog10.c => usr/src/lib/libc/port/gen/llog10.c
Diffstat (limited to 'usr/src/lib/libcrypt')
-rw-r--r--usr/src/lib/libcrypt/Makefile.com4
-rw-r--r--usr/src/lib/libcrypt/common/cryptio.c20
-rw-r--r--usr/src/lib/libcrypt/common/des.c30
-rw-r--r--usr/src/lib/libcrypt/common/des_crypt.c12
-rw-r--r--usr/src/lib/libcrypt/common/des_encrypt.c27
-rw-r--r--usr/src/lib/libcrypt/common/des_soft.c33
-rw-r--r--usr/src/lib/libcrypt/inc/des_soft.h12
-rw-r--r--usr/src/lib/libcrypt/inc/des_synonyms.h60
8 files changed, 63 insertions, 135 deletions
diff --git a/usr/src/lib/libcrypt/Makefile.com b/usr/src/lib/libcrypt/Makefile.com
index 0e7af514ce..2f93024301 100644
--- a/usr/src/lib/libcrypt/Makefile.com
+++ b/usr/src/lib/libcrypt/Makefile.com
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -50,7 +50,7 @@ LDLIBS += -lgen -lc
.KEEP_STATE:
-all: $(LIBS) fnamecheck
+all: $(LIBS)
lint: lintcheck
diff --git a/usr/src/lib/libcrypt/common/cryptio.c b/usr/src/lib/libcrypt/common/cryptio.c
index 09116fc321..78b96aff48 100644
--- a/usr/src/lib/libcrypt/common/cryptio.c
+++ b/usr/src/lib/libcrypt/common/cryptio.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.
@@ -21,23 +20,20 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
-
-
#pragma ident "%Z%%M% %I% %E% SMI"
-#pragma weak run_setkey = _run_setkey
-#pragma weak run_crypt = _run_crypt
-#pragma weak crypt_close = _crypt_close
-#pragma weak makekey = _makekey
+#pragma weak _run_setkey = run_setkey
+#pragma weak _run_crypt = run_crypt
+#pragma weak _crypt_close = crypt_close
+#pragma weak _makekey = makekey
-#include "des_synonyms.h"
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
@@ -133,7 +129,7 @@ run_crypt(long offset, char *buffer, unsigned int count, int p[2])
header.offset = offset;
pstat = signal(SIGPIPE, SIG_IGN);
if (write(p[READER], (char *)&header, sizeof (header))
- != sizeof (header)) {
+ != sizeof (header)) {
(void) crypt_close_nolock(p);
(void) signal(SIGPIPE, pstat);
(void) mutex_unlock(&lock);
diff --git a/usr/src/lib/libcrypt/common/des.c b/usr/src/lib/libcrypt/common/des.c
index 42eaf80a52..d7847e397b 100644
--- a/usr/src/lib/libcrypt/common/des.c
+++ b/usr/src/lib/libcrypt/common/des.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.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -34,13 +33,11 @@
*/
#pragma ident "%Z%%M% %I% %E% SMI"
-/*LINTLIBRARY*/
/*
* DES encryption library routines
*/
-#include "des_synonyms.h"
#include <sys/types.h>
#include <rpc/des_crypt.h>
#include <sys/stat.h>
@@ -75,8 +72,8 @@
* Copy 8 bytes
*/
#define COPY8(src, dst) { \
- char *a = (char *) dst; \
- char *b = (char *) src; \
+ char *a = (char *)dst; \
+ char *b = (char *)src; \
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
}
@@ -85,10 +82,10 @@
* Copy multiple of 8 bytes
*/
#define DESCOPY(src, dst, len) { \
- char *a = (char *) dst; \
- char *b = (char *) src; \
+ char *a = (char *)dst; \
+ char *b = (char *)src; \
int i; \
- for (i = (int) len; i > 0; i -= 8) { \
+ for (i = (int)len; i > 0; i -= 8) { \
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
} \
@@ -138,7 +135,8 @@ ecb_crypt(char *key, char *buf, size_t len, unsigned int mode)
* Common code to cbc_crypt() & ecb_crypt()
*/
static int
-common_crypt(char *key, char *buf, unsigned len, unsigned mode, struct desparams *desp)
+common_crypt(char *key, char *buf, unsigned len,
+ unsigned mode, struct desparams *desp)
{
int desdev;
int res;
@@ -148,7 +146,7 @@ common_crypt(char *key, char *buf, unsigned len, unsigned mode, struct desparams
return (DESERR_BADPARAM);
}
desp->des_dir =
- ((mode & DES_DIRMASK) == DES_ENCRYPT) ? ENCRYPT : DECRYPT;
+ ((mode & DES_DIRMASK) == DES_ENCRYPT) ? ENCRYPT : DECRYPT;
desdev = mode & DES_DEVMASK;
COPY8(key, desp->des_key);
@@ -166,11 +164,11 @@ common_crypt(char *key, char *buf, unsigned len, unsigned mode, struct desparams
desp->des_len = len;
if (len <= DES_QUICKLEN) {
DESCOPY(buf, desp->des_data, len);
- res = ioctl(g_desfd, (int)DESIOCQUICK, (char *) desp);
+ res = ioctl(g_desfd, (int)DESIOCQUICK, (char *)desp);
DESCOPY(desp->des_data, buf, len);
} else {
- desp->des_buf = (u_char *) buf;
- res = ioctl(g_desfd, (int)DESIOCBLOCK, (char *) desp);
+ desp->des_buf = (uchar_t *)buf;
+ res = ioctl(g_desfd, (int)DESIOCBLOCK, (char *)desp);
}
return (res == 0 ? DESERR_NONE : DESERR_HWERROR);
}
diff --git a/usr/src/lib/libcrypt/common/des_crypt.c b/usr/src/lib/libcrypt/common/des_crypt.c
index ceb64a1f98..d67058dcf0 100644
--- a/usr/src/lib/libcrypt/common/des_crypt.c
+++ b/usr/src/lib/libcrypt/common/des_crypt.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -28,13 +28,11 @@
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
-/*LINTLIBRARY*/
-#pragma weak des_crypt = _des_crypt
-#pragma weak des_encrypt = _des_encrypt
-#pragma weak des_setkey = _des_setkey
+#pragma weak _des_crypt = des_crypt
+#pragma weak _des_encrypt = des_encrypt
+#pragma weak _des_setkey = des_setkey
-#include "des_synonyms.h"
#include <sys/types.h>
#include <crypt.h>
#include "des_soft.h"
@@ -305,7 +303,7 @@ des_encrypt_nolock(char *block, int edflag)
/* EXPORT DELETE START */
if (edflag)
- (void) des_decrypt1(block, L, IP, &L[32],
+ (void) _des_decrypt1(block, L, IP, &L[32],
preS, E, KS, S, f, tempL, P, FP);
else
(void) des_encrypt1(block, L, IP, &L[32],
diff --git a/usr/src/lib/libcrypt/common/des_encrypt.c b/usr/src/lib/libcrypt/common/des_encrypt.c
index 13a9310ee3..937b9c8a11 100644
--- a/usr/src/lib/libcrypt/common/des_encrypt.c
+++ b/usr/src/lib/libcrypt/common/des_encrypt.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,20 +19,18 @@
* CDDL HEADER END
*/
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/* Copyright (c) 1988 AT&T */
+/* All Rights Reserved */
+
#pragma ident "%Z%%M% %I% %E% SMI"
-/*LINTLIBRARY*/
-#pragma weak des_encrypt1 = _des_encrypt1
+#pragma weak _des_encrypt1 = des_encrypt1
-#include "des_synonyms.h"
#include <sys/types.h>
void
@@ -80,11 +77,11 @@ des_encrypt1(char *block, char *L, char *IP, char *R, char *preS, char *E,
for (j = 0; j < 8; j++) {
t = 6*j;
k = S[j][(preS[t+0]<<5)+
- (preS[t+1]<<3)+
- (preS[t+2]<<2)+
- (preS[t+3]<<1)+
- (preS[t+4]<<0)+
- (preS[t+5]<<4)];
+ (preS[t+1]<<3)+
+ (preS[t+2]<<2)+
+ (preS[t+3]<<1)+
+ (preS[t+4]<<0)+
+ (preS[t+5]<<4)];
t = 4*j;
f[t+0] = (k>>3)&01;
f[t+1] = (k>>2)&01;
diff --git a/usr/src/lib/libcrypt/common/des_soft.c b/usr/src/lib/libcrypt/common/des_soft.c
index 11a97d5420..eea97578b1 100644
--- a/usr/src/lib/libcrypt/common/des_soft.c
+++ b/usr/src/lib/libcrypt/common/des_soft.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.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -34,7 +33,6 @@
*/
#pragma ident "%Z%%M% %I% %E% SMI"
-/*LINTLIBRARY*/
/*
* Warning! Things are arranged very carefully in this file to
@@ -50,7 +48,6 @@
#define CRYPT /* cannot configure out of user-level code */
#endif
-#include "des_synonyms.h"
#ifdef CRYPT
#include <sys/types.h>
#include <des/softdes.h>
@@ -78,8 +75,8 @@
#endif /* def CRYPT */
-static void des_setkey(u_char [8], struct deskeydata *, unsigned);
-static void des_encrypt(u_char *, struct deskeydata *);
+static void des_setkey(uchar_t [8], struct deskeydata *, unsigned);
+static void des_encrypt(uchar_t *, struct deskeydata *);
#ifndef _KERNEL
/*
@@ -136,8 +133,8 @@ __des_crypt(char *buf, unsigned int len, struct desparams *desp)
char nextiv[8];
struct deskeydata softkey;
- mode = (unsigned) desp->des_mode;
- dir = (unsigned) desp->des_dir;
+ mode = (unsigned)desp->des_mode;
+ dir = (unsigned)desp->des_dir;
des_setkey(desp->des_key, &softkey, dir);
while (len != 0) {
switch (mode) {
@@ -146,14 +143,14 @@ __des_crypt(char *buf, unsigned int len, struct desparams *desp)
case ENCRYPT:
for (i = 0; i < 8; i++)
buf[i] ^= desp->des_ivec[i];
- des_encrypt((u_char *)buf, &softkey);
+ des_encrypt((uchar_t *)buf, &softkey);
for (i = 0; i < 8; i++)
desp->des_ivec[i] = buf[i];
break;
case DECRYPT:
for (i = 0; i < 8; i++)
nextiv[i] = buf[i];
- des_encrypt((u_char *)buf, &softkey);
+ des_encrypt((uchar_t *)buf, &softkey);
for (i = 0; i < 8; i++) {
buf[i] ^= desp->des_ivec[i];
desp->des_ivec[i] = nextiv[i];
@@ -162,7 +159,7 @@ __des_crypt(char *buf, unsigned int len, struct desparams *desp)
}
break;
case ECB:
- des_encrypt((u_char *)buf, &softkey);
+ des_encrypt((uchar_t *)buf, &softkey);
break;
}
buf += 8;
@@ -178,7 +175,7 @@ __des_crypt(char *buf, unsigned int len, struct desparams *desp)
* We build the 16 key entries here
*/
static void
-des_setkey(u_char userkey[8], struct deskeydata *kd, unsigned int dir)
+des_setkey(uchar_t userkey[8], struct deskeydata *kd, unsigned int dir)
{
/* EXPORT DELETE START */
long C, D;
@@ -261,7 +258,6 @@ des_setkey(u_char userkey[8], struct deskeydata *kd, unsigned int dir)
}
/* EXPORT DELETE END */
- return;
}
@@ -274,7 +270,7 @@ des_setkey(u_char userkey[8], struct deskeydata *kd, unsigned int dir)
* processor byte-order independence.
*/
static void
-des_encrypt(u_char *data, struct deskeydata *kd)
+des_encrypt(uchar_t *data, struct deskeydata *kd)
{
/* EXPORT DELETE START */
chunk_t work1, work2;
@@ -339,9 +335,13 @@ des_encrypt(u_char *data, struct deskeydata *kd)
chunk_t R, ER; \
uint32_t e0, e1; \
R.long0 = inR; \
+ /* CSTYLED */ \
do_R_to_ER(=, 0); \
+ /* CSTYLED */ \
do_R_to_ER(|=, 1); \
+ /* CSTYLED */ \
do_R_to_ER(|=, 2); \
+ /* CSTYLED */ \
do_R_to_ER(|=, 3); \
ER.long0 = e0 ^ kd->keyval[iter].long0; \
ER.long1 = e1 ^ kd->keyval[iter].long1; \
@@ -442,6 +442,5 @@ des_encrypt(u_char *data, struct deskeydata *kd)
data[7] = work2.byte7;
/* EXPORT DELETE END */
- return;
}
#endif /* def CRYPT */
diff --git a/usr/src/lib/libcrypt/inc/des_soft.h b/usr/src/lib/libcrypt/inc/des_soft.h
index 85a7a8d2dc..83e75665ee 100644
--- a/usr/src/lib/libcrypt/inc/des_soft.h
+++ b/usr/src/lib/libcrypt/inc/des_soft.h
@@ -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.
@@ -19,9 +18,10 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1997,2001 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#ifndef _DES_SOFT_H
@@ -38,7 +38,7 @@ extern "C" {
extern int __des_crypt(char *, unsigned int, struct desparams *);
extern int crypt_close_nolock(int p[2]);
extern void des_encrypt1();
-extern void des_decrypt1();
+extern void _des_decrypt1();
#ifdef __cplusplus
}
diff --git a/usr/src/lib/libcrypt/inc/des_synonyms.h b/usr/src/lib/libcrypt/inc/des_synonyms.h
deleted file mode 100644
index 9761ed275f..0000000000
--- a/usr/src/lib/libcrypt/inc/des_synonyms.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _DES_SYNONYMS_H
-#define _DES_SYNONYMS_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include "c_synonyms.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(__lint)
-
-#define crypt_close _crypt_close
-#define des_crypt _des_crypt
-#define des_decrypt1 _des_decrypt1
-#define des_encrypt _des_encrypt
-#define des_encrypt1 _des_encrypt1
-#define des_setkey _des_setkey
-#define makekey _makekey
-#define run_crypt _run_crypt
-#define run_setkey _run_setkey
-
-#endif /* !defined(__lint) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DES_SYNONYMS_H */