diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 08:31:12 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 08:31:12 +0000 |
commit | f51147e8a114cdb5a80c49d6351e19d00272aceb (patch) | |
tree | 047e7e3305fd282ef866b4715758de3ce723f994 /ext | |
parent | afaab849fd40771db08ab26091ef1ea813d8806f (diff) | |
download | ruby-f51147e8a114cdb5a80c49d6351e19d00272aceb.tar.gz |
fixup! r52695
OpenSSL's SHA1 struct name is SHA_CTX (which is also used for SHA-0),
but function name is SHA1_Transform.
http://openssl.org/docs/man0.9.8/crypto/SHA1.html
also note that LibreSSL 2.3 remove the SHA-0 support but still support SHA-1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/digest/digest_conf.rb | 5 | ||||
-rw-r--r-- | ext/digest/sha1/extconf.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/digest/digest_conf.rb b/ext/digest/digest_conf.rb index b2a8195fa2..6a4ef6f176 100644 --- a/ext/digest/digest_conf.rb +++ b/ext/digest/digest_conf.rb @@ -1,4 +1,4 @@ -def digest_conf(name, hdr = name, funcs = nil) +def digest_conf(name, hdr = name, funcs = nil, types = nil) unless with_config("bundled-#{name}") cc = with_config("common-digest") if cc == true or /\b#{name}\b/ =~ cc @@ -15,9 +15,10 @@ def digest_conf(name, hdr = name, funcs = nil) if have_library("crypto") funcs ||= name.upcase funcs = Array(funcs) + types ||= funcs hdr = "openssl/#{hdr}.h" if funcs.all? {|func| OpenSSL.check_func("#{func}_Transform", hdr)} && - funcs.all? {|func| have_type("#{func}_CTX", hdr)} + types.all? {|type| have_type("#{type}_CTX", hdr)} $defs << "-D#{name.upcase}_USE_OPENSSL" return :ossl end diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb index b5c111f36e..03cbf66b5e 100644 --- a/ext/digest/sha1/extconf.rb +++ b/ext/digest/sha1/extconf.rb @@ -9,7 +9,7 @@ $defs << "-DHAVE_CONFIG_H" $objs = [ "sha1init.#{$OBJEXT}" ] -digest_conf("sha1", "sha", "SHA") +digest_conf("sha1", "sha", nil, %w[SHA]) have_header("sys/cdefs.h") |