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

Change Default Certificate Hashing Algorithm to SHA-256 #12365

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

hisanhunais
Copy link
Contributor

@hisanhunais hisanhunais commented Mar 25, 2024

Purpose

This PR changes the default certificate hashing algorithm to SHA-256 instead of SHA-1.

The following flows are affected due to this change.

  1. The certificate hashing algorithm used in generating API keys will now use SHA-256 as the hashing algorithm

  2. The certificate hashing algorithm used in generating backend JWTs for JWT and Opaque token SPs will now use SHA-256 as the default hashing algorithm. A config is provided to use SHA-1 as follows.

api-manager.xml.j2

<JWTConfiguration>
    ......
    <!-- Specifies whether to use SHA-1 algorithm to generate the certificate thumbprint -->
    <UseSHA1Hash>{{apim.jwt.use_sha1_hash}}</UseSHA1Hash>
    ......
</JWTConfiguration>

To use SHA-1 instead of SHA-256, the following has to be added to the deployment.toml.

deployment.toml

[apim.jwt]
enable = true
use_sha1_hash = false
  • The PR [1] has to be merged after merging this PR to fix the integration test failures

[1] wso2/product-apim#13455

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 41.62%. Comparing base (9471b04) to head (d2a9555).
Report is 11 commits behind head on master.

Files Patch % Lines
...apimgt/common/gateway/dto/JWTConfigurationDto.java 20.00% 4 Missing ⚠️
...o2/carbon/apimgt/impl/APIManagerConfiguration.java 0.00% 4 Missing ⚠️
...wtgenerator/AbstractAPIMgtGatewayJWTGenerator.java 0.00% 2 Missing ⚠️
...rbon/apimgt/keymgt/token/AbstractJWTGenerator.java 71.42% 2 Missing ⚠️
...so2/carbon/apimgt/common/gateway/util/JWTUtil.java 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12365      +/-   ##
============================================
+ Coverage     36.35%   41.62%   +5.26%     
- Complexity        0     3487    +3487     
============================================
  Files          1861     1867       +6     
  Lines        137447   137934     +487     
  Branches      19867    19940      +73     
============================================
+ Hits          49967    57411    +7444     
+ Misses        80977    73576    -7401     
- Partials       6503     6947     +444     
Flag Coverage Δ
integration_tests 35.10% <11.53%> (+7.11%) ⬆️
unit_tests 20.05% <38.46%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants