MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / X509_NAME_get_index_by_NID

Function X509_NAME_get_index_by_NID

extra/yassl/src/ssl.cpp:1323–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321
1322
1323int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos)
1324{
1325 int idx = -1; // not found
1326 const char* start = &name->GetName()[lastpos + 1];
1327
1328 switch (nid) {
1329 case NID_commonName:
1330 const char* found = strstr(start, "/CN=");
1331 if (found) {
1332 found += 4; // advance to str
1333 idx = found - start + lastpos + 1;
1334 }
1335 break;
1336 }
1337
1338 return idx;
1339}
1340
1341
1342ASN1_STRING* X509_NAME_ENTRY_get_data(X509_NAME_ENTRY* ne)

Callers

nothing calls this directly

Calls 1

GetNameMethod · 0.45

Tested by

no test coverage detected