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
This commit is contained in:
Gerardo Ravago 2025-05-12 14:17:46 -04:00 committed by Tobias Brunner
parent 7ec0101250
commit 99fda969b4
2 changed files with 8 additions and 8 deletions

View File

@ -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,

View File

@ -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,