Commit b84145b3 authored by Chad Brubaker's avatar Chad Brubaker Committed by android-build-merger
Browse files

Prevent duplicate certificates in TrustedCertificateIndex am: 4c9f9c22 am:...

Prevent duplicate certificates in TrustedCertificateIndex am: 4c9f9c22 am: 1a86d309 am: 825390d5 am: 360cc576
am: 95de98f0

* commit '95de98f0':
  Prevent duplicate certificates in TrustedCertificateIndex
parents e03c349a 95de98f0
......@@ -68,6 +68,15 @@ public final class TrustedCertificateIndex {
if (anchors == null) {
anchors = new ArrayList<TrustAnchor>(1);
subjectToTrustAnchors.put(subject, anchors);
} else {
// Avoid indexing the same certificate multiple times
if (cert != null) {
for (TrustAnchor entry : anchors) {
if (cert.equals(entry.getTrustedCert())) {
return;
}
}
}
}
anchors.add(anchor);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment