diff --git a/Gemfile b/Gemfile index 2de89e019..ed8d0c3d6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' + #production gems go here gem 'nokogiri' gem 'puppet' @@ -23,7 +24,6 @@ gem 'process_helper' gem 'ovirt-engine-sdk' gem 'duplicate' gem 'smbhash' -gem 'digest-whirlpool', :git => "https://github.com/fgosew/ruby-digest-whirlpool" gem 'digest-siphash' gem 'scrypt' gem 'braille', :git => "http://github.com/nicanor/braille.git" @@ -33,7 +33,7 @@ gem 'huffman', :git => "https://github.com/fgosew/huffman" gem 'ruby-graphviz' gem 'rsa' gem 'gpgmeh' -gem 'digest-sha3', :git => "http://github.com/izetex/digest-sha3-ruby" +gem 'sha3' gem 'packetfu' gem 'net-ntp' gem 'CFPropertyList' @@ -43,6 +43,5 @@ gem 'artii' group :test, :development do gem 'minitest' gem 'rake' - gem 'rdoc' gem 'yard' end 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/sha3-224/secgen_local/local.rb b/modules/encoders/hash/sha3-224/secgen_local/local.rb index 30fc8dfba..306d9c2c6 100644 --- a/modules/encoders/hash/sha3-224/secgen_local/local.rb +++ b/modules/encoders/hash/sha3-224/secgen_local/local.rb @@ -1,6 +1,6 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'digest/sha3' +require 'sha3' class SHA3_224_Encoder < HashEncoder def initialize @@ -9,7 +9,7 @@ class SHA3_224_Encoder < HashEncoder end def hash_function(string) - Digest::SHA3.hexdigest(string, 224) + SHA3::Digest.hexdigest(:sha224, string) end end diff --git a/modules/encoders/hash/sha3-256/secgen_local/local.rb b/modules/encoders/hash/sha3-256/secgen_local/local.rb index b4d5f1a2c..2a6cef822 100644 --- a/modules/encoders/hash/sha3-256/secgen_local/local.rb +++ b/modules/encoders/hash/sha3-256/secgen_local/local.rb @@ -1,6 +1,6 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'digest/sha3' +require 'sha3' class SHA3_256_Encoder < HashEncoder def initialize @@ -9,7 +9,7 @@ class SHA3_256_Encoder < HashEncoder end def hash_function(string) - Digest::SHA3.hexdigest(string, 256) + SHA3::Digest.hexdigest(:sha256, string) end end diff --git a/modules/encoders/hash/sha3-384/secgen_local/local.rb b/modules/encoders/hash/sha3-384/secgen_local/local.rb index bb86c3ce7..417c43d9f 100644 --- a/modules/encoders/hash/sha3-384/secgen_local/local.rb +++ b/modules/encoders/hash/sha3-384/secgen_local/local.rb @@ -1,6 +1,6 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'digest/sha3' +require 'sha3' class SHA3_384_Encoder < HashEncoder def initialize @@ -9,7 +9,7 @@ class SHA3_384_Encoder < HashEncoder end def hash_function(string) - Digest::SHA3.hexdigest(string, 384) + SHA3::Digest.hexdigest(:sha384, string) end end diff --git a/modules/encoders/hash/sha3-512/secgen_local/local.rb b/modules/encoders/hash/sha3-512/secgen_local/local.rb index d9be87d7f..cfbca0ee2 100644 --- a/modules/encoders/hash/sha3-512/secgen_local/local.rb +++ b/modules/encoders/hash/sha3-512/secgen_local/local.rb @@ -1,6 +1,6 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'digest/sha3' +require 'sha3' class SHA3_512_Encoder < HashEncoder def initialize @@ -9,7 +9,7 @@ class SHA3_512_Encoder < HashEncoder end def hash_function(string) - Digest::SHA3.hexdigest(string, 512) + SHA3::Digest.hexdigest(:sha512, string) end end diff --git a/modules/encoders/hash/sha3/secgen_local/local.rb b/modules/encoders/hash/sha3/secgen_local/local.rb index c3f353f80..8701d2911 100644 --- a/modules/encoders/hash/sha3/secgen_local/local.rb +++ b/modules/encoders/hash/sha3/secgen_local/local.rb @@ -1,15 +1,15 @@ #!/usr/bin/ruby require_relative '../../../../../lib/objects/local_hash_encoder.rb' -require 'digest/sha3' +require 'openssl' class SHA3Encoder < HashEncoder def initialize super - self.module_name = 'SHA1 Encoder' + self.module_name = 'SHA1 Encoder' # ?? end def hash_function(string) - Digest::SHA1.hexdigest(string) + OpenSSL::Digest::SHA1.new.hexdigest(string) # ?? end end diff --git a/modules/encoders/hash/whirlpool/manifests/.no_puppet b/modules/encoders/hash/whirlpool/manifests/.no_puppet deleted file mode 100644 index e69de29bb..000000000 diff --git a/modules/encoders/hash/whirlpool/secgen_local/local.rb b/modules/encoders/hash/whirlpool/secgen_local/local.rb deleted file mode 100644 index ba1c37eb1..000000000 --- a/modules/encoders/hash/whirlpool/secgen_local/local.rb +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/ruby -require_relative '../../../../../lib/objects/local_hash_encoder.rb' - -class WhirlpoolEncoder < HashEncoder - def initialize - super - self.module_name = 'Whirlpool Hash Encoder' - end - - def hash_function(string) - Digest::Whirlpool.hexdigest(string) - end -end - -WhirlpoolEncoder.new.run diff --git a/modules/encoders/hash/whirlpool/secgen_metadata.xml b/modules/encoders/hash/whirlpool/secgen_metadata.xml deleted file mode 100644 index d32350364..000000000 --- a/modules/encoders/hash/whirlpool/secgen_metadata.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - Whirlpool Hash Encoder - Thomas Shaw - MIT - Generates a Whirlpool hash for each of the strings. - - hash - whirlpool - linux - windows - medium - - strings_to_encode - salt - return_salts - - string - - - Cryptography and authentication (hashes and attacks against authentication schemes / passwords) - - - cryptographic hashing - - - diff --git a/modules/encoders/hash/whirlpool/whirlpool.pp b/modules/encoders/hash/whirlpool/whirlpool.pp deleted file mode 100644 index e69de29bb..000000000