Skip to content

Commit 454f161

Browse files
committed
avformat/tls_openssl: make generating fingerprints optional
1 parent 40ce64e commit 454f161

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

libavformat/tls_openssl.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,13 @@ int ff_ssl_read_key_cert(char *key_url, char *cert_url, char *key_buf, size_t ke
216216
snprintf(cert_buf, cert_sz, "%s", cert_tem);
217217

218218
/* Generate fingerprint. */
219-
*fingerprint = generate_fingerprint(cert);
220-
if (!*fingerprint) {
221-
av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url);
222-
ret = AVERROR(EIO);
223-
goto end;
219+
if (fingerprint) {
220+
*fingerprint = generate_fingerprint(cert);
221+
if (!*fingerprint) {
222+
av_log(NULL, AV_LOG_ERROR, "TLS: Failed to generate fingerprint from %s\n", cert_url);
223+
ret = AVERROR(EIO);
224+
goto end;
225+
}
224226
}
225227

226228
end:
@@ -371,9 +373,11 @@ static int openssl_gen_certificate(EVP_PKEY *pkey, X509 **cert, char **fingerpri
371373
goto einval_end;
372374
}
373375

374-
*fingerprint = generate_fingerprint(*cert);
375-
if (!*fingerprint) {
376-
goto enomem_end;
376+
if (fingerprint) {
377+
*fingerprint = generate_fingerprint(*cert);
378+
if (!*fingerprint) {
379+
goto enomem_end;
380+
}
377381
}
378382

379383
goto end;

0 commit comments

Comments
 (0)