Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Eliminated duplicated pinned certificates #2756

Merged
merged 2 commits into from Jun 1, 2015

Conversation

kcharwood
Copy link
Contributor

We have identified an issue that prevents validatesCertificateChain from validating the entire chain if a developer mistakenly pins duplicate certificates.

The fix is to simply ensure pinned certificates does not contain any duplicates. This does not represent an actual security vulnerability, as the duplicate certificates still need to be present in the certificate chain of the server trust.

In addition, this problem may also go away in a future version, if we deprecate the validatesCertificateChain property as discussed in #2744

For now, we can put this fix into 2.5.5.

@kcharwood kcharwood added this to the 2.5.5 milestone May 29, 2015
@@ -237,6 +237,39 @@ - (void)testPublicKeyPinningFailsForHTTPBinOrgIfNoCertificateIsPinned {
CFRelease(trust);
}

- (void)testSettingDuplicateCertificatesProperlyRemovesTheDuplicate {
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be AFSSLPinningModeCertificate since you are testing certs here rather than public keys? I realize it really doesn't matter under the hood since the type doesn't affect the removal of duplicate certs.

@kcharwood
Copy link
Contributor Author

Added your feedback @cnoon 🍻

@cnoon
Copy link
Member

cnoon commented May 29, 2015

Looks good good to me @kcharwood...I'd say merge it!

kcharwood added a commit that referenced this pull request Jun 1, 2015
…_certificates

Eliminated duplicated pinned certificates
@kcharwood kcharwood merged commit a0be9c5 into master Jun 1, 2015
@sunuslee
Copy link

sunuslee commented Jun 3, 2015

hi, kcharwood. great job:)

@kcharwood kcharwood modified the milestones: 2.5.5, 2.6.0 Jun 26, 2015
@kcharwood kcharwood deleted the eliminate_duplicate_pinned_certificates branch October 2, 2015 18:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants