mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
cipher: improve code readibility in mbedtls_cipher_setup()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@@ -263,9 +263,11 @@ int mbedtls_cipher_setup(mbedtls_cipher_context_t *ctx,
|
|||||||
|
|
||||||
memset(ctx, 0, sizeof(mbedtls_cipher_context_t));
|
memset(ctx, 0, sizeof(mbedtls_cipher_context_t));
|
||||||
|
|
||||||
if ((mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func != NULL) &&
|
if (mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func != NULL) {
|
||||||
(ctx->cipher_ctx = mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func()) == NULL) {
|
ctx->cipher_ctx = mbedtls_cipher_get_base(cipher_info)->ctx_alloc_func();
|
||||||
return MBEDTLS_ERR_CIPHER_ALLOC_FAILED;
|
if (ctx->cipher_ctx == NULL) {
|
||||||
|
return MBEDTLS_ERR_CIPHER_ALLOC_FAILED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->cipher_info = cipher_info;
|
ctx->cipher_info = cipher_info;
|
||||||
|
Reference in New Issue
Block a user