From 66aacee31e487473f00d2b614bc09db678b19b84 Mon Sep 17 00:00:00 2001 From: Sebastian Denz Date: Mon, 11 Feb 2019 10:29:18 +0100 Subject: [PATCH] change NID_x500UniqueIdentifier to NID_userId to access itu-t.9.2342.19200300.100.1.1 (see #1843) --- src/modules/tls/tls_select.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/tls/tls_select.c b/src/modules/tls/tls_select.c index 60c53073707..66292e6bbe5 100644 --- a/src/modules/tls/tls_select.c +++ b/src/modules/tls/tls_select.c @@ -68,7 +68,7 @@ enum { COMP_URI, /* URI from subject/alternative */ COMP_E, /* Email address */ COMP_IP, /* IP from subject/alternative */ - COMP_UI, /* Unique identifier */ + COMP_UID, /* UserID*/ TLSEXT_SN /* Server name of the peer */ }; @@ -97,7 +97,7 @@ enum { PV_COMP_URI = 1<<17, /* URI from subject/alternative */ PV_COMP_E = 1<<18, /* Email address */ PV_COMP_IP = 1<<19, /* IP from subject/alternative */ - PV_COMP_UI = 1<<20, /* Unique identifier */ + PV_COMP_UID = 1<<20, /* UserID*/ PV_TLSEXT_SNI = 1<<21, /* Peer's server name (TLS extension) */ }; @@ -714,7 +714,7 @@ static int get_comp(str* res, int local, int issuer, int nid, sip_msg_t* msg) case NID_countryName: elem = "CountryName"; break; case NID_stateOrProvinceName: elem = "StateOrProvinceName"; break; case NID_localityName: elem = "LocalityName"; break; - case NID_x500UniqueIdentifier: elem = "UniqueIdentifier"; break; + case NID_userId: elem = "UserID"; break; default: elem = "Unknown"; break; } DBG("Element %s not found in certificate subject/issuer\n", elem); @@ -762,7 +762,7 @@ static int sel_comp(str* res, select_t* s, sip_msg_t* msg) case COMP_C: nid = NID_countryName; break; case COMP_ST: nid = NID_stateOrProvinceName; break; case COMP_L: nid = NID_localityName; break; - case COMP_UI: nid = NID_x500UniqueIdentifier; break; + case COMP_UID: nid = NID_userId; break; default: BUG("Bug in sel_comp: %d\n", s->params[s->n - 1].v.i); return -1; @@ -810,7 +810,7 @@ static int pv_comp(sip_msg_t* msg, pv_param_t* param, pv_value_t* res) case PV_COMP_C: nid = NID_countryName; break; case PV_COMP_ST: nid = NID_stateOrProvinceName; break; case PV_COMP_L: nid = NID_localityName; break; - case PV_COMP_UI: nid = NID_x500UniqueIdentifier; break; + case PV_COMP_UID: nid = NID_userId; break; default: nid = NID_undef; } @@ -1137,9 +1137,9 @@ select_row_t tls_sel[] = { { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("organizational_unit_name"), sel_comp, DIVERSION | COMP_OU}, { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("unit"), sel_comp, DIVERSION | COMP_OU}, - { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("uid"), sel_comp, DIVERSION | COMP_UI}, - { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("uniqueIdentifier"), sel_comp, DIVERSION | COMP_UI}, - { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("unique_identifier"), sel_comp, DIVERSION | COMP_UI}, + { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("uid"), sel_comp, DIVERSION | COMP_UID}, + { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("uniqueIdentifier"), sel_comp, DIVERSION | COMP_UID}, + { sel_name, SEL_PARAM_STR, STR_STATIC_INIT("unique_identifier"), sel_comp, DIVERSION | COMP_UID}, { NULL, SEL_PARAM_INT, STR_NULL, NULL, 0} }; @@ -1263,10 +1263,10 @@ pv_export_t tls_pv[] = { /* unique identifier for peer and local */ {{"tls_peer_subject_uid", sizeof("tls_peer_subject_uid")-1}, PVT_OTHER, pv_comp, 0, - 0, 0, pv_init_iname, PV_CERT_PEER | PV_CERT_SUBJECT | PV_COMP_UI }, + 0, 0, pv_init_iname, PV_CERT_PEER | PV_CERT_SUBJECT | PV_COMP_UID }, {{"tls_my_subject_uid", sizeof("tls_my_subject_uid")-1}, PVT_OTHER, pv_comp, 0, - 0, 0, pv_init_iname, PV_CERT_LOCAL | PV_CERT_SUBJECT | PV_COMP_UI }, + 0, 0, pv_init_iname, PV_CERT_LOCAL | PV_CERT_SUBJECT | PV_COMP_UID }, /* subject alternative name parameters for peer and local */ {{"tls_peer_san_email", sizeof("tls_peer_san_email")-1}, PVT_OTHER, pv_alt, 0,