lib/lockbox/key_generator.rb in lockbox-0.2.2 vs lib/lockbox/key_generator.rb in lockbox-0.2.3

- old
+ new

@@ -19,10 +19,10 @@ def hash_hmac(hash, ikm, salt) OpenSSL::HMAC.digest(hash, salt, ikm) end def hkdf(ikm, salt:, info:, length:, hash:) - if OpenSSL::KDF.respond_to?(:hkdf) + if defined?(OpenSSL::KDF.hkdf) return OpenSSL::KDF.hkdf(ikm, salt: salt, info: info, length: length, hash: hash) end prk = hash_hmac(hash, ikm, salt)