Branch: Tag:

2014-04-30

2014-04-30 15:59:55 by Martin Nilsson <nilsson@opera.com>

Don't add duplicates to load_authorities response.

162:    return pkc && pkc->pkcs_verify(msg, hash, signature);    }    +  protected int(0..1) `==(mixed o) +  { +  return objectp(o) && o->pkc?->name && pkc->name()==o->pkc->name() && +  pkc->public_key_equal(o->pkc); +  } +     protected string _sprintf(int t)    {    return t=='O' && sprintf("%O(%O)", this_program, pkc);
1508:    if (!objectp(m)) continue;    TBSCertificate tbs = verify_ca_certificate(m->body);    if (!tbs) continue; -  res[tbs->subject->get_der()] += ({ tbs->public_key }); +  string subj = tbs->subject->get_der(); +  if( !res[subj] || !has_value(res[subj], tbs->public_key ) ) +  res[subj] += ({ tbs->public_key });    }    continue;    }
1525:    if (!cert) continue;    TBSCertificate tbs = verify_ca_certificate(cert);    if (!tbs) continue; -  res[tbs->subject->get_der()] += ({ tbs->public_key }); +  string subj = tbs->subject->get_der(); +  if( !res[subj] || !has_value(res[subj], tbs->public_key ) ) +  res[subj] += ({ tbs->public_key });    }    }    return res;