pike.git / lib / modules / Standards.pmod / X509.pmod

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:1592:    });    if (!arrayp(root_cert_dirs)) {    root_cert_dirs = ({ root_cert_dirs });    }    mapping(string:array(Verifier)) res = ([]);       foreach(root_cert_dirs, string dir) {    string pem = Stdio.read_bytes(combine_path(dir, "ca-certificates.crt"));    if (pem) {    Standards.PEM.Messages messages = Standards.PEM.Messages(pem); -  foreach(messages->fragments, string|Standards.PEM.Message m) { -  if (!objectp(m) || m->pre!="CERTIFICATE" || !m->body) continue; -  TBSCertificate tbs = verify_ca_certificate(m->body); +  foreach(messages->get_certificates(), string m) { +  TBSCertificate tbs = verify_ca_certificate(m);    if (!tbs) continue;    string subj = tbs->subject->get_der();    if( !res[subj] || !has_value(res[subj], tbs->public_key ) )    res[subj] += ({ tbs->public_key });    }    continue;    }    foreach(get_dir(dir) || ({}), string fname) {    if (has_suffix(fname, ".0")) {    // Skip OpenSSL hash files for now (as they are duplicates).