Browse Source

Update prototypes to match declarations

Remove unused variables
Install all man-page links
OPENBSD_2_0
tholo 28 years ago
parent
commit
077935535d
3 changed files with 24 additions and 29 deletions
  1. +3
    -2
      src/lib/libc/crypt/Makefile.inc
  2. +11
    -11
      src/lib/libc/crypt/crypt.c
  3. +10
    -16
      src/lib/libc/crypt/morecrypt.c

+ 3
- 2
src/lib/libc/crypt/Makefile.inc View File

@ -1,8 +1,9 @@
# $Id: Makefile.inc,v 1.1 1995/12/16 12:55:27 deraadt Exp $
# $Id: Makefile.inc,v 1.2 1996/03/25 22:31:44 tholo Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/crypt ${.CURDIR}/crypt .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/crypt ${.CURDIR}/crypt
SRCS+= crypt.c morecrypt.c SRCS+= crypt.c morecrypt.c
MAN+= crypt.3 MAN+= crypt.3
MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3
MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3 crypt.3 des_cipher.3
MLINKS+=crypt.3 des_setkey.3

+ 11
- 11
src/lib/libc/crypt/crypt.c View File

@ -1,4 +1,4 @@
/* $Id: crypt.c,v 1.2 1995/12/18 17:59:55 deraadt Exp $ */
/* $Id: crypt.c,v 1.3 1996/03/25 22:31:45 tholo Exp $ */
/* /*
* FreeSec: libcrypt * FreeSec: libcrypt
@ -53,6 +53,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
#include <pwd.h> #include <pwd.h>
#include <string.h>
#ifdef DEBUG #ifdef DEBUG
# include <stdio.h> # include <stdio.h>
@ -182,7 +183,7 @@ static u_char ascii64[] =
/* 0000000000111111111122222222223333333333444444444455555555556666 */ /* 0000000000111111111122222222223333333333444444444455555555556666 */
/* 0123456789012345678901234567890123456789012345678901234567890123 */ /* 0123456789012345678901234567890123456789012345678901234567890123 */
static inline int
static __inline int
ascii_to_bin(ch) ascii_to_bin(ch)
char ch; char ch;
{ {
@ -358,7 +359,7 @@ des_setkey(key)
const char *key; const char *key;
{ {
u_int32_t k0, k1, rawkey0, rawkey1; u_int32_t k0, k1, rawkey0, rawkey1;
int shifts, i, b, round;
int shifts, round;
if (!des_initialised) if (!des_initialised)
des_init(); des_init();
@ -405,7 +406,6 @@ des_setkey(key)
shifts = 0; shifts = 0;
for (round = 0; round < 16; round++) { for (round = 0; round < 16; round++) {
u_int32_t t0, t1; u_int32_t t0, t1;
int bit;
shifts += key_shifts[round]; shifts += key_shifts[round];
@ -443,9 +443,9 @@ do_des(l_in, r_in, l_out, r_out, count)
/* /*
* l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
*/ */
u_int32_t mask, rawl, rawr, l, r, *kl, *kr, *kl1, *kr1;
u_int32_t l, r, *kl, *kr, *kl1, *kr1;
u_int32_t f, r48l, r48r; u_int32_t f, r48l, r48r;
int i, j, b, round;
int round;
if (count == 0) { if (count == 0) {
return(1); return(1);
@ -592,8 +592,8 @@ des_cipher(in, out, salt, count)
char * char *
crypt(key, setting) crypt(key, setting)
char *key;
char *setting;
const char *key;
const char *setting;
{ {
int i; int i;
u_int32_t count, salt, l, r0, r1, keybuf[2]; u_int32_t count, salt, l, r0, r1, keybuf[2];
@ -644,7 +644,7 @@ crypt(key, setting)
if (des_setkey((u_char *) keybuf)) if (des_setkey((u_char *) keybuf))
return(NULL); return(NULL);
} }
strncpy(output, setting, 9);
strncpy((char *)output, setting, 9);
/* /*
* Double check that we weren't given a short setting. * Double check that we weren't given a short setting.
@ -654,7 +654,7 @@ crypt(key, setting)
* NUL in it. * NUL in it.
*/ */
output[9] = '\0'; output[9] = '\0';
p = output + strlen(output);
p = output + strlen((const char *)output);
} else { } else {
/* /*
* "old"-style: * "old"-style:
@ -704,5 +704,5 @@ crypt(key, setting)
*p++ = ascii64[l & 0x3f]; *p++ = ascii64[l & 0x3f];
*p = 0; *p = 0;
return(output);
return((char *)output);
} }

+ 10
- 16
src/lib/libc/crypt/morecrypt.c View File

@ -1,4 +1,4 @@
/* $Id: morecrypt.c,v 1.3 1995/12/18 17:59:56 deraadt Exp $ */
/* $Id: morecrypt.c,v 1.4 1996/03/25 22:31:46 tholo Exp $ */
/* /*
* FreeSec: libcrypt * FreeSec: libcrypt
@ -178,12 +178,7 @@ static u_int32_t key_perm_maskl[8][128], key_perm_maskr[8][128];
static u_int32_t comp_maskl[8][128], comp_maskr[8][128]; static u_int32_t comp_maskl[8][128], comp_maskr[8][128];
static u_int32_t old_rawkey0, old_rawkey1; static u_int32_t old_rawkey0, old_rawkey1;
static u_char ascii64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
/* 0000000000111111111122222222223333333333444444444455555555556666 */
/* 0123456789012345678901234567890123456789012345678901234567890123 */
static inline int
static __inline int
ascii_to_bin(ch) ascii_to_bin(ch)
char ch; char ch;
{ {
@ -362,9 +357,9 @@ do_des(l_in, r_in, l_out, r_out, count)
/* /*
* l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
*/ */
u_int32_t mask, rawl, rawr, l, r, *kl, *kr, *kl1, *kr1;
u_int32_t l, r, *kl, *kr, *kl1, *kr1;
u_int32_t f, r48l, r48r; u_int32_t f, r48l, r48r;
int i, j, b, round;
int round;
if (count == 0) { if (count == 0) {
return(1); return(1);
@ -476,7 +471,7 @@ int
des_cipher(in, out, salt, count) des_cipher(in, out, salt, count)
const char *in; const char *in;
char *out; char *out;
int32_t salt;
long salt;
int count; int count;
{ {
u_int32_t l_out, r_out, rawl, rawr; u_int32_t l_out, r_out, rawl, rawr;
@ -486,7 +481,7 @@ des_cipher(in, out, salt, count)
if (!des_initialised) if (!des_initialised)
des_init(); des_init();
setup_salt(salt);
setup_salt((int32_t)salt);
#if 0 #if 0
rawl = ntohl(*((u_int32_t *) in)++); rawl = ntohl(*((u_int32_t *) in)++);
@ -514,7 +509,7 @@ des_setkey(key)
const char *key; const char *key;
{ {
u_int32_t k0, k1, rawkey0, rawkey1; u_int32_t k0, k1, rawkey0, rawkey1;
int shifts, i, b, round;
int shifts, round;
if (!des_initialised) if (!des_initialised)
des_init(); des_init();
@ -561,7 +556,6 @@ des_setkey(key)
shifts = 0; shifts = 0;
for (round = 0; round < 16; round++) { for (round = 0; round < 16; round++) {
u_int32_t t0, t1; u_int32_t t0, t1;
int bit;
shifts += key_shifts[round]; shifts += key_shifts[round];
@ -593,7 +587,7 @@ des_setkey(key)
int int
setkey(key) setkey(key)
char *key;
const char *key;
{ {
int i, j; int i, j;
u_int32_t packed_keys[2]; u_int32_t packed_keys[2];
@ -622,8 +616,8 @@ encrypt(block, flag)
if (!des_initialised) if (!des_initialised)
des_init(); des_init();
setup_salt(0L);
p = block;
setup_salt((int32_t)0);
p = (u_char *)block;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
io[i] = 0L; io[i] = 0L;
for (j = 0; j < 32; j++) for (j = 0; j < 32; j++)


Loading…
Cancel
Save