module
XMPP::SCRAM
Overview
Cryptographic and validation primitives shared by SASL1 and SASL2 SCRAM.
Defined in:
xmpp/scram.crConstant Summary
-
MAX_ITERATIONS =
1000000 -
MIN_ITERATIONS =
4096
Class Method Summary
- .calculate_response(password : String, initial_message : String, server_first_message : String, challenge : Hash(String, String), algorithm : OpenSSL::Algorithm, gs2_header : String, channel_binding_data : Bytes | Nil) : Response
- .decode_base64!(value : String, label : String) : Bytes
- .decode_base64_string!(value : String, label : String) : String
- .nonce(bytes : Int32 = 18) : String
-
.parse_server_first(encoded : String, client_nonce : String, min_iterations : Int32 = MIN_ITERATIONS, max_iterations : Int32 = MAX_ITERATIONS) : ServerFirst
ameba:disable Metrics/CyclomaticComplexity
-
.prepare(value : String, label : String) : String
RFC 4013 requires SASLprep for SCRAM strings.
- .secure_compare(left : Bytes, right : Bytes) : Bool
- .verify_server_final!(encoded : String, expected_signature : String) : Nil
Class Method Detail
def self.calculate_response(password : String, initial_message : String, server_first_message : String, challenge : Hash(String, String), algorithm : OpenSSL::Algorithm, gs2_header : String, channel_binding_data : Bytes | Nil) : Response
#
def self.parse_server_first(encoded : String, client_nonce : String, min_iterations : Int32 = MIN_ITERATIONS, max_iterations : Int32 = MAX_ITERATIONS) : ServerFirst
#
ameba:disable Metrics/CyclomaticComplexity
def self.prepare(value : String, label : String) : String
#
RFC 4013 requires SASLprep for SCRAM strings. NFKC normalization and the prohibited output classes that can be represented by Crystal strings are enforced here. XMPP JID preparation handles the username before this step.