diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2025-07-13 21:08:05 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2025-07-16 18:46:55 +0200 |
commit | 454f161b4bd3e776f40d943ad475b2009f433ff9 (patch) | |
tree | 5d46a56a43f779fafd46f67002e548778547d9c1 /libavformat/tls_openssl.c | |
parent | 40ce64eae7ee9dcffc827a6f7f17c3341a7d5ec5 (diff) | |
download | ffmpeg-454f161b4bd3e776f40d943ad475b2009f433ff9.tar.gz |
avformat/tls_openssl: make generating fingerprints optional
Diffstat (limited to 'libavformat/tls_openssl.c')
-rw-r--r-- | libavformat/tls_openssl.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c index cd11419fee..48d8edb08a 100644 --- a/libavformat/tls_openssl.c +++ b/libavformat/tls_openssl.c @@ -216,11 +216,13 @@ int ff_ssl_read_key_cert(char *key_url, char *cert_url, char *key_buf, size_t ke snprintf(cert_buf, cert_sz, "%s", cert_tem); /* Generate fingerprint. */ - *fingerprint = generate_fingerprint(cert); - if (!*fingerprint) { - av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url); - ret = AVERROR(EIO); - goto end; + if (fingerprint) { + *fingerprint = generate_fingerprint(cert); + if (!*fingerprint) { + av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url); + ret = AVERROR(EIO); + goto end; + } } end: @@ -371,9 +373,11 @@ static int openssl_gen_certificate(EVP_PKEY *pkey, X509 **cert, char **fingerpri goto einval_end; } - *fingerprint = generate_fingerprint(*cert); - if (!*fingerprint) { - goto enomem_end; + if (fingerprint) { + *fingerprint = generate_fingerprint(*cert); + if (!*fingerprint) { + goto enomem_end; + } } goto end; |