From: Tobias Brunner Date: Tue, 11 Jul 2023 09:44:35 +0000 (+0200) Subject: pki: Make sure to wipe decrypted PKCS#7 data X-Git-Tag: android-2.4.2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7d7a6be3a81989c30e9498db6d883a839184f9c;p=thirdparty%2Fstrongswan.git pki: Make sure to wipe decrypted PKCS#7 data --- diff --git a/src/pki/commands/pkcs7.c b/src/pki/commands/pkcs7.c index 8d3528fdc1..074beeab51 100644 --- a/src/pki/commands/pkcs7.c +++ b/src/pki/commands/pkcs7.c @@ -235,8 +235,7 @@ static int decrypt(chunk_t chunk) container->destroy(container); write_to_stream(stdout, data); - free(data.ptr); - + chunk_clear(&data); return 0; } diff --git a/src/pki/commands/scep.c b/src/pki/commands/scep.c index f5cc93084d..a1f0530a99 100644 --- a/src/pki/commands/scep.c +++ b/src/pki/commands/scep.c @@ -587,7 +587,7 @@ end: if (status == 0) { status = pki_cert_extract_cert(data, form) ? 0 : 1; - chunk_free(&data); + chunk_clear(&data); } err: