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

ruby-changes:37495

From: nobu <ko1@a...>
Date: Thu, 12 Feb 2015 18:34:12 +0900 (JST)
Subject: [ruby-changes:37495] nobu:r49576 (trunk): openssl: check RAND_edg to support libressl

nobu	2015-02-12 18:34:02 +0900 (Thu, 12 Feb 2015)

  New Revision: 49576

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

  Log:
    openssl: check RAND_edg to support libressl
    
    * ext/openssl/extconf.rb: check RAND_edg to support libressl.
    * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
      is available.  [Fix GH-829]

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/extconf.rb
    trunk/ext/openssl/ossl_rand.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49575)
+++ ChangeLog	(revision 49576)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Feb 12 18:34:01 2015  multisnow  <infinity.blick.winkel@g...>
+
+	* ext/openssl/extconf.rb: check RAND_edg to support libressl.
+
+	* ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
+	  is available.  [Fix GH-829]
+
 Thu Feb 12 10:46:14 2015  Eric Hodel  <drbrain@s...>
 
 	* proc.c (proc_call):  Improve Proc#call documentation.  Patch by
Index: ext/openssl/ossl_rand.c
===================================================================
--- ext/openssl/ossl_rand.c	(revision 49575)
+++ ext/openssl/ossl_rand.c	(revision 49576)
@@ -148,6 +148,7 @@ ossl_rand_pseudo_bytes(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L148
     return str;
 }
 
+#ifdef HAVE_RAND_EGD
 /*
  *  call-seq:
  *     egd(filename) -> true
@@ -186,6 +187,7 @@ ossl_rand_egd_bytes(VALUE self, VALUE fi https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L187
     }
     return Qtrue;
 }
+#endif /* HAVE_RAND_EGD */
 
 /*
  *  call-seq:
@@ -219,8 +221,10 @@ Init_ossl_rand(void) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_rand.c#L221
     rb_define_module_function(mRandom, "write_random_file", ossl_rand_write_file, 1);
     rb_define_module_function(mRandom, "random_bytes", ossl_rand_bytes, 1);
     rb_define_module_function(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
+#ifdef HAVE_RAND_EGD
     rb_define_module_function(mRandom, "egd", ossl_rand_egd, 1);
     rb_define_module_function(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
+#endif /* HAVE_RAND_EGD */
     rb_define_module_function(mRandom, "status?", ossl_rand_status, 0);
 }
 
Index: ext/openssl/extconf.rb
===================================================================
--- ext/openssl/extconf.rb	(revision 49575)
+++ ext/openssl/extconf.rb	(revision 49576)
@@ -87,6 +87,7 @@ have_func("HMAC_CTX_init") https://github.com/ruby/ruby/blob/trunk/ext/openssl/extconf.rb#L87
 have_func("PEM_def_callback")
 have_func("PKCS5_PBKDF2_HMAC")
 have_func("PKCS5_PBKDF2_HMAC_SHA1")
+have_func("RAND_egd")
 have_func("X509V3_set_nconf")
 have_func("X509V3_EXT_nconf_nid")
 have_func("X509_CRL_add0_revoked")

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

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