openssl/apps
Bernd Edlinger ff78d94b13 Fix a possible memory leak in req_main
if the private key is output to stdout using the HARNESS_OSSL_PREFIX,
out is a stack of BIOs and must therefore free'd using BIO_free_all.

Steps to reproduce:

$ HARNESS_OSSL_PREFIX=x OPENSSL_CONF=apps/openssl.cnf util/shlib_wrap.sh apps/openssl req -new -keyout - -passout pass: </dev/null
[...]
Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f6f692b89cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7f6f686eda00 in CRYPTO_malloc crypto/mem.c:202
    #2 0x7f6f686edba0 in CRYPTO_zalloc crypto/mem.c:222
    #3 0x7f6f68471bdf in BIO_new_ex crypto/bio/bio_lib.c:83
    #4 0x7f6f68491a8f in BIO_new_fp crypto/bio/bss_file.c:95
    #5 0x555c5f58b378 in dup_bio_out apps/lib/apps.c:3014
    #6 0x555c5f58f9ac in bio_open_default_ apps/lib/apps.c:3175
    #7 0x555c5f58f9ac in bio_open_default apps/lib/apps.c:3203
    #8 0x555c5f528537 in req_main apps/req.c:683
    #9 0x555c5f50e315 in do_cmd apps/openssl.c:426
    #10 0x555c5f4c5575 in main apps/openssl.c:307
    #11 0x7f6f680461c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: 128 byte(s) leaked in 1 allocation(s).

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23365)
2024-01-24 11:54:21 +01:00
..
demoSRP
include Add option SSL_OP_PREFER_NO_DHE_KEX, allowing the server to prefer non-dhe psk key exchange over psk with dhe (config file option PreferNoDHEKEX, server option prefer_no_dhe_kex). 2023-11-24 15:08:04 +00:00
lib apps: Don't print hostname on bio_out during connect. 2023-12-29 11:50:18 +01:00
asn1parse.c Harden asn1 oid loader to invalid inputs 2023-12-13 11:10:36 -05:00
build.info
ca-cert.srl
ca-key.pem
ca-req.pem
ca.c Copyright year updates 2023-09-07 09:59:15 +01:00
CA.pl.in
cert.pem
ciphers.c
client.pem
cmp.c CMP app and doc: add -no_cache_extracerts option / OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 2024-01-17 15:03:41 +01:00
cms.c Fix a possible memleak in cms_main 2023-12-12 19:45:09 +01:00
crl2pkcs7.c
crl.c
ct_log_list.cnf
dgst.c Fix some memory leaks in the openssl app 2023-09-21 14:39:36 +02:00
dhparam.c Copyright year updates 2023-09-28 14:23:29 +01:00
dsa512.pem
dsa1024.pem
dsa-ca.pem
dsa-pca.pem
dsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
dsap.pem
dsaparam.c Fix some memory leaks in the openssl app 2023-09-21 14:39:36 +02:00
ec.c Copyright year updates 2023-09-07 09:59:15 +01:00
ecparam.c
enc.c enc: "bad decrypt" only in decryption 2023-09-20 08:12:07 +10:00
engine.c
errstr.c Fix some invalid use of sscanf 2023-12-12 16:12:32 +00:00
fipsinstall.c Copyright year updates 2023-09-07 09:59:15 +01:00
gendsa.c Copyright year updates 2023-09-28 14:23:29 +01:00
genpkey.c Add missing genpkey -rand support 2024-01-16 11:40:01 +01:00
genrsa.c Copyright year updates 2023-09-28 14:23:29 +01:00
info.c
insta.ca.crt
kdf.c
list.c Make 'openssl list' less sensitive for providers without params 2023-12-04 15:12:34 +01:00
mac.c
nseq.c
ocsp.c Copyright year updates 2023-09-07 09:59:15 +01:00
openssl-vms.cnf Convert jdkTrustedKeyUsage to be a pkcs12 cmd line option 2023-10-20 16:30:43 +01:00
openssl.c APPS: remove duplicate definition of trace_data_stack 2023-09-18 09:06:47 +10:00
openssl.cnf Convert jdkTrustedKeyUsage to be a pkcs12 cmd line option 2023-10-20 16:30:43 +01:00
passwd.c
pca-cert.srl
pca-key.pem
pca-req.pem
pkcs7.c
pkcs8.c Added a 'saltlen' option to the openssl pkcs8 command line app. 2023-09-04 14:15:34 +10:00
pkcs12.c pkcs12: Do not forcibly load the config file 2023-12-13 12:32:22 +01:00
pkey.c Copyright year updates 2023-09-07 09:59:15 +01:00
pkeyparam.c
pkeyutl.c Copyright year updates 2023-09-07 09:59:15 +01:00
prime.c
privkey.pem
progs.pl Copyright year updates 2023-09-28 14:23:29 +01:00
rand.c Augment rand argument parsing to allow scaling 2023-11-13 12:21:34 +01:00
rehash.c Fix a possible memleak in apps/rehash.c 2023-12-12 19:48:50 +01:00
req.c Fix a possible memory leak in req_main 2024-01-24 11:54:21 +01:00
req.pem
rsa8192.pem
rsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsautl.c Copyright year updates 2023-09-07 09:59:15 +01:00
s512-key.pem
s512-req.pem
s1024key.pem
s1024req.pem
s_client.c Don't error if s_client receives exactly BUFSIZZ data 2023-11-01 10:20:19 +00:00
s_server.c Error in s_server when -rev option is used with dtls. 2024-01-15 16:34:06 +01:00
s_time.c Remove receiving of unused return value 2024-01-15 17:19:34 +01:00
server2.pem
server.pem
server.srl
sess_id.c
smime.c Fix a possible memleak in smime_main 2023-12-12 19:47:07 +01:00
speed.c openssl-speed: support KMAC128 & KMAC256, refactor mac setup/teardown 2023-11-24 13:58:14 +01:00
spkac.c Copyright year updates 2023-09-07 09:59:15 +01:00
srp.c
storeutl.c
testCA.pem
testdsa.h
testrsa.h
timeouts.h
ts.c Copyright year updates 2023-09-07 09:59:15 +01:00
tsget.in
verify.c
version.c
vms_decc_init.c
x509.c Add apps/x509 -set_issuer & -set_subject option to override issuer & subject 2024-01-15 10:40:01 +01:00