diff options
Diffstat (limited to 'src/lib/libc/crypt/crypt.c')
| -rw-r--r-- | src/lib/libc/crypt/crypt.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libc/crypt/crypt.c b/src/lib/libc/crypt/crypt.c index 3680900baf..521b638542 100644 --- a/src/lib/libc/crypt/crypt.c +++ b/src/lib/libc/crypt/crypt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $Id: crypt.c,v 1.2 1995/12/18 17:59:55 deraadt Exp $ */ | 1 | /* $Id: crypt.c,v 1.3 1996/03/25 22:31:45 tholo Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * FreeSec: libcrypt | 4 | * FreeSec: libcrypt |
| @@ -53,6 +53,7 @@ | |||
| 53 | #include <sys/types.h> | 53 | #include <sys/types.h> |
| 54 | #include <sys/param.h> | 54 | #include <sys/param.h> |
| 55 | #include <pwd.h> | 55 | #include <pwd.h> |
| 56 | #include <string.h> | ||
| 56 | 57 | ||
| 57 | #ifdef DEBUG | 58 | #ifdef DEBUG |
| 58 | # include <stdio.h> | 59 | # include <stdio.h> |
| @@ -182,7 +183,7 @@ static u_char ascii64[] = | |||
| 182 | /* 0000000000111111111122222222223333333333444444444455555555556666 */ | 183 | /* 0000000000111111111122222222223333333333444444444455555555556666 */ |
| 183 | /* 0123456789012345678901234567890123456789012345678901234567890123 */ | 184 | /* 0123456789012345678901234567890123456789012345678901234567890123 */ |
| 184 | 185 | ||
| 185 | static inline int | 186 | static __inline int |
| 186 | ascii_to_bin(ch) | 187 | ascii_to_bin(ch) |
| 187 | char ch; | 188 | char ch; |
| 188 | { | 189 | { |
| @@ -358,7 +359,7 @@ des_setkey(key) | |||
| 358 | const char *key; | 359 | const char *key; |
| 359 | { | 360 | { |
| 360 | u_int32_t k0, k1, rawkey0, rawkey1; | 361 | u_int32_t k0, k1, rawkey0, rawkey1; |
| 361 | int shifts, i, b, round; | 362 | int shifts, round; |
| 362 | 363 | ||
| 363 | if (!des_initialised) | 364 | if (!des_initialised) |
| 364 | des_init(); | 365 | des_init(); |
| @@ -405,7 +406,6 @@ des_setkey(key) | |||
| 405 | shifts = 0; | 406 | shifts = 0; |
| 406 | for (round = 0; round < 16; round++) { | 407 | for (round = 0; round < 16; round++) { |
| 407 | u_int32_t t0, t1; | 408 | u_int32_t t0, t1; |
| 408 | int bit; | ||
| 409 | 409 | ||
| 410 | shifts += key_shifts[round]; | 410 | shifts += key_shifts[round]; |
| 411 | 411 | ||
| @@ -443,9 +443,9 @@ do_des(l_in, r_in, l_out, r_out, count) | |||
| 443 | /* | 443 | /* |
| 444 | * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. | 444 | * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. |
| 445 | */ | 445 | */ |
| 446 | u_int32_t mask, rawl, rawr, l, r, *kl, *kr, *kl1, *kr1; | 446 | u_int32_t l, r, *kl, *kr, *kl1, *kr1; |
| 447 | u_int32_t f, r48l, r48r; | 447 | u_int32_t f, r48l, r48r; |
| 448 | int i, j, b, round; | 448 | int round; |
| 449 | 449 | ||
| 450 | if (count == 0) { | 450 | if (count == 0) { |
| 451 | return(1); | 451 | return(1); |
| @@ -592,8 +592,8 @@ des_cipher(in, out, salt, count) | |||
| 592 | 592 | ||
| 593 | char * | 593 | char * |
| 594 | crypt(key, setting) | 594 | crypt(key, setting) |
| 595 | char *key; | 595 | const char *key; |
| 596 | char *setting; | 596 | const char *setting; |
| 597 | { | 597 | { |
| 598 | int i; | 598 | int i; |
| 599 | u_int32_t count, salt, l, r0, r1, keybuf[2]; | 599 | u_int32_t count, salt, l, r0, r1, keybuf[2]; |
| @@ -644,7 +644,7 @@ crypt(key, setting) | |||
| 644 | if (des_setkey((u_char *) keybuf)) | 644 | if (des_setkey((u_char *) keybuf)) |
| 645 | return(NULL); | 645 | return(NULL); |
| 646 | } | 646 | } |
| 647 | strncpy(output, setting, 9); | 647 | strncpy((char *)output, setting, 9); |
| 648 | 648 | ||
| 649 | /* | 649 | /* |
| 650 | * Double check that we weren't given a short setting. | 650 | * Double check that we weren't given a short setting. |
| @@ -654,7 +654,7 @@ crypt(key, setting) | |||
| 654 | * NUL in it. | 654 | * NUL in it. |
| 655 | */ | 655 | */ |
| 656 | output[9] = '\0'; | 656 | output[9] = '\0'; |
| 657 | p = output + strlen(output); | 657 | p = output + strlen((const char *)output); |
| 658 | } else { | 658 | } else { |
| 659 | /* | 659 | /* |
| 660 | * "old"-style: | 660 | * "old"-style: |
| @@ -704,5 +704,5 @@ crypt(key, setting) | |||
| 704 | *p++ = ascii64[l & 0x3f]; | 704 | *p++ = ascii64[l & 0x3f]; |
| 705 | *p = 0; | 705 | *p = 0; |
| 706 | 706 | ||
| 707 | return(output); | 707 | return((char *)output); |
| 708 | } | 708 | } |
