History

avformat/tls_openssl: use existing context handle

Timo Rothenpieler committed 1 year ago

Commit 043d3fe1 parent 2e729241 file · +6 −6Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/tls_openssl.c+6−6
@@ -836,14 +836,14 @@ static av_cold int openssl_init_ca_key_cert(URLContext *h) · 835 unmodified lines
836836 ret = AVERROR(EIO);
837837 goto fail;
838838 }
839− } else if (p->tls_shared.cert_buf) {
840− cert = cert_from_pem_string(p->tls_shared.cert_buf);
839+ } else if (c->cert_buf) {
840+ cert = cert_from_pem_string(c->cert_buf);
841841 if (SSL_CTX_use_certificate(p->ctx, cert) != 1) {
842842 av_log(p, AV_LOG_ERROR, "SSL: Init SSL_CTX_use_certificate failed, %s\n", openssl_get_error(p));
843843 ret = AVERROR(EINVAL);
844844 return ret;
845845 }
846− } else if (p->tls_shared.is_dtls){
846+ } else if (c->is_dtls){
847847 av_log(p, AV_LOG_ERROR, "TLS: Init cert failed, %s\n", openssl_get_error(p));
848848 ret = AVERROR(EINVAL);
849849 goto fail;
@@ -857,14 +857,14 @@ static av_cold int openssl_init_ca_key_cert(URLContext *h) · 7 unmodified lines
857857 ret = AVERROR(EIO);
858858 goto fail;
859859 }
860− } else if (p->tls_shared.key_buf) {
861− p->pkey = pkey = pkey_from_pem_string(p->tls_shared.key_buf, 1);
860+ } else if (c->key_buf) {
861+ p->pkey = pkey = pkey_from_pem_string(c->key_buf, 1);
862862 if (SSL_CTX_use_PrivateKey(p->ctx, pkey) != 1) {
863863 av_log(p, AV_LOG_ERROR, "TLS: Init SSL_CTX_use_PrivateKey failed, %s\n", openssl_get_error(p));
864864 ret = AVERROR(EINVAL);
865865 return ret;
866866 }
867− } else if (p->tls_shared.is_dtls){
867+ } else if (c->is_dtls) {
868868 av_log(p, AV_LOG_ERROR, "TLS: Init pkey failed, %s\n", openssl_get_error(p));
869869 ret = AVERROR(EINVAL);
870870 goto fail;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t