[rs-commit] r25 - in /redwax-tool/trunk: config.h.in configure.ac redwax_openssl.c

rs-commit at redwax.eu rs-commit at redwax.eu
Tue Nov 16 17:06:51 CET 2021


Author: minfrin at redwax.eu
Date: Tue Nov 16 17:06:50 2021
New Revision: 25

Log:
Support older openssl that does not support RSA_get0_n
and friends.

Modified:
    redwax-tool/trunk/config.h.in
    redwax-tool/trunk/configure.ac
    redwax-tool/trunk/redwax_openssl.c

Modified: redwax-tool/trunk/config.h.in
==============================================================================
--- redwax-tool/trunk/config.h.in	(original)
+++ redwax-tool/trunk/config.h.in	Tue Nov 16 17:06:50 2021
@@ -31,6 +31,30 @@
 /* Define to 1 if you have the `p11_kit_modules_load_and_initialize' function.
    */
 #undef HAVE_P11_KIT_MODULES_LOAD_AND_INITIALIZE
+
+/* Define to 1 if you have the `RSA_get0_d' function. */
+#undef HAVE_RSA_GET0_D
+
+/* Define to 1 if you have the `RSA_get0_dmp1' function. */
+#undef HAVE_RSA_GET0_DMP1
+
+/* Define to 1 if you have the `RSA_get0_dmq1' function. */
+#undef HAVE_RSA_GET0_DMQ1
+
+/* Define to 1 if you have the `RSA_get0_e' function. */
+#undef HAVE_RSA_GET0_E
+
+/* Define to 1 if you have the `RSA_get0_iqmp' function. */
+#undef HAVE_RSA_GET0_IQMP
+
+/* Define to 1 if you have the `RSA_get0_n' function. */
+#undef HAVE_RSA_GET0_N
+
+/* Define to 1 if you have the `RSA_get0_p' function. */
+#undef HAVE_RSA_GET0_P
+
+/* Define to 1 if you have the `RSA_get0_q' function. */
+#undef HAVE_RSA_GET0_Q
 
 /* Define to 1 if stdbool.h conforms to C99. */
 #undef HAVE_STDBOOL_H

Modified: redwax-tool/trunk/configure.ac
==============================================================================
--- redwax-tool/trunk/configure.ac	(original)
+++ redwax-tool/trunk/configure.ac	Tue Nov 16 17:06:50 2021
@@ -96,7 +96,7 @@
 
 # Checks for library functions.
 AC_FUNC_MALLOC
-AC_CHECK_FUNCS([OPENSSL_init_crypto X509_STORE_get0_param X509_STORE_CTX_set0_trusted_stack X509_STORE_CTX_get_num_untrusted EVP_PKEY_get0_description NSS_Initialize p11_kit_modules_load_and_initialize apr_crypto_clear])
+AC_CHECK_FUNCS([OPENSSL_init_crypto X509_STORE_get0_param X509_STORE_CTX_set0_trusted_stack X509_STORE_CTX_get_num_untrusted EVP_PKEY_get0_description RSA_get0_n RSA_get0_e RSA_get0_d RSA_get0_p RSA_get0_q RSA_get0_dmp1 RSA_get0_dmq1 RSA_get0_iqmp NSS_Initialize p11_kit_modules_load_and_initialize apr_crypto_clear])
 
 AC_OUTPUT
 

Modified: redwax-tool/trunk/redwax_openssl.c
==============================================================================
--- redwax-tool/trunk/redwax_openssl.c	(original)
+++ redwax-tool/trunk/redwax_openssl.c	Tue Nov 16 17:06:50 2021
@@ -91,6 +91,62 @@
 
 #if !HAVE_X509_STORE_CTX_SET0_TRUSTED_STACK
 #define X509_STORE_CTX_set0_trusted_stack X509_STORE_CTX_trusted_stack
+#endif
+
+#if !HAVE_RSA_GET0_N
+const BIGNUM *RSA_get0_n(const RSA *r)
+{
+    return r->n;
+}
+#endif
+
+#if !HAVE_RSA_GET0_E
+const BIGNUM *RSA_get0_e(const RSA *r)
+{
+    return r->e;
+}
+#endif
+
+#if !HAVE_RSA_GET0_D
+const BIGNUM *RSA_get0_d(const RSA *r)
+{
+    return r->d;
+}
+#endif
+
+#if !HAVE_RSA_GET0_P
+const BIGNUM *RSA_get0_p(const RSA *r)
+{
+    return r->p;
+}
+#endif
+
+#if !HAVE_RSA_GET0_Q
+const BIGNUM *RSA_get0_q(const RSA *r)
+{
+    return r->q;
+}
+#endif
+
+#if !HAVE_RSA_GET0_DMP1
+const BIGNUM *RSA_get0_dmp1(const RSA *r)
+{
+    return r->dmp1;
+}
+#endif
+
+#if !HAVE_RSA_GET0_DMQ1
+const BIGNUM *RSA_get0_dmq1(const RSA *r)
+{
+    return r->dmq1;
+}
+#endif
+
+#if !HAVE_RSA_GET0_IQMP
+const BIGNUM *RSA_get0_iqmp(const RSA *r)
+{
+    return r->iqmp;
+}
 #endif
 
 static void redwax_openssl_print_errors(redwax_tool_t *r)



More information about the rs-commit mailing list