aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-07-24 13:55:10 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-07-24 14:10:40 +0900
commit2ed10db12deb114066443b4a0f1ffd49a8f612b2 (patch)
treed13f281ce6503258e2b27acb946800fc10d88dec
parentc0548c94e499f38fd4077f6e9ca3e7e6a9c670b2 (diff)
downloadruby-openssl-2ed10db12deb114066443b4a0f1ffd49a8f612b2.tar.gz
cipher: use lower-case cipher name in OpenSSL::Cipher::*.newtopic/cipher-fixes
AES-GCM ciphers don't have upper-case sn.
-rw-r--r--lib/openssl/cipher.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/openssl/cipher.rb b/lib/openssl/cipher.rb
index 92e5e9f8..0b9be693 100644
--- a/lib/openssl/cipher.rb
+++ b/lib/openssl/cipher.rb
@@ -18,7 +18,7 @@ module OpenSSL
klass = Class.new(Cipher){
define_method(:initialize){|*args|
cipher_name = args.inject(name){|n, arg| "#{n}-#{arg}" }
- super(cipher_name)
+ super(cipher_name.downcase)
}
}
const_set(name, klass)
@@ -26,10 +26,8 @@ module OpenSSL
%w(128 192 256).each{|keylen|
klass = Class.new(Cipher){
- define_method(:initialize){|mode|
- mode ||= "CBC"
- cipher_name = "AES-#{keylen}-#{mode}"
- super(cipher_name)
+ define_method(:initialize){|mode = "CBC"|
+ super("aes-#{keylen}-#{mode}".downcase)
}
}
const_set("AES#{keylen}", klass)