Skip to content

feat: add PKCS#1 v1.5 padding to support PKCS#7 signing#291

Open
dallasd1 wants to merge 2 commits intoAzure:mainfrom
dallasd1:dadelan/pkcs1-signing-scheme
Open

feat: add PKCS#1 v1.5 padding to support PKCS#7 signing#291
dallasd1 wants to merge 2 commits intoAzure:mainfrom
dallasd1:dadelan/pkcs1-signing-scheme

Conversation

@dallasd1
Copy link

@dallasd1 dallasd1 commented Mar 16, 2026

Add RSA PKCS#1 v1.5 signature algorithm support alongside the existing PSS algorithms. This is required for dm-verity kernel signature verification which expects PKCS#1 v1.5 signature padding. The signing scheme is now selected using the signing_scheme plugin config key. AKV already supports PKCS#1 v1.5 so this change adds the option to select it from the plugin.

Add RSA PKCS#1 v1.5 signature algorithm support (RS256, RS384, RS512)
alongside the existing PSS algorithms. This is required for dm-verity
kernel signature verification which expects PKCS#1 v1.5 signatures.

Changes:
- Add PKCS1 key spec variants to Protocol/KeySpec.cs
- Extend KeySpecExtension to map PKCS1 specs to Azure Key Vault algorithms
- Update GenerateSignature to select the correct signing scheme
- Add unit tests for new key specs and algorithm mappings

Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 91.52542% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.87%. Comparing base (3396292) to head (d382135).

Files with missing lines Patch % Lines
....Plugin.AzureKeyVault/KeyVault/KeySpecExtension.cs 92.59% 1 Missing and 1 partial ⚠️
Notation.Plugin.AzureKeyVault/Protocol/KeySpec.cs 92.59% 1 Missing and 1 partial ⚠️
....Plugin.AzureKeyVault/Command/GenerateSignature.cs 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   93.03%   92.87%   -0.16%     
==========================================
  Files          17       17              
  Lines         617      674      +57     
  Branches       78       87       +9     
==========================================
+ Hits          574      626      +52     
- Misses         31       33       +2     
- Partials       12       15       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Improve CI patch coverage for tests to get over 80%
Add tests for all RSA key sizes (2048/3072/4096) and EC key sizes (256/384/521) through the PKCS1 code paths.
Add tests for empty string and rsassa-pss scheme routing.
Add direct tests for ToKeyVaultSignatureAlgorithmPKCS1 and ToSigningAlgorithmPKCS1.
Fix trailing whitespace in KeySpec.cs.

Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
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.

1 participant