From ee5f9fb77b5660f1bcbf9f79af1484ac20035923 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Tue, 23 Mar 2021 02:08:22 +0200 Subject: [PATCH] tls/openssl: fix openssl-3.0.0 support 3.0.0 includes the "id-on-xmppAddr" object and OBJ_create() returns NID_undef if we try to create a new one. --- src/tls_openssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tls_openssl.c b/src/tls_openssl.c index b77b5ba..2345b45 100644 --- a/src/tls_openssl.c +++ b/src/tls_openssl.c @@ -632,6 +632,9 @@ static X509 *_tls_cert_read(xmpp_conn_t *conn) static int _tls_xaddr_nid(void) { static int xaddr_nid = NID_undef; + if (xaddr_nid == NID_undef) { + xaddr_nid = OBJ_sn2nid("id-on-xmppAddr"); + } if (xaddr_nid == NID_undef) { xaddr_nid = OBJ_create("1.3.6.1.5.5.7.8.5", "id-on-xmppAddr", "XmppAddr Identifier");