normal 9749bfbf73 webrick: Support bcrypt password hashing
This adds a password_hash keyword argument to
WEBrick::HTTPAuth::Htpasswd#initialize.  If set to :bcrypt, it
will create bcrypt hashes instead of crypt hashes, and will
raise an exception if the .htpasswd file uses crypt hashes.

If :bcrypt is used, then instead of calling
BasicAuth.make_passwd (which uses crypt),
WEBrick::HTTPAuth::Htpasswd#set_passwd will set the bcrypt
password directly.  It isn't possible to change the
make_passwd API to accept the password hash format, as that
would break configurations who use Htpasswd#auth_type= to set
a custom auth_type.

This modifies WEBrick::HTTPAuth::BasicAuth to handle checking
both crypt and bcrypt hashes.

There are commented out requires for 'string/crypt', to handle
when String#crypt is deprecated and the undeprecated version is
moved to a gem.

There is also a commented out warning for the case when
the password_hash keyword is not specified and 'string/crypt'
cannot be required.  I think the warning makes sense to nudge
users to using bcrypt.

I've updated the tests to test nil, :crypt, and :bcrypt values
for the password_hash keyword, skipping the bcrypt tests if the
bcrypt library cannot be required.

[ruby-core:88111] [Feature #14940]

From: Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 03:21:52 +00:00
..
2018-05-04 13:30:25 +00:00
2018-06-28 03:48:52 +00:00
2018-07-09 14:01:05 +00:00
2018-06-07 12:10:24 +00:00
2018-06-14 09:01:38 +00:00
2018-05-08 02:07:53 +00:00
2018-06-02 07:04:28 +00:00
2018-06-02 01:14:24 +00:00
2018-07-04 12:45:47 +00:00
2018-07-25 12:15:45 +00:00
2018-07-01 08:12:13 +00:00
2018-05-09 04:39:16 +00:00
2018-02-28 12:12:20 +00:00
2018-05-19 00:22:39 +00:00
2018-05-12 09:13:45 +00:00
2018-06-02 13:57:48 +00:00
2018-05-11 15:46:21 +00:00
2018-07-25 12:28:17 +00:00
2018-04-30 10:01:08 +00:00
2018-05-16 18:55:28 +00:00
2018-06-24 09:31:07 +00:00
2018-05-08 02:07:53 +00:00
2018-03-06 03:31:46 +00:00
2018-05-30 13:01:35 +00:00
2018-02-25 13:52:07 +00:00
2018-07-17 12:21:29 +00:00
2018-07-25 12:15:45 +00:00
2018-07-24 07:47:01 +00:00
2018-04-21 20:04:05 +00:00