class Mongo::Auth::Scram::Conversation

Defines behavior around a single SCRAM-SHA-1 conversation between the client and server.

@api private

Private Instance Methods

digest() click to toggle source
# File lib/mongo/auth/scram/conversation.rb, line 56
def digest
  @digest ||= OpenSSL::Digest::SHA1.new.freeze
end
hi(data) click to toggle source

HI algorithm implementation.

@api private

@see tools.ietf.org/html/rfc5802#section-2.2

@since 2.0.0

# File lib/mongo/auth/scram/conversation.rb, line 34
def hi(data)
  OpenSSL::PKCS5.pbkdf2_hmac_sha1(
    data,
    salt,
    iterations,
    digest.size,
  )
end
salted_password() click to toggle source

Salted password algorithm implementation.

@api private

@see tools.ietf.org/html/rfc5802#section-3

@since 2.0.0

# File lib/mongo/auth/scram/conversation.rb, line 50
def salted_password
  @salted_password ||= CredentialCache.cache(cache_key(:salted_password)) do
    hi(user.hashed_password)
  end
end