aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-20 01:55:31 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-27 23:07:40 +0900
commit8e9419ba692c7c46ee80241571015f2069b7e47b (patch)
tree82007954e92404139f3da6e2b7a8b21869e41bff
parent2cc8ba075cdd330a3949ab4f6084e3d565a6e43e (diff)
downloadruby-8e9419ba692c7c46ee80241571015f2069b7e47b.tar.gz
ext/openssl: avoid deprecated BN primes functions
BN_generate_prime(), BN_is_prime(), BN_is_prime_fasttest() is deprecated and the replacements are available on all versions of OpenSSL >= 0.9.8.
-rw-r--r--ext/openssl/ossl_bn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index fba86cd..1be7737 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -766,7 +766,7 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
if (!(result = BN_new())) {
ossl_raise(eBNError, NULL);
}
- if (!BN_generate_prime(result, num, safe, add, rem, NULL, NULL)) {
+ if (!BN_generate_prime_ex(result, num, safe, add, rem, NULL)) {
BN_free(result);
ossl_raise(eBNError, NULL);
}
@@ -874,7 +874,7 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
checks = NUM2INT(vchecks);
}
GetBN(self, bn);
- switch (BN_is_prime(bn, checks, NULL, ossl_bn_ctx, NULL)) {
+ switch (BN_is_prime_ex(bn, checks, ossl_bn_ctx, NULL)) {
case 1:
return Qtrue;
case 0:
@@ -913,7 +913,7 @@ ossl_bn_is_prime_fasttest(int argc, VALUE *argv, VALUE self)
if (vtrivdiv == Qfalse) {
do_trial_division = 0;
}
- switch (BN_is_prime_fasttest(bn, checks, NULL, ossl_bn_ctx, NULL, do_trial_division)) {
+ switch (BN_is_prime_fasttest_ex(bn, checks, ossl_bn_ctx, do_trial_division, NULL)) {
case 1:
return Qtrue;
case 0: