forked from pool/whois
42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
|
From 757e302cc12f962ee1e04ccc572d0553bcfb780c Mon Sep 17 00:00:00 2001
|
||
|
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
||
|
Date: Thu, 14 Jul 2011 13:38:08 +0200
|
||
|
Subject: [PATCH whois 4/7] add support for the new 2y blowfish tag (CVE-2011-2483)
|
||
|
|
||
|
---
|
||
|
mkpasswd.c | 9 +++++++--
|
||
|
1 files changed, 7 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/mkpasswd.c b/mkpasswd.c
|
||
|
index 8bdc7f3..281d970 100644
|
||
|
--- a/mkpasswd.c
|
||
|
+++ b/mkpasswd.c
|
||
|
@@ -86,9 +86,13 @@ static const struct crypt_method methods[] = {
|
||
|
#if defined FreeBSD
|
||
|
{ "bf", "$2$", 22, 22, 0, "Blowfish (FreeBSD)" },
|
||
|
#endif
|
||
|
-#if defined OpenBSD || (defined __SVR4 && defined __sun) || defined HAVE_CRYPT_GENSALT
|
||
|
+#if defined OpenBSD || (defined __SVR4 && defined __sun)
|
||
|
{ "bf", "$2a$", 22, 22, 1, "Blowfish" },
|
||
|
#endif
|
||
|
+#if defined HAVE_CRYPT_GENSALT
|
||
|
+ { "bf", "$2a$", 22, 22, 1, "Blowfish, system-specific on 8-bit chars" },
|
||
|
+ { "bfy", "$2y$", 22, 22, 1, "Blowfish, correct handling of 8-bit chars" },
|
||
|
+#endif
|
||
|
#if defined FreeBSD
|
||
|
{ "nt", "$3$", 0, 0, 0, "NT-Hash" },
|
||
|
#endif
|
||
|
@@ -226,7 +230,8 @@ int main(int argc, char *argv[])
|
||
|
salt_prefix = methods[0].prefix;
|
||
|
}
|
||
|
|
||
|
- if (streq(salt_prefix, "$2a$")) { /* OpenBSD Blowfish */
|
||
|
+ if (streq(salt_prefix, "$2a$")
|
||
|
+ || streq(salt_prefix, "$2y$")) { /* OpenBSD Blowfish */
|
||
|
if (rounds <= 4)
|
||
|
rounds = 4;
|
||
|
/* actually for 2a it is the logarithm of the number of rounds */
|
||
|
--
|
||
|
1.7.3.4
|
||
|
|