summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_bn.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@ruby-lang.org>2003-07-25 06:50:55 +0000
committergotoyuzo <gotoyuzo@ruby-lang.org>2003-07-25 06:50:55 +0000
commit7d4cf9a9c1fecb0f1a045dd4011f1ac590903037 (patch)
tree5f3ff819e2af75501159b2f249c770679b502355 /ext/openssl/ossl_bn.c
parent6498decb298a23ee64f1383f770255e0625407ec (diff)
downloadruby-openssl-history-7d4cf9a9c1fecb0f1a045dd4011f1ac590903037.tar.gz
* ext/openssl/extconf.rb: add check for BN_rand_range() and
BN_pseudo_rand_range(). * ext/openssl/ossl_bn.c (ossl_bn_s_rand_range): should raise NotImplementedError if BN_rand_range() wan not defined. * ext/openssl/ossl_bn.c (ossl_bn_s_pseudo_rand_range): should raise NotImplementedError if BN_pseudo_rand_range() wan not defined. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_s_encrypt): avoid compiler warning for OpenSSL-0.9.6. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7si_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_bn.c')
-rw-r--r--ext/openssl/ossl_bn.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 92b43bd..c59d809 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -472,8 +472,25 @@ BIGNUM_RAND(pseudo_rand);
WrapBN(klass, obj, result); \
return obj; \
}
+
+#define BIGNUM_RAND_RANGE_NOT_IMPL(func) \
+ static VALUE \
+ ossl_bn_s_##func##_range(VALUE klass, VALUE range) \
+ { \
+ rb_notimplement(); \
+ }
+
+#if defined(HAVE_BN_RAND_RANGE)
BIGNUM_RAND_RANGE(rand);
+#else
+BIGNUM_RAND_RANGE_NOT_IMPL(rand);
+#endif
+
+#if defined(HAVE_BN_PSEUDO_RAND_RANGE)
BIGNUM_RAND_RANGE(pseudo_rand);
+#else
+BIGNUM_RAND_RANGE_NOT_IMPL(pseudo_rand);
+#endif
static VALUE
ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)