Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SHA-1 dependency from production library #871

Merged
merged 1 commit into from
Mar 22, 2020

Conversation

oldalton
Copy link
Member

Use of SHA-1 is not permitted in production code anymore by SDL (it hasn't been for years and getting exception has become increasingly difficult). Hash collisions are computationally feasible for these algorithms, which effectively "breaks" them.

There were two scenarios where our libraries took dependency on SHA-1 protocols:

  1. PKeyAuth response when server provides CertificateThumbrint. This is only supported by ADFS and not supported by AAD. It is not feasible to update older versions of ADFS to get rid of SHA-1 dependency. However, it is confirmed by ADFS that thumbprint is only meant to be used as a hint. Since it is SHA-1 thumbprint and it is not meant to be used as a reliable thumbprint by any production code, this code is now removed and certificate is sent to ADFS for final validation.

  2. Client credential request for automation token requests. This is not production code and sha-1 can be used there.

@oldalton oldalton requested a review from a team as a code owner March 15, 2020 21:57
@oldalton oldalton merged commit 2ff4d38 into dev Mar 22, 2020
@oldalton oldalton deleted the oldalton/remove_sha1_dependency branch March 22, 2020 18:37
melissaahn added a commit to AzureAD/microsoft-authentication-library-common-for-android that referenced this pull request May 25, 2023
### Summary
In the PKeyAuth protocol, the non-interactive flow can send a
[thumbprint-based certificate
challenge](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pkap/31066cbf-2462-4cb6-b0b9-68af2f21a5d0).
This thumbprint is meant to serve as a hint to the client side to
cross-check the thumbprint of the current device certificate.
While we have logic for this check, it currently isn't being used due to
[this line always returning
true](https://github.com/AzureAD/microsoft-authentication-library-common-for-android/blob/478f706bf412b3bcc754ec90152568cb23826670/common4j/src/main/com/microsoft/identity/common/java/challengehandlers/PKeyAuthChallenge.java#L148)
(go into the isValidIssuer method to see why).
Additionally, the thumbprint is (supposedly, based on me asking some
folks) hashed with SHA-1, and we're currently working to remove most of
our use of SHA-1. [The iOS team has already removed their thumbprint
verification
logic](AzureAD/microsoft-authentication-library-for-objc#871),
so we're going to do the same.
This PR removes the logic related to the PKeyAuth thumbprint. No
additions are being made.

### Related PRs
- Broker: AzureAD/ad-accounts-for-android#2290
- MSAL:
AzureAD/microsoft-authentication-library-for-android#1828
- ADAL:
AzureAD/azure-activedirectory-library-for-android#1733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants