Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115547478
D40298.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40298.diff
View Options
diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile
--- a/usr.bin/factor/Makefile
+++ b/usr.bin/factor/Makefile
@@ -9,7 +9,6 @@
.if ${MK_OPENSSL} != "no"
CFLAGS+=-DHAVE_OPENSSL
-CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L
LIBADD+=crypto
.endif
diff --git a/usr.bin/factor/factor.c b/usr.bin/factor/factor.c
--- a/usr.bin/factor/factor.c
+++ b/usr.bin/factor/factor.c
@@ -209,7 +209,11 @@
if (!BN_sqr(bnfact, bnfact, ctx))
errx(1, "error in BN_sqr()");
if (BN_cmp(bnfact, val) > 0 ||
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ BN_check_prime(val, NULL, NULL) == 1)
+#else
BN_is_prime_ex(val, PRIME_CHECKS, NULL, NULL) == 1)
+#endif
pr_print(val);
else
pollard_pminus1(val);
@@ -282,7 +286,11 @@
errx(1, "error in BN_gcd()");
if (!BN_is_one(x)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ if (BN_check_prime(x, NULL, NULL) == 1)
+#else
if (BN_is_prime_ex(x, PRIME_CHECKS, NULL, NULL) == 1)
+#endif
pr_print(x);
else
pollard_pminus1(x);
@@ -291,8 +299,13 @@
BN_div(num, NULL, val, x, ctx);
if (BN_is_one(num))
return;
- if (BN_is_prime_ex(num, PRIME_CHECKS, NULL,
- NULL) == 1) {
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ if (BN_check_prime(num, NULL, NULL) == 1)
+#else
+ if (BN_is_prime_ex(num, PRIME_CHECKS, NULL, NULL)
+ == 1)
+#endif
+ {
pr_print(num);
fflush(stdout);
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 4:15 AM (19 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17797831
Default Alt Text
D40298.diff (1 KB)
Attached To
Mode
D40298: factor: support OpenSSL 3
Attached
Detach File
Event Timeline
Log In to Comment