mirror of
https://github.com/apache/httpd.git
synced 2025-08-06 11:06:17 +00:00

Add support for SHA-2 crypt() algorithm in htpasswd. * configure.in: Detect SHA-2 support in crypt(). * support/passwd_common.h: Define ALG_CRYPT_SHA256, ALG_CRYPT_SHA512, include ap_config_auto.h. * support/htpasswd.c (check_args): Allow -2, -5, -r arguments for SHA-256, SHA-256 and rounds options respectively. * support/passwd_common.c (parse_common_options): Parse -2, -5, -r args. (mkhash): Generate crypt hash for SHA256/SHA512 algorithms. Update transform. * support/htpasswd.c (usage): More usage fixes for SHA-2; describe as "secure", leave bcrypt only algorithm described as "very secure". * support/passwd_common.c (mkhash): Fix salt buffer size for SHA2 (caught by gcc 10). configure: Assume crypt() does not support SHA-2 when cross-compiling. Can be forced with "./configure ap_cv_crypt_sha2=yes ..." still. * configure.in: Give AC_RUN_IFELSE a cross-compiling action, otherwise it fails with: configure: error: cannot run test program while cross compiling Submitted by: jorton, ylavic Reviewed by: minfrin, ylavic, jorton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915516 13f79535-47bb-0310-9956-ffa450edef68