Lines 1-5
Link Here
|
1 |
/* OPENBSD ORIGINAL: lib/libc/crypt/cryptutil.c */ |
1 |
/* OPENBSD ORIGINAL: lib/libc/crypt/cryptutil.c */ |
2 |
|
2 |
|
|
|
3 |
#include "includes.h" |
3 |
#include <errno.h> |
4 |
#include <errno.h> |
4 |
#ifdef HAVE_CRYPT_H |
5 |
#ifdef HAVE_CRYPT_H |
5 |
#include <crypt.h> |
6 |
#include <crypt.h> |
Lines 10-15
Link Here
|
10 |
int |
11 |
int |
11 |
crypt_checkpass(const char *pass, const char *goodhash) |
12 |
crypt_checkpass(const char *pass, const char *goodhash) |
12 |
{ |
13 |
{ |
|
|
14 |
char *c; |
15 |
|
13 |
if (goodhash == NULL) |
16 |
if (goodhash == NULL) |
14 |
goto fail; |
17 |
goto fail; |
15 |
|
18 |
|
Lines 17-23
crypt_checkpass(const char *pass, const char *goodhash)
Link Here
|
17 |
if (strlen(goodhash) == 0 && strlen(pass) == 0) |
20 |
if (strlen(goodhash) == 0 && strlen(pass) == 0) |
18 |
return 0; |
21 |
return 0; |
19 |
|
22 |
|
20 |
if (strcmp(crypt(pass, goodhash), goodhash) == 0) |
23 |
c = crypt(pass, goodhash); |
|
|
24 |
if (c == NULL) |
25 |
goto fail; |
26 |
|
27 |
if (strcmp(c, goodhash) == 0) |
21 |
return 0; |
28 |
return 0; |
22 |
|
29 |
|
23 |
fail: |
30 |
fail: |