wolfSSL: Old FIPS APIs have void return
Fix the calls to wc_AesEncryptDirect(). Old versions of wolfCrypt FIPS had wc_AesEncryptDirect() return void instead of int. Fix this build issue. Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
This commit is contained in:
parent
ec7f064fa7
commit
890953a32c
1 changed files with 12 additions and 0 deletions
|
@ -578,12 +578,18 @@ void * aes_encrypt_init(const u8 *key, size_t len)
|
|||
|
||||
int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
|
||||
{
|
||||
#if defined(HAVE_FIPS) && \
|
||||
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION <= 2))
|
||||
/* Old FIPS has void return on this API */
|
||||
wc_AesEncryptDirect(ctx, crypt, plain);
|
||||
#else
|
||||
int err = wc_AesEncryptDirect(ctx, crypt, plain);
|
||||
|
||||
if (err != 0) {
|
||||
LOG_WOLF_ERROR_FUNC(wc_AesEncryptDirect, err);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -621,12 +627,18 @@ void * aes_decrypt_init(const u8 *key, size_t len)
|
|||
|
||||
int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain)
|
||||
{
|
||||
#if defined(HAVE_FIPS) && \
|
||||
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION <= 2))
|
||||
/* Old FIPS has void return on this API */
|
||||
wc_AesDecryptDirect(ctx, plain, crypt);
|
||||
#else
|
||||
int err = wc_AesDecryptDirect(ctx, plain, crypt);
|
||||
|
||||
if (err != 0) {
|
||||
LOG_WOLF_ERROR_FUNC(wc_AesDecryptDirect, err);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue