Skip to content

Commit

Permalink
Update wolfSSL plugin for strongSwan to resolve build conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-weller-wolfssl committed Oct 24, 2022
1 parent d42f436 commit 005fd9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libstrongswan/plugins/wolfssl/wolfssl_common.h
Expand Up @@ -48,20 +48,20 @@
#define PARSE_ERROR WOLFSSL_PARSE_ERROR

/* Remap unused enums from the OpenSSL compatibility layer to avoid conflicts */
#define ASN1_BOOLEAN REMAP_ASN1_BOOLEAN
#define ASN1_OID REMAP_ASN1_OID
#define ASN1_INTEGER REMAP_ASN1_INTEGER
#define ASN1_BIT_STRING REMAP_ASN1_BIT_STRING
#define ASN1_IA5STRING REMAP_ASN1_IA5STRING
#define ASN1_OCTET_STRING REMAP_ASN1_OCTET_STRING
#define ASN1_UTCTIME REMAP_ASN1_UTCTIME
#define ASN1_GENERALIZEDTIME REMAP_ASN1_GENERALIZEDTIME

#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/ssl.h>

#if defined(HAVE_FIPS) && \
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
#include <wolfssl/wolfcrypt/fips_test.h>
#endif

/* Special type used to handle EdDSA keys depending on config options */
#if defined(HAVE_ED25519) || defined(HAVE_ED448)
#ifdef HAVE_ED25519
Expand Down
3 changes: 3 additions & 0 deletions src/libstrongswan/plugins/wolfssl/wolfssl_ec_diffie_hellman.c
Expand Up @@ -210,11 +210,14 @@ static bool compute_shared_key(private_wolfssl_ec_diffie_hellman_t *this)
{
return FALSE;
}
#if !defined(HAVE_FIPS) || \
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 5))
if (wc_ecc_set_rng(&this->key, &rng) != 0)
{
wc_FreeRng(&rng);
return FALSE;
}
#endif
#endif

this->shared_secret = chunk_alloc(this->keysize);
Expand Down

0 comments on commit 005fd9d

Please sign in to comment.