From b281f7428465e793df00003a121dbe16d129c0a6 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 20 Feb 2019 10:40:20 +0000 Subject: [PATCH] psa: example: Initialize operation contexts Add missing initializers to PSA Crypto example. Operation contexts must be initialized before calling psa_*_setup(). --- programs/psa/crypto_examples.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/psa/crypto_examples.c b/programs/psa/crypto_examples.c index 9947a70bc9..090875613f 100644 --- a/programs/psa/crypto_examples.c +++ b/programs/psa/crypto_examples.c @@ -109,7 +109,7 @@ static psa_status_t cipher_encrypt( psa_key_handle_t key_handle, size_t *output_len ) { psa_status_t status; - psa_cipher_operation_t operation; + psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; size_t iv_len = 0; memset( &operation, 0, sizeof( operation ) ); @@ -140,7 +140,7 @@ static psa_status_t cipher_decrypt( psa_key_handle_t key_handle, size_t *output_len ) { psa_status_t status; - psa_cipher_operation_t operation; + psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; memset( &operation, 0, sizeof( operation ) ); status = psa_cipher_decrypt_setup( &operation, key_handle, alg );