summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/lib/openssl/bn.rb2
-rw-r--r--ext/openssl/ossl_bn.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb
index e7cbf2cfaf..624c13715c 100644
--- a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -29,7 +29,7 @@ end # OpenSSL
#
class Integer
def to_bn
- OpenSSL::BN::new(self)
+ OpenSSL::BN::new(self.to_s(16), 16)
end
end # Integer
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 6e7c4b628a..be43b0eacd 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -669,7 +669,7 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
VALUE vchecks;
int checks = BN_prime_checks;
- if (rb_scan_args(argc, argv, "01", &vchecks) == 0) {
+ if (rb_scan_args(argc, argv, "01", &vchecks) == 1) {
checks = NUM2INT(vchecks);
}
GetBN(self, bn);