[前][次][番号順一覧][スレッド一覧]

ruby-changes:40676

From: naruse <ko1@a...>
Date: Thu, 26 Nov 2015 17:31:29 +0900 (JST)
Subject: [ruby-changes:40676] naruse:r52755 (trunk): fixup! r52695

naruse	2015-11-26 17:31:12 +0900 (Thu, 26 Nov 2015)

  New Revision: 52755

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52755

  Log:
    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.

  Modified files:
    trunk/ext/digest/digest_conf.rb
    trunk/ext/digest/sha1/extconf.rb
Index: ext/digest/digest_conf.rb
===================================================================
--- ext/digest/digest_conf.rb	(revision 52754)
+++ ext/digest/digest_conf.rb	(revision 52755)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/digest/digest_conf.rb#L1
-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 https://github.com/ruby/ruby/blob/trunk/ext/digest/digest_conf.rb#L15
     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
Index: ext/digest/sha1/extconf.rb
===================================================================
--- ext/digest/sha1/extconf.rb	(revision 52754)
+++ ext/digest/sha1/extconf.rb	(revision 52755)
@@ -9,7 +9,7 @@ $defs << "-DHAVE_CONFIG_H" https://github.com/ruby/ruby/blob/trunk/ext/digest/sha1/extconf.rb#L9
 
 $objs = [ "sha1init.#{$OBJEXT}" ]
 
-digest_conf("sha1", "sha", "SHA")
+digest_conf("sha1", "sha", nil, %w[SHA])
 
 have_header("sys/cdefs.h")
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]