File tree Expand file tree Collapse file tree 5 files changed +36
-18
lines changed Expand file tree Collapse file tree 5 files changed +36
-18
lines changed Original file line number Diff line number Diff line change 33# Registry for SASL authenticators used by Net::IMAP.
44module Net ::IMAP ::Authenticators
55
6- # Adds an authenticator for Net::IMAP#authenticate. +auth_type+ is the
6+ # Adds an authenticator for use with Net::IMAP#authenticate. +auth_type+ is the
77 # {SASL mechanism}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
8- # supported by +authenticator+ (for instance, "+LOGIN +"). The +authenticator+
8+ # supported by +authenticator+ (for instance, "+PLAIN +"). The +authenticator+
99 # is an object which defines a +#process+ method to handle authentication with
10- # the server. See Net::IMAP::LoginAuthenticator,
10+ # the server. See Net::IMAP::PlainAuthenticator, Net::IMAP:: LoginAuthenticator,
1111 # Net::IMAP::CramMD5Authenticator, and Net::IMAP::DigestMD5Authenticator for
1212 # examples.
1313 #
Original file line number Diff line number Diff line change 22
33require "digest/md5"
44
5- # Authenticator for the "+CRAM-MD5+" SASL mechanism. See
6- # Net::IMAP#authenticate.
5+ # Authenticator for the "+CRAM-MD5+" SASL mechanism, specified in
6+ # RFC2195[https://tools.ietf.org/html/rfc2195]. See Net::IMAP#authenticate.
77#
88# == Deprecated
99#
10- # +CRAM-MD5+ should be considered obsolete and insecure. It is included for
11- # backward compatibility with historic servers.
10+ # +CRAM-MD5+ is obsolete and insecure. It is included for compatibility with
11+ # existing servers.
1212# {draft-ietf-sasl-crammd5-to-historic}[https://tools.ietf.org/html/draft-ietf-sasl-crammd5-to-historic-00.html]
13- # recommends using +SCRAM-*+ or +PLAIN+ protected by TLS instead. Additionally,
14- # RFC8314[https://tools.ietf.org/html/rfc8314] discourage the use of cleartext
15- # and recommends TLS version 1.2 or greater be used for all traffic.
13+ # recommends using +SCRAM-*+ or +PLAIN+ protected by TLS instead.
14+ #
15+ # Additionally, RFC8314[https://tools.ietf.org/html/rfc8314] discourage the use
16+ # of cleartext and recommends TLS version 1.2 or greater be used for all
17+ # traffic. With TLS +CRAM-MD5+ is okay, but so is +PLAIN+
1618class Net ::IMAP ::CramMD5Authenticator
1719 def process ( challenge )
1820 digest = hmac_md5 ( challenge , @password )
Original file line number Diff line number Diff line change 33require "digest/md5"
44require "strscan"
55
6- # Net::IMAP authenticator for the "`DIGEST-MD5`" SASL mechanism type. See
7- # Net::IMAP#authenticate.
6+ # Net::IMAP authenticator for the "`DIGEST-MD5`" SASL mechanism type, specified
7+ # in RFC2831(https://tools.ietf.org/html/rfc2831). See Net::IMAP#authenticate.
88#
99# == Deprecated
1010#
1111# "+DIGEST-MD5+" has been deprecated by
12- # {RFC6331}[https://tools.ietf.org/html/rfc6331] and should not be used. It
13- # is included for backward compatibility with historic servers.
12+ # {RFC6331}[https://tools.ietf.org/html/rfc6331] and should not be relied on for
13+ # security. It is included for compatibility with existing servers.
1414class Net ::IMAP ::DigestMD5Authenticator
1515 def process ( challenge )
1616 case @stage
Original file line number Diff line number Diff line change 22
33# Authenticator for the "+LOGIN+" SASL mechanism. See Net::IMAP#authenticate.
44#
5+ # +LOGIN+ authentication sends the password in cleartext.
6+ # RFC3501[https://tools.ietf.org/html/rfc3501] encourages servers to disable
7+ # cleartext authentication until after TLS has been negotiated.
8+ # RFC8314[https://tools.ietf.org/html/rfc8314] recommends TLS version 1.2 or
9+ # greater be used for all traffic, and deprecate cleartext access ASAP. +LOGIN+
10+ # can be secured by TLS encryption.
11+ #
512# == Deprecated
613#
714# The {SASL mechanisms
815# registry}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
9- # marks "LOGIN" as obsoleted in favor of "PLAIN". See also
10- # {draft-murchison-sasl-login}[https://www.iana.org/go/draft-murchison-sasl-login].
16+ # marks "LOGIN" as obsoleted in favor of "PLAIN". It is included here for
17+ # compatibility with existing servers. See
18+ # {draft-murchison-sasl-login}[https://www.iana.org/go/draft-murchison-sasl-login]
19+ # for both specification and deprecation.
1120class Net ::IMAP ::LoginAuthenticator
1221 def process ( data )
1322 case @state
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- # Authenticator for the "+PLAIN+" SASL mechanism. See Net::IMAP#authenticate.
3+ # Authenticator for the "+PLAIN+" SASL mechanism, specified in
4+ # RFC4616[https://tools.ietf.org/html/rfc4616]. See Net::IMAP#authenticate.
45#
5- # See RFC4616[https://tools.ietf.org/html/rfc4616] for the specification.
6+ # +PLAIN+ authentication sends the password in cleartext.
7+ # RFC3501[https://tools.ietf.org/html/rfc3501] encourages servers to disable
8+ # cleartext authentication until after TLS has been negotiated.
9+ # RFC8314[https://tools.ietf.org/html/rfc8314] recommends TLS version 1.2 or
10+ # greater be used for all traffic, and deprecate cleartext access ASAP. +PLAIN+
11+ # can be secured by TLS encryption.
612class Net ::IMAP ::PlainAuthenticator
713
814 def process ( data )
915 return "#@authzid \0 #@username \0 #@password "
1016 end
1117
18+ # :nodoc:
1219 NULL = -"\0 " . b
1320
1421 private
You can’t perform that action at this time.
0 commit comments