Exemplo n.º 1
0
CERTCertList*
GetRootsForOid(SECOidTag oid_tag)
{
  CERTCertList* certList = CERT_NewCertList();
  if (!certList)
    return nullptr;

  for (size_t iEV = 0; iEV < PR_ARRAY_SIZE(myTrustedEVInfos); ++iEV) {
    nsMyTrustedEVInfo& entry = myTrustedEVInfos[iEV];
    if (entry.oid_tag == oid_tag) {
      addToCertListIfTrusted(certList, entry.cert);
    }
  }

  return certList;
}
Exemplo n.º 2
0
CERTCertList*
getRootsForOid(SECOidTag oid_tag)
{
  CERTCertList *certList = CERT_NewCertList();
  if (!certList)
    return nullptr;

  for (size_t iEV=0; iEV < (sizeof(myTrustedEVInfos)/sizeof(nsMyTrustedEVInfo)); ++iEV) {
    nsMyTrustedEVInfo &entry = myTrustedEVInfos[iEV];
    if (!entry.oid_name) // invalid or placeholder list entry
      continue;
    if (entry.oid_tag == oid_tag) {
      addToCertListIfTrusted(certList, entry.cert);
    }
  }

#ifdef PSM_ENABLE_TEST_EV_ROOTS
  getRootsForOidFromExternalRootsFile(certList, oid_tag);
#endif
  return certList;
}