Skip to content

Commit 5c5126b

Browse files
author
Hon Ching(Vicky) Lo
committed
Fix missing EVP_CIPHER_CTX initialization
Signed-off-by: Marcus Meissner <marcusmeissner@users.sourceforge.net> Signed-off-by: Hon Ching (Vicky) Lo <honclo@linux.vnet.ibm.com>
1 parent 9472ae7 commit 5c5126b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎lib/tpm_unseal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ int tpmUnsealFile( char* fname, unsigned char** tss_data, int* tss_size,
408408
}
409409

410410
/* Decode and decrypt the encrypted data */
411-
EVP_CIPHER_CTX *ctx = NULL;
411+
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
412412
EVP_DecryptInit(ctx, EVP_aes_256_cbc(), symKey, (unsigned char *)TPMSEAL_IV);
413413

414414
/* Create a base64 BIO to decode the encrypted data */

‎src/cmds/tpm_sealdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ int main(int argc, char **argv)
343343
BIO_puts(bdata, TPMSEAL_ENC_STRING);
344344
bdata = BIO_push(b64, bdata);
345345

346-
EVP_CIPHER_CTX *ctx = NULL;
346+
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
347347
EVP_EncryptInit(ctx, EVP_aes_256_cbc(), randKey, (unsigned char *)TPMSEAL_IV);
348348

349349
while ((lineLen = BIO_read(bin, line, sizeof(line))) > 0) {

0 commit comments

Comments
 (0)