Skip to content

Commit

Permalink
change NID_x500UniqueIdentifier to NID_userId to access itu-t.9.2342.…
Browse files Browse the repository at this point in the history
…19200300.100.1.1 (see kamailio#1843)
  • Loading branch information
denzs committed Feb 11, 2019
1 parent de185aa commit 66aacee
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/modules/tls/tls_select.c
Expand Up @@ -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 */
};

Expand Down Expand Up @@ -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) */
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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}
};
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 66aacee

Please sign in to comment.