+2007-11-24 Nicolas François <nicolas.francois@centraliens.net>
+
+ * libmisc/salt.c: Make sure method is not NULL, defaulting to DES.
+ Thanks to Dan Kopecek <dkopecek@redhat.com>.
+
+
2007-11-23 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/salt.c: Move the srandom call to gensalt.
*/
static char result[40];
size_t salt_len = 8;
- char *method = "DES";
+ char *method;
result[0] = '\0';
if (NULL != meth)
method = meth;
- else
+ else {
#ifdef ENCRYPTMETHOD_SELECT
if ((method = getdef_str ("ENCRYPT_METHOD")) == NULL)
#endif
- if (getdef_bool ("MD5_CRYPT_ENAB"))
- method = "MD5";
+ method = getdef_bool ("MD5_CRYPT_ENAB") ? "MD5" : "DES";
+ }
if (!strcmp (method, "MD5")) {
MAGNUM(result, '1');