summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_bn.c
diff options
context:
space:
mode:
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 92b43bd5d1..c59d809bae 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)