Skip to content

Commit f08570d

Browse files
committed
♻️ SASL DIGEST-MD5: inherit, props, move, document
* 🚚 Move to sasl directory and SASL namespace. * 🗑️ Deprecate original constant name. * ♻️ Inherit from Authenticator base class. * ♻️ Refactor to the style used in the new ScramAuthenticator. Yes, DIGEST-MD5 is deprecated! But that also means that it is lower risk as a test-bed for refactoring a more complicated challenge/response SASL mechanism, and for developing a reasonable SASL::Authenticator base class. I improved it in several ways: * 🔒 Use SecureRandom for cnonce (not Time.now + insecure PRNG!) * ✨ Default qop=auth (as in RFC) * ✨ User can configure realm, host, service_name, service. * This allows a correct "digest-uri" for non-IMAP clients. * ✨ Enforce requirements for sparam keys (required and no-multiples). However... it's still deprecated, so maybe don't use unless you need to!
1 parent 6f8cf36 commit f08570d

File tree

6 files changed

+415
-120
lines changed

6 files changed

+415
-120
lines changed

lib/net/imap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def starttls(options = {}, verify = true)
10001000
# *Deprecated:* <em>Obsolete mechanisms are available for backwards
10011001
# compatibility.</em>
10021002
#
1003-
# For +DIGEST-MD5+ see DigestMD5Authenticator.
1003+
# For +DIGEST-MD5+ see SASL::DigestMD5Authenticator.
10041004
#
10051005
# For +LOGIN+, see LoginAuthenticator.
10061006
#

lib/net/imap/authenticators.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ def authenticators
6262
# deprecated
6363
require_relative "authenticators/login"
6464
require_relative "authenticators/cram_md5"
65-
require_relative "authenticators/digest_md5"
65+
require_relative "sasl/digest_md5_authenticator"

lib/net/imap/authenticators/digest_md5.rb

Lines changed: 0 additions & 115 deletions
This file was deleted.

lib/net/imap/sasl/authenticator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module SASL
3131
# *Deprecated:* <em>Obsolete mechanisms are available for backwards
3232
# compatibility.</em>
3333
#
34-
# For +DIGEST-MD5+ see DigestMD5Authenticator.
34+
# For +DIGEST-MD5+ see SASL::DigestMD5Authenticator.
3535
#
3636
# For +LOGIN+, see LoginAuthenticator.
3737
#

0 commit comments

Comments
 (0)