summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar orbea2024-04-23 09:24:56 -0700
committerGravatar orbea2024-04-23 09:43:56 -0700
commit9d74aed599b4bb5f6c2fce042ab9630acaebb159 (patch)
tree0911e9ed7eeda872b3a56689d91325f60b781e36
parent5f083426b4ede24b2576f3a56eaf8ac3632c02f7 (diff)
downloadlibimobiledevice-9d74aed599b4bb5f6c2fce042ab9630acaebb159.tar.gz
libimobiledevice-9d74aed599b4bb5f6c2fce042ab9630acaebb159.tar.bz2
libsrp6a-sha512: disable BN_mod_exp_mont_word() with LibreSSL
When building libimobiledevice with LibreSSL 3.9 it fails with an implicit declaration for BN_mod_exp_mont_word(). This function was removed from the public symbols in LibreSSL because it is rarely used where "BN_mod_exp() and BN_mod_exp_mont() will use the word optimization when appropriate." Reference: https://github.com/libressl/portable/issues/1049 Signed-off-by: orbea <orbea@riseup.net>
-rw-r--r--3rd_party/libsrp6a-sha512/t_math.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/3rd_party/libsrp6a-sha512/t_math.c b/3rd_party/libsrp6a-sha512/t_math.c
index 037650e..dac19ec 100644
--- a/3rd_party/libsrp6a-sha512/t_math.c
+++ b/3rd_party/libsrp6a-sha512/t_math.c
@@ -720,7 +720,11 @@ BigIntegerModExp(BigInteger r, BigInteger b, BigInteger e, BigInteger m, BigInte
else if(a == NULL) {
BN_mod_exp(r, b, e, m, c);
}
-#if OPENSSL_VERSION_NUMBER >= 0x00906000
+/*
+ * In LibreSSL BN_mod_exp_mont_word() is not a public symbol where BN_mod_exp()
+ * and BN_mod_exp_mont() will use the word optimization when appropriate.
+ */
+#if OPENSSL_VERSION_NUMBER >= 0x00906000 && !defined(LIBRESSL_VERSION_NUMBER)
else if(B > 0 && B < ULONG_MAX) { /* 0.9.6 and above has mont_word optimization */
BN_mod_exp_mont_word(r, B, e, m, c, a);
}