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.
This commit is contained in:
Dmitry Podgorny
2021-03-23 02:08:22 +02:00
parent 4790a61437
commit ee5f9fb77b

View File

@@ -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");