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:
committed by
Tobias Brunner
parent
7ec0101250
commit
99fda969b4
@@ -86,8 +86,8 @@ struct private_aead_t {
|
|||||||
/**
|
/**
|
||||||
* Do the actual en/decryption in an EVP context
|
* 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,
|
static bool crypt_data(private_aead_t *this, chunk_t data, chunk_t assoc,
|
||||||
u_char *out, int enc)
|
chunk_t iv, u_char *out, int enc)
|
||||||
{
|
{
|
||||||
EVP_CIPHER_CTX *ctx;
|
EVP_CIPHER_CTX *ctx;
|
||||||
u_char nonce[NONCE_LEN];
|
u_char nonce[NONCE_LEN];
|
||||||
@@ -155,7 +155,7 @@ METHOD(aead_t, encrypt, bool,
|
|||||||
*encrypted = chunk_alloc(plain.len + this->icv_size);
|
*encrypted = chunk_alloc(plain.len + this->icv_size);
|
||||||
out = encrypted->ptr;
|
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,
|
METHOD(aead_t, decrypt, bool,
|
||||||
@@ -176,7 +176,7 @@ METHOD(aead_t, decrypt, bool,
|
|||||||
*plain = chunk_alloc(encrypted.len);
|
*plain = chunk_alloc(encrypted.len);
|
||||||
out = plain->ptr;
|
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,
|
METHOD(aead_t, get_block_size, size_t,
|
||||||
|
|||||||
@@ -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
|
* Do the actual en/decryption in an EVP context
|
||||||
*/
|
*/
|
||||||
static bool crypt(private_openssl_crypter_t *this, chunk_t data, chunk_t iv,
|
static bool crypt_data(private_openssl_crypter_t *this, chunk_t data, chunk_t iv,
|
||||||
chunk_t *dst, int enc)
|
chunk_t *dst, int enc)
|
||||||
{
|
{
|
||||||
EVP_CIPHER_CTX *ctx;
|
EVP_CIPHER_CTX *ctx;
|
||||||
int len;
|
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,
|
METHOD(crypter_t, decrypt, bool,
|
||||||
private_openssl_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *dst)
|
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,
|
METHOD(crypter_t, encrypt, bool,
|
||||||
private_openssl_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *dst)
|
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,
|
METHOD(crypter_t, get_block_size, size_t,
|
||||||
|
|||||||
Reference in New Issue
Block a user