From ce9a39524ea0eec7e2e2d144dc5dc1931c7bab27 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Tue, 12 Aug 2008 11:17:10 +0000 Subject: * update to busybox 1.11.1 git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2031 95ad53e4-c205-0410-b2fa-d234c58c8868 --- tools/busybox-patches/cryptpw-blowfish-1.11.1.diff | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tools/busybox-patches/cryptpw-blowfish-1.11.1.diff (limited to 'tools/busybox-patches/cryptpw-blowfish-1.11.1.diff') diff --git a/tools/busybox-patches/cryptpw-blowfish-1.11.1.diff b/tools/busybox-patches/cryptpw-blowfish-1.11.1.diff new file mode 100644 index 00000000..2f14983f --- /dev/null +++ b/tools/busybox-patches/cryptpw-blowfish-1.11.1.diff @@ -0,0 +1,80 @@ +diff -wur busybox-1.11.0/include/usage.h busybox-1.11.0-patched/include/usage.h +--- busybox-1.11.0/include/usage.h 2008-06-25 14:51:35.000000000 +0200 ++++ busybox-1.11.0-patched/include/usage.h 2008-07-10 17:45:38.000000000 +0200 +@@ -563,12 +563,23 @@ + "\n FILE Replace crontab by FILE ('-': stdin)" \ + + #define cryptpw_trivial_usage \ +- "[-a des|md5] [string]" ++ USE_FEATURE_CRYPTPW_BLOWFISH( \ ++ "[-a des|md5|blowfish] [string]" \ ++ ) \ ++ SKIP_FEATURE_CRYPTPW_BLOWFISH( \ ++ "[-a des|md5] [string]" \ ++ ) + #define cryptpw_full_usage "\n\n" \ + "Output crypted string.\n" \ + "If string isn't supplied on cmdline, read it from stdin.\n" \ + "\nOptions:" \ + "\n -a Algorithm to use (default: md5)" \ ++ "\n Available algorithms:" \ ++ USE_FEATURE_CRYPTPW_BLOWFISH( \ ++ "\n blowfish" \ ++ ) \ ++ "\n des" \ ++ "\n md5" + + #define cttyhack_trivial_usage NOUSAGE_STR + #define cttyhack_full_usage "" +diff -wur busybox-1.11.0/loginutils/Config.in busybox-1.11.0-patched/loginutils/Config.in +--- busybox-1.11.0/loginutils/Config.in 2008-06-25 14:51:35.000000000 +0200 ++++ busybox-1.11.0-patched/loginutils/Config.in 2008-07-10 17:46:59.000000000 +0200 +@@ -232,6 +232,13 @@ + help + Applet for crypting a string. + ++config FEATURE_CRYPTPW_BLOWFISH ++ bool "Support blowfish in cryptpw" ++ default y ++ depends on CRYPTPW ++ help ++ With this option cryptpw will support the blowfish cipher, too. ++ + config CHPASSWD + bool "chpasswd" + default n +diff -wur busybox-1.11.0/loginutils/cryptpw.c busybox-1.11.0-patched/loginutils/cryptpw.c +--- busybox-1.11.0/loginutils/cryptpw.c 2008-06-25 14:51:35.000000000 +0200 ++++ busybox-1.11.0-patched/loginutils/cryptpw.c 2008-07-10 17:49:58.000000000 +0200 +@@ -34,19 +34,28 @@ + int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int cryptpw_main(int argc ATTRIBUTE_UNUSED, char **argv) + { +- char salt[sizeof("$N$XXXXXXXX")]; ++ char salt[sizeof("$2a$10$1234567890123456789012X")]; + char *opt_a; + +- if (!getopt32(argv, "a:", &opt_a) || opt_a[0] != 'd') { ++ if (!getopt32(argv, "a:", NULL) ++ || (argv[optind - 1][0] != 'b' && argv[optind - 1][0] != 'd')) { ++ /* md5 */ + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + crypt_make_salt(salt + 3, 4, 0); /* md5 */ ++#if ENABLE_FEATURE_CRYPTPW_BLOWFISH ++ } else if (argv[optind - 1][0] == 'b') { ++ /* blowfish */ ++ strcpy(salt, "$2a$10$"); ++ crypt_make_salt(salt + 7, 11, 0); ++#endif + #if TESTING + strcpy(salt + 3, "ajg./bcf"); + #endif + } else { +- crypt_make_salt(salt, 1, 0); /* des */ ++ /* des */ ++ crypt_make_salt(salt, 1, 0); + #if TESTING + strcpy(salt, "a."); + #endif -- cgit v1.2.3-55-g7522