unwind/unbound: prepare for opaque DSA and RSA.
authortb <tb@openbsd.org>
Sun, 9 Jan 2022 18:46:56 +0000 (18:46 +0000)
committertb <tb@openbsd.org>
Sun, 9 Jan 2022 18:46:56 +0000 (18:46 +0000)
Use the OpenSSL 1.1 codepath using accessors that have been available
since LibreSSL 2.7 instead of reaching into the structs.

ok sthen

sbin/unwind/libunbound/sldns/keyraw.c
usr.sbin/unbound/sldns/keyraw.c

index b1e60d8..a40f1e8 100644 (file)
@@ -250,7 +250,7 @@ sldns_key_buf2dsa_raw(unsigned char* key, size_t len)
        if(!(dsa = DSA_new())) {
                return NULL;
        }
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
+#if OPENSSL_VERSION_NUMBER < 0x10100000
 #ifndef S_SPLINT_S
        dsa->p = P;
        dsa->q = Q;
@@ -428,7 +428,7 @@ sldns_key_buf2rsa_raw(unsigned char* key, size_t len)
                BN_free(modulus);
                return NULL;
        }
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
+#if OPENSSL_VERSION_NUMBER < 0x10100000
 #ifndef S_SPLINT_S
        rsa->n = modulus;
        rsa->e = exponent;
index b1e60d8..a40f1e8 100644 (file)
@@ -250,7 +250,7 @@ sldns_key_buf2dsa_raw(unsigned char* key, size_t len)
        if(!(dsa = DSA_new())) {
                return NULL;
        }
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
+#if OPENSSL_VERSION_NUMBER < 0x10100000
 #ifndef S_SPLINT_S
        dsa->p = P;
        dsa->q = Q;
@@ -428,7 +428,7 @@ sldns_key_buf2rsa_raw(unsigned char* key, size_t len)
                BN_free(modulus);
                return NULL;
        }
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
+#if OPENSSL_VERSION_NUMBER < 0x10100000
 #ifndef S_SPLINT_S
        rsa->n = modulus;
        rsa->e = exponent;