summaryrefslogtreecommitdiffstats
path: root/support/htpasswd.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2012-10-07 11:06:10 +0200
committerStefan Fritsch <sf@apache.org>2012-10-07 11:06:10 +0200
commitc2eb43db553701ec12e693d13bca8c7bca113061 (patch)
treeac64181b7412122b2d499d745c0d872d40764019 /support/htpasswd.c
parentAdd passwd_common.c build support for Windows and Netware (diff)
downloadapache2-c2eb43db553701ec12e693d13bca8c7bca113061.tar.xz
apache2-c2eb43db553701ec12e693d13bca8c7bca113061.zip
add support for bcrypt
PR: 49288 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1395255 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/htpasswd.c')
-rw-r--r--support/htpasswd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/support/htpasswd.c b/support/htpasswd.c
index cdf7f311bd..aed716a0fe 100644
--- a/support/htpasswd.c
+++ b/support/htpasswd.c
@@ -92,14 +92,17 @@ static int mkrecord(struct passwd_ctx *ctx, char *user)
static void usage(void)
{
apr_file_printf(errfile, "Usage:" NL
- "\thtpasswd [-cmdpsD] passwordfile username" NL
- "\thtpasswd -b[cmdpsD] passwordfile username password" NL
+ "\thtpasswd [-cmBdpsD] [-C cost] passwordfile username" NL
+ "\thtpasswd -b[cmBdpsD] [-C cost] passwordfile username password" NL
NL
- "\thtpasswd -n[mdps] username" NL
- "\thtpasswd -nb[mdps] username password" NL
+ "\thtpasswd -n[mBdps] [-C cost] username" NL
+ "\thtpasswd -nb[mBdps] [-C cost] username password" NL
" -c Create a new file." NL
" -n Don't update file; display results on stdout." NL
" -m Force MD5 encryption of the password (default)." NL
+ " -B Force bcrypt encryption of the password (very secure)." NL
+ " -C Set the computing time used for the bcrypt algorithm" NL
+ " (higher is more secure but slower, default: %d, valid: 4 to 31)" NL
" -d Force CRYPT encryption of the password (8 chars max, "
"insecure)." NL
" -p Do not encrypt the password (plaintext, insecure)." NL
@@ -110,7 +113,8 @@ static void usage(void)
"On other systems than Windows and NetWare the '-p' flag will "
"probably not work." NL
"The SHA algorithm does not use a salt and is less secure than the "
- "MD5 algorithm." NL
+ "MD5 algorithm." NL,
+ BCRYPT_DEFAULT_COST
);
exit(ERR_SYNTAX);
}