]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use the special shims file for ECDSA shims
authorAram Sargsyan <aram@isc.org>
Tue, 14 Sep 2021 14:59:18 +0000 (14:59 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 28 Oct 2021 07:38:56 +0000 (07:38 +0000)
Since we now have a separate `openssl_shim.{c,h}` files in the `dns`
library, we can place the exisintg shims there.

lib/dns/openssl_shim.c
lib/dns/openssl_shim.h
lib/dns/opensslecdsa_link.c

index 4fbb119a9a708fed931b1481b029b366fbfc7467..143ccbcfe8abee2fc6afe8d5b3a53fffa21421da 100644 (file)
 
 #include "openssl_shim.h"
 
+#include <openssl/bn.h>
+#include <openssl/ecdsa.h>
 #include <openssl/err.h>
 
+#if !HAVE_ECDSA_SIG_GET0
+/* From OpenSSL 1.1 */
+void
+ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) {
+       if (pr != NULL) {
+               *pr = sig->r;
+       }
+       if (ps != NULL) {
+               *ps = sig->s;
+       }
+}
+
+int
+ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) {
+       if (r == NULL || s == NULL) {
+               return (0);
+       }
+
+       BN_clear_free(sig->r);
+       BN_clear_free(sig->s);
+       sig->r = r;
+       sig->s = s;
+
+       return (1);
+}
+#endif /* !HAVE_ECDSA_SIG_GET0 */
+
 #if !HAVE_ERR_GET_ERROR_ALL
 static const char err_empty_string = '\0';
 
index 382d1548a82f431c400c991c9c2f6570e9840d91..c2ada37714580a2c72cde1877413acc11c25ebbf 100644 (file)
 
 #pragma once
 
+#include <openssl/bn.h>
+#include <openssl/ecdsa.h>
 #include <openssl/err.h>
 
+#if !HAVE_ECDSA_SIG_GET0
+void
+ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
+
+int
+ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
+#endif /* !HAVE_ECDSA_SIG_GET0 */
+
 #if !HAVE_ERR_GET_ERROR_ALL
 unsigned long
 ERR_get_error_all(const char **file, int *line, const char **func,
index 2aace1a0e0a4f530d72dd95e08a38c99d43822f4..29f17c1d74c1a067d7f7b73c50480a0319a98b4d 100644 (file)
                goto err; \
        }
 
-#if !HAVE_ECDSA_SIG_GET0
-/* From OpenSSL 1.1 */
-static void
-ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) {
-       if (pr != NULL) {
-               *pr = sig->r;
-       }
-       if (ps != NULL) {
-               *ps = sig->s;
-       }
-}
-
-static int
-ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) {
-       if (r == NULL || s == NULL) {
-               return (0);
-       }
-
-       BN_clear_free(sig->r);
-       BN_clear_free(sig->s);
-       sig->r = r;
-       sig->s = s;
-
-       return (1);
-}
-#endif /* !HAVE_ECDSA_SIG_GET0 */
-
 static isc_result_t
 opensslecdsa_createctx(dst_key_t *key, dst_context_t *dctx) {
        EVP_MD_CTX *evp_md_ctx;