Skip to content

Commit 72bef51

Browse files
committed
Merge r1862611, r1877693, r1878703, r1884207 from trunk:
* support/htpasswd.c (usage): Document SHA-256/512 support. Windows : do not include ap_config_auto.h * support/htpasswd.c (usage): Fix typo. Fix misleading crypt vs hash terminology in ht* and dbmmanage tools. What the htpasswd, htdbm and dbmmanage tools do is hashing passwords, not encrypting them, so fix the terminology in manpages, docs, --help, comments and function names. Submitted by: Michele Preziuso <mpreziuso kaosdynamics.com>, jorton, steffenal, ylavic Github: closes #408 Reviewed by: jorton, ylavic, jfclere git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916129 13f79535-47bb-0310-9956-ffa450edef68
1 parent cf612a9 commit 72bef51

11 files changed

+138
-120
lines changed

CHANGES

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
-*- coding: utf-8 -*-
22
Changes with Apache 2.4.59
33

4+
*) htpasswd, htdbm, dbmmanage: Update help&docs to refer to
5+
"hashing", rather than "encrypting" passwords.
6+
[Michele Preziuso <mpreziuso kaosdynamics.com>]
7+
48
*) mod_ssl: Fix build with LibreSSL 2.0.7+. PR 64047.
59
[Giovanni Bechis, Yann Ylavic]
610

docs/man/dbmmanage.1

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The filename of the DBM format file\&. Usually without the extension \fB\&.db\fR
5959
The user for which the operations are performed\&. The \fIusername\fR may not contain a colon (\fB:\fR)\&.
6060
.TP
6161
\fB\fIencpasswd\fR\fR
62-
This is the already encrypted password to use for the \fBupdate\fR and \fBadd\fR commands\&. You may use a hyphen (\fB-\fR) if you want to get prompted for the password, but fill in the fields afterwards\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original password untouched\&.
62+
This is the already hashed password to use for the \fBupdate\fR and \fBadd\fR commands\&. You may use a hyphen (\fB-\fR) if you want to get prompted for the password, but fill in the fields afterwards\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original password untouched\&.
6363
.TP
6464
\fB\fIgroup\fR\fR
6565
A group, which the user is member of\&. A groupname may not contain a colon (\fB:\fR)\&. You may use a hyphen (\fB-\fR) if you don't want to assign the user to a group, but fill in the comment field\&. Additionally when using the \fBupdate\fR command, a period (\fB\&.\fR) keeps the original groups untouched\&.
@@ -72,13 +72,13 @@ This is the place for your opaque comments about the user, like realname, mailad
7272

7373
.TP
7474
\fB-d\fR
75-
crypt encryption (default, except on Win32, Netware)
75+
crypt hashing (default, except on Win32, Netware)
7676
.TP
7777
\fB-m\fR
78-
MD5 encryption (default on Win32, Netware)
78+
MD5 hashing (default on Win32, Netware)
7979
.TP
8080
\fB-s\fR
81-
SHA1 encryption
81+
SHA1 hashing
8282
.TP
8383
\fB-p\fR
8484
plaintext (\fInot recommended\fR)
@@ -88,7 +88,7 @@ plaintext (\fInot recommended\fR)
8888

8989
.TP
9090
\fBadd\fR
91-
Adds an entry for \fIusername\fR to \fIfilename\fR using the encrypted password \fIencpasswd\fR\&. dbmmanage passwords\&.dat add rbowen foKntnEF3KSXA
91+
Adds an entry for \fIusername\fR to \fIfilename\fR using the hashed password \fIencpasswd\fR\&. dbmmanage passwords\&.dat add rbowen foKntnEF3KSXA
9292
.TP
9393
\fBadduser\fR
9494
Asks for a password and then adds an entry for \fIusername\fR to \fIfilename\fR\&. dbmmanage passwords\&.dat adduser krietz

docs/man/htdbm.1

+11-11
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ Create the \fIpasswdfile\fR\&. If \fIpasswdfile\fR already exists, it is rewritt
7474
Display the results on standard output rather than updating a database\&. This option changes the syntax of the command line, since the \fIpasswdfile\fR argument (usually the first one) is omitted\&. It cannot be combined with the \fB-c\fR option\&.
7575
.TP
7676
\fB-m\fR
77-
Use MD5 encryption for passwords\&. On Windows and Netware, this is the default\&.
77+
Use MD5 hashing for passwords\&. On Windows and Netware, this is the default\&.
7878
.TP
7979
\fB-B\fR
80-
Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&.
80+
Use bcrypt hashing for passwords\&. This is currently considered to be very secure\&.
8181
.TP
8282
\fB-C\fR
83-
This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.
83+
This flag is only allowed in combination with \fB-B\fR (bcrypt hashing)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.
8484
.TP
8585
\fB-d\fR
86-
Use \fBcrypt()\fR encryption for passwords\&. The default on all platforms but Windows and Netware\&. Though possibly supported by \fBhtdbm\fR on all platforms, it is not supported by the httpd server on Windows and Netware\&. This algorithm is \fBinsecure\fR by today's standards\&.
86+
Use \fBcrypt()\fR hashing for passwords\&. The default on all platforms but Windows and Netware\&. Though possibly supported by \fBhtdbm\fR on all platforms, it is not supported by the httpd server on Windows and Netware\&. This algorithm is \fBinsecure\fR by today's standards\&.
8787
.TP
8888
\fB-s\fR
89-
Use SHA encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
89+
Use SHA hashing for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
9090
.TP
9191
\fB-p\fR
9292
Use plaintext passwords\&. Though \fBhtdbm\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&.
@@ -110,7 +110,7 @@ The filename of the DBM format file\&. Usually without the extension \fB\&.db\fR
110110
The username to create or update in \fIpasswdfile\fR\&. If \fIusername\fR does not exist in this file, an entry is added\&. If it does exist, the password is changed\&.
111111
.TP
112112
\fB\fIpassword\fR\fR
113-
The plaintext password to be encrypted and stored in the DBM file\&. Used only with the \fB-b\fR flag\&.
113+
The plaintext password to be hashed and stored in the DBM file\&. Used only with the \fB-b\fR flag\&.
114114
.TP
115115
\fB-T\fIDBTYPE\fR\fR
116116
Type of DBM file (SDBM, GDBM, DB, or "default")\&.
@@ -137,7 +137,7 @@ One can usually use the \fBfile\fR program supplied with most Unix systems to se
137137
.fi
138138

139139
.PP
140-
Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. If executed on a Windows system, the password will be encrypted using the modified Apache MD5 algorithm; otherwise, the system's \fBcrypt()\fR routine will be used\&. If the file does not exist, \fBhtdbm\fR will do nothing except return an error\&.
140+
Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. If executed on a Windows system, the password will be hashed using the modified Apache MD5 algorithm; otherwise, the system's \fBcrypt()\fR routine will be used\&. If the file does not exist, \fBhtdbm\fR will do nothing except return an error\&.
141141

142142
.nf
143143

@@ -163,24 +163,24 @@ Encrypts the password from the command line (\fBPwd4Steve\fR) using the MD5 algo
163163
Web password files such as those managed by \fBhtdbm\fR should \fInot\fR be within the Web server's URI space -- that is, they should not be fetchable with a browser\&.
164164

165165
.PP
166-
The use of the \fB-b\fR option is discouraged, since when it is used the unencrypted password appears on the command line\&.
166+
The use of the \fB-b\fR option is discouraged, since when it is used the plaintext password appears on the command line\&.
167167

168168
.PP
169169
When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&.
170170

171171
.PP
172-
The SHA encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
172+
The SHA hashing format does not use salting: for a given password, there is only one hashed representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
173173

174174
.PP
175175
The SHA and \fBcrypt()\fR formats are insecure by today's standards\&.
176176

177177
.SH "RESTRICTIONS"
178178

179179
.PP
180-
On the Windows platform, passwords encrypted with \fBhtdbm\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
180+
On the Windows platform, passwords hashed with \fBhtdbm\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
181181

182182
.PP
183-
The MD5 algorithm used by \fBhtdbm\fR is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers\&.
183+
The MD5 algorithm used by \fBhtdbm\fR is specific to the Apache software; passwords hashed using it will not be usable with other Web servers\&.
184184

185185
.PP
186186
Usernames are limited to \fB255\fR bytes and may not include the character \fB:\fR\&.

docs/man/htpasswd.1

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ htpasswd \- Manage user files for basic authentication
4545
\fBhtpasswd\fR is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users\&. If \fBhtpasswd\fR cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes\&.
4646

4747
.PP
48-
Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can encrypt and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&.
48+
Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can hash and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&.
4949

5050
.PP
51-
\fBhtpasswd\fR encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may have passwords encrypted with \fBcrypt()\fR\&.
51+
\fBhtpasswd\fR hashes passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-hashed passwords while others in the same file may have passwords hashed with \fBcrypt()\fR\&.
5252

5353
.PP
5454
This manual page only lists the command line arguments\&. For details of the directives necessary to configure user authentication in httpd see the Apache manual, which is part of the Apache distribution or can be found at http://httpd\&.apache\&.org/\&.
@@ -71,7 +71,7 @@ Create the \fIpasswdfile\fR\&. If \fIpasswdfile\fR already exists, it is rewritt
7171
Display the results on standard output rather than updating a file\&. This is useful for generating password records acceptable to Apache for inclusion in non-text data stores\&. This option changes the syntax of the command line, since the \fIpasswdfile\fR argument (usually the first one) is omitted\&. It cannot be combined with the \fB-c\fR option\&.
7272
.TP
7373
\fB-m\fR
74-
Use MD5 encryption for passwords\&. This is the default (since version 2\&.2\&.18)\&.
74+
Use MD5 hashing for passwords\&. This is the default (since version 2\&.2\&.18)\&.
7575
.TP
7676
\fB-2\fR
7777
Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.
@@ -80,19 +80,19 @@ Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on mos
8080
Use SHA-512 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.
8181
.TP
8282
\fB-B\fR
83-
Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&.
83+
Use bcrypt hashing for passwords\&. This is currently considered to be very secure\&.
8484
.TP
8585
\fB-C\fR
86-
This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&.
86+
This flag is only allowed in combination with \fB-B\fR (bcrypt hashing)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&.
8787
.TP
8888
\fB-r\fR
8989
This flag is only allowed in combination with \fB-2\fR or \fB-5\fR\&. It sets the number of hash rounds used for the SHA-2 algorithms (higher is more secure but slower; the default is 5,000)\&.
9090
.TP
9191
\fB-d\fR
92-
Use \fBcrypt()\fR encryption for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&.
92+
Use \fBcrypt()\fR hashing for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&.
9393
.TP
9494
\fB-s\fR
95-
Use SHA-1 (160-bit) encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
95+
Use SHA-1 (160-bit) hashing for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
9696
.TP
9797
\fB-p\fR
9898
Use plaintext passwords\&. Though \fBhtpasswd\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&.
@@ -110,7 +110,7 @@ Name of the file to contain the user name and password\&. If \fB-c\fR is given,
110110
The username to create or update in \fIpasswdfile\fR\&. If \fIusername\fR does not exist in this file, an entry is added\&. If it does exist, the password is changed\&.
111111
.TP
112112
\fB\fIpassword\fR\fR
113-
The plaintext password to be encrypted and stored in the file\&. Only used with the \fB-b\fR flag\&.
113+
The plaintext password to be hashed and stored in the file\&. Only used with the \fB-b\fR flag\&.
114114

115115
.SH "EXIT STATUS"
116116

@@ -126,7 +126,7 @@ The plaintext password to be encrypted and stored in the file\&. Only used with
126126
.fi
127127

128128
.PP
129-
Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be encrypted using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&.
129+
Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be hashed using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&.
130130

131131
.nf
132132

@@ -155,13 +155,13 @@ Web password files such as those managed by \fBhtpasswd\fR should \fInot\fR be w
155155
This program is not safe as a setuid executable\&. Do \fInot\fR make it setuid\&.
156156

157157
.PP
158-
The use of the \fB-b\fR option is discouraged, since when it is used the unencrypted password appears on the command line\&.
158+
The use of the \fB-b\fR option is discouraged, since when it is used the plaintext password appears on the command line\&.
159159

160160
.PP
161161
When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&.
162162

163163
.PP
164-
The SHA-1 encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
164+
The SHA-1 hashing option does not use salting: for a given password, there is only one hashed representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
165165

166166
.PP
167167
The SHA-1 and \fBcrypt()\fR formats are insecure by today's standards\&.
@@ -172,10 +172,10 @@ The SHA-2-based \fBcrypt()\fR formats (SHA-256 and SHA-512) are supported on mos
172172
.SH "RESTRICTIONS"
173173

174174
.PP
175-
On the Windows platform, passwords encrypted with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
175+
On the Windows platform, passwords hashed with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&.
176176

177177
.PP
178-
The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers\&.
178+
The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords hashed using it will not be usable with other Web servers\&.
179179

180180
.PP
181181
Usernames are limited to \fB255\fR bytes and may not include the character \fB:\fR\&.

docs/manual/programs/dbmmanage.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
may not contain a colon (<code>:</code>).</dd>
7474

7575
<dt><code><var>encpasswd</var></code></dt>
76-
<dd>This is the already encrypted password to use for the
76+
<dd>This is the already hashed password to use for the
7777
<code>update</code> and <code>add</code> commands. You may use a hyphen
7878
(<code>-</code>) if you want to get prompted for the password, but fill
7979
in the fields afterwards. Additionally when using the <code>update</code>
@@ -96,13 +96,13 @@
9696
<section id="options.encodings"><title>Encodings</title>
9797
<dl>
9898
<dt><code>-d</code></dt>
99-
<dd>crypt encryption (default, except on Win32, Netware)</dd>
99+
<dd>crypt hashing (default, except on Win32, Netware)</dd>
100100

101101
<dt><code>-m</code></dt>
102-
<dd>MD5 encryption (default on Win32, Netware)</dd>
102+
<dd>MD5 hashing (default on Win32, Netware)</dd>
103103

104104
<dt><code>-s</code></dt>
105-
<dd>SHA1 encryption</dd>
105+
<dd>SHA1 hashing</dd>
106106

107107
<dt><code>-p</code></dt>
108108
<dd>plaintext (<em>not recommended</em>)</dd>
@@ -113,7 +113,7 @@
113113
<dl>
114114
<dt><code>add</code></dt>
115115
<dd>Adds an entry for <var>username</var> to <var>filename</var> using the
116-
encrypted password <var>encpasswd</var>.
116+
hashed password <var>encpasswd</var>.
117117

118118
<example>dbmmanage passwords.dat add rbowen foKntnEF3KSXA</example>
119119
</dd>

0 commit comments

Comments
 (0)