Skip to content

Commit

Permalink
FIX: wrong context casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 31, 2022
1 parent 2077fb5 commit 77aac4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/p-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ static void free_crypt_cipher_context(CRYPT_CTX *ctx);
case SYM_ARIA_256_CBC:
mbedtls_aria_init((mbedtls_aria_context *)ctx->cipher_ctx);
if (ctx->operation == MBEDTLS_ENCRYPT) {
err = mbedtls_aria_setkey_enc((mbedtls_camellia_context *)ctx->cipher_ctx, ctx->key, ctx->key_bitlen);
err = mbedtls_aria_setkey_enc((mbedtls_aria_context *)ctx->cipher_ctx, ctx->key, ctx->key_bitlen);
}
else {
err = mbedtls_aria_setkey_dec((mbedtls_camellia_context *)ctx->cipher_ctx, ctx->key, ctx->key_bitlen);
err = mbedtls_aria_setkey_dec((mbedtls_aria_context *)ctx->cipher_ctx, ctx->key, ctx->key_bitlen);
}
COPY_MEM(ctx->nonce, ctx->IV, MBEDTLS_MAX_IV_LENGTH);
break;
Expand Down

0 comments on commit 77aac4f

Please sign in to comment.