]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Use wolfSSL 5.6.2 for tests
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 Jun 2023 08:13:10 +0000 (10:13 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 13 Jun 2023 08:13:29 +0000 (10:13 +0200)
ECC keys can now be smaller so we can't access the private key directly
anymore.

scripts/test.sh
src/libstrongswan/plugins/wolfssl/wolfssl_ec_diffie_hellman.c
testing/scripts/recipes/012_wolfssl.mk

index 89a878236b8ba6f289f917e94f89c33e19c5cd5f..ecf63ad57409d857fad697f578eea340c9f53287 100755 (executable)
@@ -37,7 +37,7 @@ build_botan()
 
 build_wolfssl()
 {
-       WOLFSSL_REV=v5.6.0-stable
+       WOLFSSL_REV=v5.6.2-stable
        WOLFSSL_DIR=$DEPS_BUILD_DIR/wolfssl
 
        if test -d "$WOLFSSL_DIR"; then
index 6d7ed570dd4d6d407b85b6efa3530958284aa3bf..739f348afe0e3853836ce76fcf9794c102641eb3 100644 (file)
     #define USE_RNG_FOR_TIMING_RESISTANCE
 #endif
 
+#ifndef WOLFSSL_HAVE_ECC_KEY_GET_PRIV
+    #define wc_ecc_key_get_priv(key) (&((key)->k))
+#endif
+
 typedef struct private_wolfssl_ec_diffie_hellman_t private_wolfssl_ec_diffie_hellman_t;
 
 /**
@@ -177,7 +181,8 @@ METHOD(key_exchange_t, set_private_key, bool,
                return FALSE;
        }
 
-       ret = mp_read_unsigned_bin(&this->key.k, value.ptr, value.len);
+       ret = mp_read_unsigned_bin(wc_ecc_key_get_priv(&this->key), value.ptr,
+                                                          value.len);
        /* get base point */
        if (ret == 0)
        {
@@ -194,7 +199,8 @@ METHOD(key_exchange_t, set_private_key, bool,
        if (ret == 0)
        {
                /* calculate public key */
-               success = wolfssl_ecc_multiply(this->key.dp, &this->key.k, base,
+               success = wolfssl_ecc_multiply(this->key.dp,
+                                                                          wc_ecc_key_get_priv(&this->key), base,
                                                                           &this->key.pubkey);
        }
 
index ddb7ee2c668c5a5c0039d0043dcae32064abe45b..cc2a282301f65a05678e5461f39e73b13b6081d3 100644 (file)
@@ -2,7 +2,7 @@
 
 PKG = wolfssl
 SRC = https://github.com/wolfSSL/$(PKG).git
-REV = v5.6.0-stable
+REV = v5.6.2-stable
 
 NUM_CPUS := $(shell getconf _NPROCESSORS_ONLN)