1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
naruse 2015-11-26 08:31:12 +00:00
parent 676c80d203
commit 360b98355e
2 changed files with 4 additions and 3 deletions

View file

@ -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}") unless with_config("bundled-#{name}")
cc = with_config("common-digest") cc = with_config("common-digest")
if cc == true or /\b#{name}\b/ =~ cc if cc == true or /\b#{name}\b/ =~ cc
@ -15,9 +15,10 @@ def digest_conf(name, hdr = name, funcs = nil)
if have_library("crypto") if have_library("crypto")
funcs ||= name.upcase funcs ||= name.upcase
funcs = Array(funcs) funcs = Array(funcs)
types ||= funcs
hdr = "openssl/#{hdr}.h" hdr = "openssl/#{hdr}.h"
if funcs.all? {|func| OpenSSL.check_func("#{func}_Transform", hdr)} && 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" $defs << "-D#{name.upcase}_USE_OPENSSL"
return :ossl return :ossl
end end

View file

@ -9,7 +9,7 @@ $defs << "-DHAVE_CONFIG_H"
$objs = [ "sha1init.#{$OBJEXT}" ] $objs = [ "sha1init.#{$OBJEXT}" ]
digest_conf("sha1", "sha", "SHA") digest_conf("sha1", "sha", nil, %w[SHA])
have_header("sys/cdefs.h") have_header("sys/cdefs.h")