Explicitly crypt_set_format("des") and bail out if we
can't. This would prevent problem when we changed the default crypt(3) algorithm or removed it in the future. PR: bin/189958 MFC after: 1 month
This commit is contained in:
parent
65f2833127
commit
3b557094a2
@ -43,6 +43,11 @@ setup(char *pw)
|
|||||||
int32_t seed;
|
int32_t seed;
|
||||||
char *cryptpw;
|
char *cryptpw;
|
||||||
|
|
||||||
|
if (crypt_set_format("des") == 0) {
|
||||||
|
fprintf(stderr, "crypt_set_format(\"des\") failed.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
strlcpy(salt, pw, sizeof(salt));
|
strlcpy(salt, pw, sizeof(salt));
|
||||||
cryptpw = crypt(pw, salt);
|
cryptpw = crypt(pw, salt);
|
||||||
if (cryptpw == NULL) {
|
if (cryptpw == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user