Skip to content

Commit

Permalink
MB-19570: Remove support for CRAM-MD5
Browse files Browse the repository at this point in the history
Change-Id: I95445e57581b502e99864f808cc18a51ca809182
Reviewed-on: http://review.couchbase.org/63866
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
trondn committed May 18, 2016
1 parent 83233dd commit a29dce2
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 524 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ LIST(APPEND CBSASL_SOURCES
${Memcached_SOURCE_DIR}/cbsasl/cbsasl_internal.h
${Memcached_SOURCE_DIR}/cbsasl/client.cc
${Memcached_SOURCE_DIR}/cbsasl/common.cc
${Memcached_SOURCE_DIR}/cbsasl/cram-md5/cram-md5.cc
${Memcached_SOURCE_DIR}/cbsasl/cram-md5/cram-md5.h
${Memcached_SOURCE_DIR}/cbsasl/log.cc
${Memcached_SOURCE_DIR}/cbsasl/mechanismfactory.cc
${Memcached_SOURCE_DIR}/cbsasl/mechanismfactory.h
Expand Down
1 change: 0 additions & 1 deletion cbsasl/cbsasl_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

enum class Mechanism {
PLAIN,
CRAM_MD5,
SCRAM_SHA1,
SCRAM_SHA256,
SCRAM_SHA512,
Expand Down
186 changes: 0 additions & 186 deletions cbsasl/cram-md5/cram-md5.cc

This file was deleted.

61 changes: 0 additions & 61 deletions cbsasl/cram-md5/cram-md5.h

This file was deleted.

27 changes: 1 addition & 26 deletions cbsasl/mechanismfactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "config.h"
#include "cram-md5/cram-md5.h"
#include "mechanismfactory.h"
#include "plain/plain.h"
#include "scram-sha/scram-sha.h"
Expand Down Expand Up @@ -155,24 +154,6 @@ class Scram1MechInfo : public MechInfo {
}
};

class CramMd5MechInfo : public MechInfo {
public:
CramMd5MechInfo()
: MechInfo(MECH_NAME_CRAM_MD5, true, Mechanism::CRAM_MD5) { }

virtual UniqueMechanismBackend createServerBackend() override {
return UniqueMechanismBackend(new CramMd5ServerBackend);
}

virtual UniqueMechanismBackend createClientBackend() override {
return UniqueMechanismBackend(new CramMd5ClientBackend);
}

virtual bool isMechanismSupported() override {
return true;
}
};

class PlainMechInfo : public MechInfo {
public:
PlainMechInfo()
Expand All @@ -194,14 +175,12 @@ class PlainMechInfo : public MechInfo {
static Scram512MechInfo scram512MechInfo;
static Scram256MechInfo scram256MechInfo;
static Scram1MechInfo scram1MechInfo;
static CramMd5MechInfo cramMd5MechInfo;
static PlainMechInfo plainMechInfo;

static std::array<MechInfo*, 5> availableMechs = {
static std::array<MechInfo*, 4> availableMechs = {
&scram512MechInfo,
&scram256MechInfo,
&scram1MechInfo,
&cramMd5MechInfo,
&plainMechInfo
};

Expand Down Expand Up @@ -399,8 +378,6 @@ Mechanism MechanismFactory::toMechanism(const std::string mech) {
toupper);
if (mech == MECH_NAME_PLAIN) {
return Mechanism::PLAIN;
} else if (mech == MECH_NAME_CRAM_MD5) {
return Mechanism::CRAM_MD5;
} else if (mech == MECH_NAME_SCRAM_SHA1) {
return Mechanism::SCRAM_SHA1;
} else if (mech == MECH_NAME_SCRAM_SHA256) {
Expand All @@ -416,8 +393,6 @@ std::string MechanismFactory::toString(const Mechanism& mech) {
switch (mech) {
case Mechanism::PLAIN:
return MECH_NAME_PLAIN;
case Mechanism::CRAM_MD5:
return MECH_NAME_CRAM_MD5;
case Mechanism::SCRAM_SHA1:
return MECH_NAME_SCRAM_SHA1;
case Mechanism::SCRAM_SHA256:
Expand Down
2 changes: 0 additions & 2 deletions cbsasl/user.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ void Couchbase::User::generateSecrets(const Mechanism& mech) {
salt.resize(Crypto::SHA1_DIGEST_SIZE);
break;
case Mechanism::PLAIN:
case Mechanism::CRAM_MD5:
case Mechanism::UNKNOWN:
throw std::logic_error("Couchbase::User::generateSecrets invalid algorithm");
}
Expand Down Expand Up @@ -185,7 +184,6 @@ void Couchbase::User::generateSecrets(const Mechanism& mech,
algorithm = Crypto::Algorithm::SHA1;
break;
case Mechanism::PLAIN:
case Mechanism::CRAM_MD5:
case Mechanism::UNKNOWN:
throw std::logic_error("Couchbase::User::generateSecrets invalid algorithm");
}
Expand Down
Loading

0 comments on commit a29dce2

Please sign in to comment.