From 4ea83bf562c44a6792e7c77e7d87cba91f86f763 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 12 Jun 2008 16:55:59 +0000 Subject: uclibc insists on having 70k static buffer for crypt. For bbox it's not acceptable. Roll our own des and md5 crypt implementation. Against older uclibc: text data bss dec hex filename 759945 604 6684 767233 bb501 busybox_old 759766 604 6684 767054 bb44e busybox_unstripped so, we still save on code size. --- include/libbb.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 97aae0bb4..bd2dbe573 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1032,18 +1032,8 @@ extern int restricted_shell(const char *shell); extern void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw); extern int correct_password(const struct passwd *pw); /* Returns a ptr to static storage */ -extern char *pw_encrypt(const char *clear, const char *salt); +extern char *pw_encrypt(const char *clear, const char *salt, int cleanup); extern int obscure(const char *old, const char *newval, const struct passwd *pwdp); - -int index_in_str_array(const char *const string_array[], const char *key); -int index_in_strings(const char *strings, const char *key); -int index_in_substr_array(const char *const string_array[], const char *key); -int index_in_substrings(const char *strings, const char *key); -const char *nth_string(const char *strings, int n); - -extern void print_login_issue(const char *issue_file, const char *tty); -extern void print_login_prompt(void); - /* rnd is additional random input. New one is returned. * Useful if you call crypt_make_salt many times in a row: * rnd = crypt_make_salt(buf1, 4, 0); @@ -1052,11 +1042,19 @@ extern void print_login_prompt(void); * (otherwise we risk having same salt generated) */ extern int crypt_make_salt(char *p, int cnt, int rnd); - /* Returns number of lines changed, or -1 on error */ extern int update_passwd(const char *filename, const char *username, const char *new_pw); +int index_in_str_array(const char *const string_array[], const char *key); +int index_in_strings(const char *strings, const char *key); +int index_in_substr_array(const char *const string_array[], const char *key); +int index_in_substrings(const char *strings, const char *key); +const char *nth_string(const char *strings, int n); + +extern void print_login_issue(const char *issue_file, const char *tty); +extern void print_login_prompt(void); + /* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */ int get_terminal_width_height(int fd, unsigned *width, unsigned *height); -- cgit v1.2.3