- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33
Open
Labels
SASL 🔒Authentication and authentication mechanismsAuthentication and authentication mechanisms
Description
To use channel binding and
SCRAM-SHA-256-PLUS, I just made the following subclass. Sharing in case helpful for a broader implementation of-PLUSauthenticators.class ScramSHA256PlusAuthenticator < Net::IMAP::SASL::ScramSHA256Authenticator def initialize(*args, **options) super(*args, **options) @ssl_cert = options[:ssl_cert] end def gs2_cb_flag "p=tls-server-end-point" end def cbind_input cert_algo_raw = @ssl_cert.signature_algorithm cert_algo = OpenSSL::Digest.new(cert_algo_raw).name # standardize e.g. sha256WithRSAEncryption to SHA256 sasl_algo = cert_algo == "MD5" || cert_algo == "SHA1" ? "SHA256" : cert_algo hash = OpenSSL::Digest.digest(sasl_algo, @ssl_cert.to_der) "#{gs2_header}#{hash}" end endThe
ssl_certoption toScramSHA256PlusAuthenticator.newshould be passedssl_server_socket.peer_cert.
Neustradamus
Metadata
Metadata
Assignees
Labels
SASL 🔒Authentication and authentication mechanismsAuthentication and authentication mechanisms