diff --git a/lib/objects/local_encoding_functions.rb b/lib/objects/local_encoding_functions.rb index 311ae289e..38d66ab00 100644 --- a/lib/objects/local_encoding_functions.rb +++ b/lib/objects/local_encoding_functions.rb @@ -25,7 +25,7 @@ class EncodingFunctions utf8 = [] value.map {|element| if element.is_a? String - utf8 << element.force_encoding('UTF-8') + utf8 << element.dup.force_encoding('UTF-8') elsif element.is_a? Hash utf8 << EncodingFunctions::hash_to_utf8(element) elsif element.is_a? Array diff --git a/modules/encoders/hash/sha1/secgen_local/local.rb b/modules/encoders/hash/sha1/secgen_local/local.rb index 3a92dbfa5..8eebcf998 100644 --- a/modules/encoders/hash/sha1/secgen_local/local.rb +++ b/modules/encoders/hash/sha1/secgen_local/local.rb @@ -1,6 +1,5 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'openssl' class SHA1Encoder < HashEncoder def initialize @@ -9,7 +8,7 @@ class SHA1Encoder < HashEncoder end def hash_function(string) - OpenSSL::Digest::SHA1.new.hexdigest(string) + Digest::SHA1.hexdigest(string) end end diff --git a/modules/encoders/hash/sha256/secgen_local/local.rb b/modules/encoders/hash/sha256/secgen_local/local.rb index cb6419bd4..356405a05 100644 --- a/modules/encoders/hash/sha256/secgen_local/local.rb +++ b/modules/encoders/hash/sha256/secgen_local/local.rb @@ -1,6 +1,5 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'openssl' class SHA256Encoder < HashEncoder def initialize @@ -9,7 +8,7 @@ class SHA256Encoder < HashEncoder end def hash_function(string) - OpenSSL::Digest::SHA256.new.hexdigest(string) + Digest::SHA256.hexdigest(string) end end diff --git a/modules/encoders/hash/sha384/secgen_local/local.rb b/modules/encoders/hash/sha384/secgen_local/local.rb index e58fde978..cf8ba5b8e 100644 --- a/modules/encoders/hash/sha384/secgen_local/local.rb +++ b/modules/encoders/hash/sha384/secgen_local/local.rb @@ -1,6 +1,5 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'openssl' class SHA384Encoder < HashEncoder def initialize @@ -9,7 +8,7 @@ class SHA384Encoder < HashEncoder end def hash_function(string) - OpenSSL::Digest::SHA384.new.hexdigest(string) + Digest::SHA384.hexdigest(string) end end diff --git a/modules/encoders/hash/sha512/secgen_local/local.rb b/modules/encoders/hash/sha512/secgen_local/local.rb index dbe34375a..0b24e1d7b 100644 --- a/modules/encoders/hash/sha512/secgen_local/local.rb +++ b/modules/encoders/hash/sha512/secgen_local/local.rb @@ -1,6 +1,5 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'openssl' class SHA512Encoder < HashEncoder def initialize @@ -9,7 +8,7 @@ class SHA512Encoder < HashEncoder end def hash_function(string) - OpenSSL::Digest::SHA512.new.hexdigest(string) + Digest::SHA512.hexdigest(string) end end