diff options
author | delphij <delphij@FreeBSD.org> | 2015-02-25 20:47:25 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-02-25 20:47:25 +0000 |
commit | 380807ef474b5dde53ae3a42a592632e1c3a5762 (patch) | |
tree | 78646fcf0f6ce50f87ac31acb5adae2645697504 /usr.bin/enigma | |
parent | 03eeeb2651118370f5b3b824c5d9bd36b37ef233 (diff) | |
download | FreeBSD-src-380807ef474b5dde53ae3a42a592632e1c3a5762.zip FreeBSD-src-380807ef474b5dde53ae3a42a592632e1c3a5762.tar.gz |
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
Diffstat (limited to 'usr.bin/enigma')
-rw-r--r-- | usr.bin/enigma/enigma.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/enigma/enigma.c b/usr.bin/enigma/enigma.c index 893766e..e476e65 100644 --- a/usr.bin/enigma/enigma.c +++ b/usr.bin/enigma/enigma.c @@ -43,6 +43,11 @@ setup(char *pw) int32_t seed; char *cryptpw; + if (crypt_set_format("des") == 0) { + fprintf(stderr, "crypt_set_format(\"des\") failed.\n"); + exit(1); + } + strlcpy(salt, pw, sizeof(salt)); cryptpw = crypt(pw, salt); if (cryptpw == NULL) { |