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) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to