/*
- * Copyright (c) 2016-2020 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016-2021 Samsung Electronics Co., Ltd All Rights Reserved
*
* Contact: Krzysztof Jackiewicz <k.jackiewicz@samsung.com>
*
int ret;
void *tag = NULL;
struct yaca_encrypt_context_s *c = get_encrypt_context(ctx);
- int mode;
+ assert(c != NULL);
+ assert(c->cipher_ctx != NULL);
- if (c == NULL || value == NULL)
+ if (value == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- assert(c->cipher_ctx != NULL);
- mode = EVP_CIPHER_CTX_mode(c->cipher_ctx);
+ int mode = EVP_CIPHER_CTX_mode(c->cipher_ctx);
switch (property) {
case YACA_PROPERTY_GCM_TAG:
if (c == NULL || input_len == 0 || output_len == NULL || op_type != c->op_type)
return YACA_ERROR_INVALID_PARAMETER;
+ assert(c->cipher_ctx != NULL);
+
int mode = EVP_CIPHER_CTX_mode(c->cipher_ctx);
int nid = EVP_CIPHER_CTX_nid(c->cipher_ctx);
if (c == NULL || output == NULL || output_len == NULL || op_type != c->op_type)
return YACA_ERROR_INVALID_PARAMETER;
+ assert(c->cipher_ctx != NULL);
+
if (!verify_state_change(c, ENC_CTX_FINALIZED))
return YACA_ERROR_INVALID_PARAMETER;