Date: Wed, 25 Feb 2015 20:47:26 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279296 - head/usr.bin/enigma Message-ID: <201502252047.t1PKlQdg020742@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Wed Feb 25 20:47:25 2015 New Revision: 279296 URL: https://svnweb.freebsd.org/changeset/base/279296 Log: 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 Modified: head/usr.bin/enigma/enigma.c Modified: head/usr.bin/enigma/enigma.c ============================================================================== --- head/usr.bin/enigma/enigma.c Wed Feb 25 18:50:24 2015 (r279295) +++ head/usr.bin/enigma/enigma.c Wed Feb 25 20:47:25 2015 (r279296) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502252047.t1PKlQdg020742>