Methods
Classes and Modules
Class Net::SSH::Transport::OSSL::HMAC::AbstractClass Net::SSH::Transport::OSSL::HMAC::MD5
Class Net::SSH::Transport::OSSL::HMAC::MD5_96
Class Net::SSH::Transport::OSSL::HMAC::None
Class Net::SSH::Transport::OSSL::HMAC::SHA1
Class Net::SSH::Transport::OSSL::HMAC::SHA1_96
Public Instance methods
Register all services that implement the various support HMAC algorithms.
[ show source ]
# File lib/net/ssh/transport/ossl/hmac/services.rb, line 25
25: def register_services( container )
26: container.namespace_define :hmac do |space|
27:
28: # Register each supported HMAC algorithm.
29: %w{sha1 sha1-96 md5 md5-96}.each do |name|
30: space.__send__( name.sub(/-/, "_").intern ) do
31: require "net/ssh/transport/ossl/hmac/#{name}"
32: const_get( name.upcase.sub(/-/, "_").intern ).new
33: end
34: end
35:
36: # The :none service is trivial--simply doing as much of nothing
37: # as possible. This is for consistency in how HMAC's are handled,
38: # since it is possible to not have an HMAC for part of the
39: # communication cycle.
40: space.none do
41: require "net/ssh/transport/ossl/hmac/none"
42: None.new
43: end
44:
45: # Add the implementations to a hash, naming them according to the
46: # SSH2 specification.
47: space.collection do |c,|
48: Hash[ "hmac-sha1" => c.sha1,
49: "hmac-sha1-96" => c.sha1_96,
50: "hmac-md5" => c.md5,
51: "hmac-md5-96" => c.md5_96,
52: "none" => c.none ]
53: end
54:
55: # Add the collection of algorithms to the list of known HMAC
56: # algorithm sources.
57: if space.knows_key?( :hmac_algorithm_sources )
58: space.hmac_algorithm_sources << space.collection
59: end
60: end
61: end