summaryrefslogtreecommitdiff
path: root/lib/net/ssh/transport/hmac/abstract.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ssh/transport/hmac/abstract.rb')
-rw-r--r--lib/net/ssh/transport/hmac/abstract.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/net/ssh/transport/hmac/abstract.rb b/lib/net/ssh/transport/hmac/abstract.rb
index 22ad9a6..f8efa3e 100644
--- a/lib/net/ssh/transport/hmac/abstract.rb
+++ b/lib/net/ssh/transport/hmac/abstract.rb
@@ -9,6 +9,18 @@ module Net
# The base class of all OpenSSL-based HMAC algorithm wrappers.
class Abstract
class <<self
+ def etm(*v)
+ @etm = false if !defined?(@etm)
+ if v.empty?
+ @etm = superclass.etm if @etm.nil? && superclass.respond_to?(:etm)
+ return @etm
+ elsif v.length == 1
+ @etm = v.first
+ else
+ raise ArgumentError, "wrong number of arguments (#{v.length} for 1)"
+ end
+ end
+
def key_length(*v)
@key_length = nil if !defined?(@key_length)
if v.empty?
@@ -46,6 +58,10 @@ module Net
end
end
+ def etm
+ self.class.etm
+ end
+
def key_length
self.class.key_length
end