diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/crypt/crypt2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libc/crypt/crypt2.c b/src/lib/libc/crypt/crypt2.c index f31818ae2b..f64721368a 100644 --- a/src/lib/libc/crypt/crypt2.c +++ b/src/lib/libc/crypt/crypt2.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: crypt2.c,v 1.4 2013/04/17 17:40:35 tedu Exp $ */ | 1 | /* $OpenBSD: crypt2.c,v 1.5 2014/05/17 13:27:55 tedu Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * FreeSec: libcrypt | 4 | * FreeSec: libcrypt |
| @@ -60,8 +60,8 @@ extern const u_char _des_bits8[8]; | |||
| 60 | extern const u_int32_t _des_bits32[32]; | 60 | extern const u_int32_t _des_bits32[32]; |
| 61 | extern int _des_initialised; | 61 | extern int _des_initialised; |
| 62 | void _des_init(void); | 62 | void _des_init(void); |
| 63 | void _des_setup_salt(int32_t salt); | 63 | u_int32_t _des_setup_salt(int32_t salt); |
| 64 | int _des_do_des(u_int32_t , u_int32_t , u_int32_t *, u_int32_t *, int); | 64 | int _des_do_des(u_int32_t , u_int32_t , u_int32_t *, u_int32_t *, int, u_int32_t); |
| 65 | 65 | ||
| 66 | int | 66 | int |
| 67 | setkey(const char *key) | 67 | setkey(const char *key) |
| @@ -84,14 +84,14 @@ setkey(const char *key) | |||
| 84 | int | 84 | int |
| 85 | encrypt(char *block, int flag) | 85 | encrypt(char *block, int flag) |
| 86 | { | 86 | { |
| 87 | u_int32_t io[2]; | 87 | u_int32_t saltbits, io[2]; |
| 88 | u_char *p; | 88 | u_char *p; |
| 89 | int i, j, retval; | 89 | int i, j, retval; |
| 90 | 90 | ||
| 91 | if (!_des_initialised) | 91 | if (!_des_initialised) |
| 92 | _des_init(); | 92 | _des_init(); |
| 93 | 93 | ||
| 94 | _des_setup_salt(0); | 94 | saltbits = _des_setup_salt(0); |
| 95 | p = (u_char *)block; | 95 | p = (u_char *)block; |
| 96 | for (i = 0; i < 2; i++) { | 96 | for (i = 0; i < 2; i++) { |
| 97 | io[i] = 0L; | 97 | io[i] = 0L; |
| @@ -99,7 +99,7 @@ encrypt(char *block, int flag) | |||
| 99 | if (*p++ & 1) | 99 | if (*p++ & 1) |
| 100 | io[i] |= _des_bits32[j]; | 100 | io[i] |= _des_bits32[j]; |
| 101 | } | 101 | } |
| 102 | retval = _des_do_des(io[0], io[1], io, io + 1, flag ? -1 : 1); | 102 | retval = _des_do_des(io[0], io[1], io, io + 1, flag ? -1 : 1, saltbits); |
| 103 | for (i = 0; i < 2; i++) | 103 | for (i = 0; i < 2; i++) |
| 104 | for (j = 0; j < 32; j++) | 104 | for (j = 0; j < 32; j++) |
| 105 | block[(i << 5) | j] = (io[i] & _des_bits32[j]) ? 1 : 0; | 105 | block[(i << 5) | j] = (io[i] & _des_bits32[j]) ? 1 : 0; |
