]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - providers/implementations/exchange/ecx_exch.c
Fix external symbols related to ec & sm2 keys
[thirdparty/openssl.git] / providers / implementations / exchange / ecx_exch.c
index db6aa90c03bd243dd86e53cf74f96d65b0ac23d8..6d4471be3cf4b2c2429c0c08aaf59e1c1f982cf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
 #include <openssl/core_names.h>
 #include <openssl/params.h>
 #include <openssl/err.h>
+#include <openssl/proverr.h>
 #include "internal/cryptlib.h"
 #include "crypto/ecx.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
 #ifdef S390X_EC_ASM
 # include "s390x_arch.h"
 #endif
@@ -80,12 +80,12 @@ static int ecx_init(void *vecxctx, void *vkey)
     if (ecxctx == NULL
             || key == NULL
             || key->keylen != ecxctx->keylen
-            || !ecx_key_up_ref(key)) {
+            || !ossl_ecx_key_up_ref(key)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         return 0;
     }
 
-    ecx_key_free(ecxctx->key);
+    ossl_ecx_key_free(ecxctx->key);
     ecxctx->key = key;
 
     return 1;
@@ -102,11 +102,11 @@ static int ecx_set_peer(void *vecxctx, void *vkey)
     if (ecxctx == NULL
             || key == NULL
             || key->keylen != ecxctx->keylen
-            || !ecx_key_up_ref(key)) {
+            || !ossl_ecx_key_up_ref(key)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         return 0;
     }
-    ecx_key_free(ecxctx->peerkey);
+    ossl_ecx_key_free(ecxctx->peerkey);
     ecxctx->peerkey = key;
 
     return 1;
@@ -182,8 +182,8 @@ static void ecx_freectx(void *vecxctx)
 {
     PROV_ECX_CTX *ecxctx = (PROV_ECX_CTX *)vecxctx;
 
-    ecx_key_free(ecxctx->key);
-    ecx_key_free(ecxctx->peerkey);
+    ossl_ecx_key_free(ecxctx->key);
+    ossl_ecx_key_free(ecxctx->peerkey);
 
     OPENSSL_free(ecxctx);
 }
@@ -203,15 +203,15 @@ static void *ecx_dupctx(void *vecxctx)
     }
 
     *dstctx = *srcctx;
-    if (dstctx->key != NULL && !ecx_key_up_ref(dstctx->key)) {
+    if (dstctx->key != NULL && !ossl_ecx_key_up_ref(dstctx->key)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         OPENSSL_free(dstctx);
         return NULL;
     }
 
-    if (dstctx->peerkey != NULL && !ecx_key_up_ref(dstctx->peerkey)) {
+    if (dstctx->peerkey != NULL && !ossl_ecx_key_up_ref(dstctx->peerkey)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
-        ecx_key_free(dstctx->key);
+        ossl_ecx_key_free(dstctx->key);
         OPENSSL_free(dstctx);
         return NULL;
     }