DESCRIPTION

JVMCBC-280: Support for SCRAM-SHA1, SCRAM-SHA256 and SCRAM-SHA512

Motivation
----------
Future server versions ("watson" and later) will support SCRAM-SHA
mechanisms in addition to PLAIN and CRAM-MD5 since they are more
secure and will be preferred in the future.

The client needs to add transparent support for those and use them
(during the auth negotiation) when available and fall back to
the older ones for backwards compatibility.

Special hat tip xxx@xxx.xxx for writing this java implementation
based on the server side codebase.

Modifications
-------------
The SASL implementation in the JVM does not support the SHA
mechanisms, so additional support is added in our codebase.

When the mechs are received from the server, the client tries
them in order. Each mech is first tried against the JVM SASL
provider and if that one doesn't know what to do with it, our
own implementation is tried. This allows to achieve backwards
compatibility with older mechanisms while using the newer
ones if available.

Three mechanisms are added: SCRAM-SHA1, SHA256 and SHA512.

In addition, a Base64 helper class is also provided since
it is only available in JDK 1.8 out of the box and this
SDK still supports back to JDK 1.6.

Result
------
Modern SASL authentication mechanisms are now supported
if they are advertised by the server.

Change-Id: I57e32a6e4cda9d8901b5c3bcb56ab92556ec5e60


COMMENTS

author: Natasha Sullivan
date: 2016-02-15 19:01:50.848000000

Uploaded patch set 8.

-------------------------------------
author: Natasha Sullivan
date: 2016-02-15 19:04:54.551000000

Patch Set 8: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-02-15 19:05:14.142000000

Patch Set 8:

had to fix a special case with empty bucket passwords, the code didn't like that.

-------------------------------------
author: Estrella Humphrey
date: 2016-02-15 19:13:39.304000000

Patch Set 8: Code-Review+2

-------------------------------------
author: Gerrit Code Review
date: 2016-02-15 19:14:22.285000000

Change has been successfully cherry-picked as 06d57f63d5d6f22c4e88baca42a702d0c5671ce0

-------------------------------------
