openssl/apps
Jiasheng Jiang c24f545100 APPS: Add missing OPENSSL_free() and combine the error handler
Add the OPENSSL_free() in the error handler to release the "*md_value"
allocated by app_malloc(). To make the code clear and avoid possible
future errors, combine the error handler in the "err" tag.
Then, we only need to use "goto err" instead of releasing the memory
separately.

Since the EVP_MD_get_size() may return negative numbers when an error occurs,
create_query() may fail to catch the error since it only considers 0 as an
error code.

Therefore, unifying the error codes of create_digest() from non-positive
numbers to 0 is better, which also benefits future programming.

Fixes: c7235be ("RFC 3161 compliant time stamp request creation, response generation and response verification.")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/23873)

(cherry picked from commit beb82177dd)
2024-04-09 20:37:02 +02:00
..
demoSRP apps & al : Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:28 +11:00
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 Copyright year updates 2024-04-09 14:09:20 +02:00
asn1parse.c Harden asn1 oid loader to invalid inputs 2023-12-13 11:10:36 -05:00
build.info CMP test server: move apps/{,lib/}cmp_mock_srv.c and apps/{,include/}cmp_mock_srv.h 2021-05-20 16:23:27 +02:00
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 Abstract out policy and extensions in CA.pl 2021-11-16 15:48:08 +00:00
cert.pem
ciphers.c Check that sk_SSL_CIPHER_value returns non-NULL value. 2022-09-20 18:27:17 +02:00
client.pem
cmp.c Copyright year updates 2024-03-20 13:07:54 +01:00
cms.c Fix a possible memleak in cms_main 2023-12-12 19:45:09 +01:00
crl.c Copyright year updates 2024-03-29 14:05:51 +00:00
crl2pkcs7.c APPS: Improve diagnostics on missing/extra args and unknown cipher/digest 2021-12-07 15:26:40 +01:00
ct_log_list.cnf Remove unnecessary trailing whitespace 2019-02-05 16:25:11 +01:00
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
dsa-ca.pem
dsa-pca.pem
dsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
dsa512.pem
dsa1024.pem
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 Support decode SM2 parameters 2022-08-23 11:08:11 +10:00
enc.c Copyright year updates 2024-03-20 13:07:54 +01:00
engine.c Copyright year updates 2024-03-20 13:07:54 +01:00
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 Copyright year updates 2024-03-20 13:07:54 +01:00
genrsa.c Copyright year updates 2023-09-28 14:23:29 +01:00
info.c APPS: Improve diagnostics on missing/extra args and unknown cipher/digest 2021-12-07 15:26:40 +01:00
insta.ca.crt openssl-cmp.pod.in: Update and extend example using Insta Demo CA 2020-08-04 12:11:46 +02:00
kdf.c kdf: use the app's libctx and property query when searching for algorithms 2021-06-15 18:26:47 +10:00
list.c Make 'openssl list' less sensitive for providers without params 2023-12-04 15:12:34 +01:00
mac.c Always use FORMAT_BINARY for infile 2022-09-20 08:18:25 +01:00
nseq.c APPS: Improve diagnostics on missing/extra args and unknown cipher/digest 2021-12-07 15:26:40 +01:00
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 Update copyright year 2022-05-03 13:34:51 +01:00
pca-cert.srl
pca-key.pem
pca-req.pem
pkcs7.c Update copyright year 2022-05-03 13:34:51 +01:00
pkcs8.c Added a 'saltlen' option to the openssl pkcs8 command line app. 2023-09-04 14:15:34 +10:00
pkcs12.c Copyright year updates 2024-03-29 14:05:51 +00:00
pkey.c Copyright year updates 2023-09-07 09:59:15 +01:00
pkeyparam.c APPS: pkeyparam: Support setting properties 2022-08-17 09:20:41 +02:00
pkeyutl.c Copyright year updates 2023-09-07 09:59:15 +01:00
prime.c Update copyright year 2022-05-03 13:34:51 +01:00
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 Copyright year updates 2024-03-20 13:07:54 +01:00
req.c Fix openssl req with -addext subjectAltName=dirName 2024-04-02 17:35:55 +02:00
req.pem
rsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa8192.pem Fix rsa8192.pem 2020-05-13 06:28:36 +02: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 Copyright year updates 2024-03-20 13:07:54 +01:00
s_time.c Copyright year updates 2024-03-20 13:07:54 +01:00
server.pem Replace apps/server.pem with certificate with a sha256 signature. 2020-01-25 14:10:40 +01:00
server.srl
server2.pem
sess_id.c APPS: Improve diagnostics on missing/extra args and unknown cipher/digest 2021-12-07 15:26:40 +01:00
smime.c Fix a possible memleak in smime_main 2023-12-12 19:47:07 +01:00
speed.c Fix "Error finalizing cipher loop" when running openssl speed -evp -decrypt 2024-04-09 20:28:04 +02:00
spkac.c Copyright year updates 2023-09-07 09:59:15 +01:00
srp.c openssl srp: make index.txt parsing error more verbose 2021-05-24 14:37:00 +02:00
storeutl.c Fix openssl storeutl to allow serial + issuer 2022-12-14 09:33:25 +01:00
testCA.pem
testdsa.h Replace OSSL_PARAM_BLD_free_params() with OSSL_PARAM_free(). 2021-04-12 16:55:30 +10:00
testrsa.h Following the license change, modify the boilerplates in apps/ 2018-12-06 14:15:27 +01:00
timeouts.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
ts.c APPS: Add missing OPENSSL_free() and combine the error handler 2024-04-09 20:37:02 +02:00
tsget.in convert tabs to spaces in two distributed Perl scripts 2021-09-14 07:21:22 +10:00
verify.c apps & al : Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:28 +11:00
version.c APPS: Improve diagnostics on missing/extra args and unknown cipher/digest 2021-12-07 15:26:40 +01:00
vms_decc_init.c VMS: move copy_argc to its own module and make it an aux source 2019-03-05 08:51:09 +01:00
x509.c Copyright year updates 2024-03-20 13:07:54 +01:00