FreeBSD Bugzilla – Attachment 148061 Details for
Bug 192277
[EN-14:11] crypt(3) regression
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Revert to DES as the default
file_192277.txt (text/plain), 1.59 KB, created by
Dag-Erling Smørgrav
on 2014-10-07 14:50:47 UTC
(
hide
)
Description:
Revert to DES as the default
Filename:
MIME Type:
Creator:
Dag-Erling Smørgrav
Created:
2014-10-07 14:50:47 UTC
Size:
1.59 KB
patch
obsolete
>Index: crypt.c >=================================================================== >--- crypt.c (revision 272171) >+++ crypt.c (working copy) >@@ -37,8 +37,13 @@ > #include "crypt.h" > > /* >- * List of supported crypt(3) formats. The first element in the list will >- * be the default. >+ * List of supported crypt(3) formats. >+ * >+ * The default algorithm is the last entry in the list (second-to-last >+ * array element since the last is a sentinel). The reason for placing >+ * the default last rather than first is that DES needs to be at the >+ * bottom for the algorithm guessing logic in crypt(3) to work correctly, >+ * and it needs to be the default for backward compatibility. > */ > static const struct crypt_format { > const char *const name; >@@ -45,10 +50,6 @@ > char *(*const func)(const char *, const char *); > const char *const magic; > } crypt_formats[] = { >- /* default format */ >- { "sha512", crypt_sha512, "$6$" }, >- >- /* other supported formats */ > { "md5", crypt_md5, "$1$" }, > #ifdef HAS_BLOWFISH > { "blf", crypt_blowfish, "$2" }, >@@ -55,6 +56,7 @@ > #endif > { "nth", crypt_nthash, "$3$" }, > { "sha256", crypt_sha256, "$5$" }, >+ { "sha512", crypt_sha512, "$6$" }, > #ifdef HAS_DES > { "des", crypt_des, "_" }, > #endif >@@ -63,7 +65,8 @@ > { NULL, NULL, NULL } > }; > >-static const struct crypt_format *crypt_format = &crypt_formats[0]; >+static const struct crypt_format *crypt_format = >+ &crypt_formats[(sizeof crypt_formats / sizeof *crypt_formats) - 2]; > > #define DES_SALT_ALPHABET \ > "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192277
:
145169
| 148061