From: Gerardo Ravago Date: Mon, 12 May 2025 18:17:46 +0000 (-0400) Subject: openssl: Fix AWS-LC build X-Git-Tag: 6.0.2dr1~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99fda969b4f434a452199aa31261d68c83c5de61;p=thirdparty%2Fstrongswan.git openssl: Fix AWS-LC build The `crypt` functions defined here conflict with the `crypt` function defined in `unistd.h` and trigger compilation errors when building against the latest version of AWS-LC, which introduced a new transitive include of `unistd.h` via `bio.h`. This simply renames the function to avoid the error. Closes strongswan/strongswan#2786 --- diff --git a/src/libstrongswan/plugins/openssl/openssl_aead.c b/src/libstrongswan/plugins/openssl/openssl_aead.c index 87af0e49e6..b7220bb6a0 100644 --- a/src/libstrongswan/plugins/openssl/openssl_aead.c +++ b/src/libstrongswan/plugins/openssl/openssl_aead.c @@ -86,8 +86,8 @@ struct private_aead_t { /** * Do the actual en/decryption in an EVP context */ -static bool crypt(private_aead_t *this, chunk_t data, chunk_t assoc, chunk_t iv, - u_char *out, int enc) +static bool crypt_data(private_aead_t *this, chunk_t data, chunk_t assoc, + chunk_t iv, u_char *out, int enc) { EVP_CIPHER_CTX *ctx; u_char nonce[NONCE_LEN]; @@ -155,7 +155,7 @@ METHOD(aead_t, encrypt, bool, *encrypted = chunk_alloc(plain.len + this->icv_size); out = encrypted->ptr; } - return crypt(this, plain, assoc, iv, out, 1); + return crypt_data(this, plain, assoc, iv, out, 1); } METHOD(aead_t, decrypt, bool, @@ -176,7 +176,7 @@ METHOD(aead_t, decrypt, bool, *plain = chunk_alloc(encrypted.len); out = plain->ptr; } - return crypt(this, encrypted, assoc, iv, out, 0); + return crypt_data(this, encrypted, assoc, iv, out, 0); } METHOD(aead_t, get_block_size, size_t, diff --git a/src/libstrongswan/plugins/openssl/openssl_crypter.c b/src/libstrongswan/plugins/openssl/openssl_crypter.c index 21056d98d1..53352a83e7 100644 --- a/src/libstrongswan/plugins/openssl/openssl_crypter.c +++ b/src/libstrongswan/plugins/openssl/openssl_crypter.c @@ -102,8 +102,8 @@ static char* lookup_algorithm(uint16_t ikev2_algo, size_t *key_size) /** * Do the actual en/decryption in an EVP context */ -static bool crypt(private_openssl_crypter_t *this, chunk_t data, chunk_t iv, - chunk_t *dst, int enc) +static bool crypt_data(private_openssl_crypter_t *this, chunk_t data, chunk_t iv, + chunk_t *dst, int enc) { EVP_CIPHER_CTX *ctx; int len; @@ -149,13 +149,13 @@ static bool crypt(private_openssl_crypter_t *this, chunk_t data, chunk_t iv, METHOD(crypter_t, decrypt, bool, private_openssl_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *dst) { - return crypt(this, data, iv, dst, 0); + return crypt_data(this, data, iv, dst, 0); } METHOD(crypter_t, encrypt, bool, private_openssl_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *dst) { - return crypt(this, data, iv, dst, 1); + return crypt_data(this, data, iv, dst, 1); } METHOD(crypter_t, get_block_size, size_t,