Added code to have support for multiple SAML response encryption algorithms.#253
Added code to have support for multiple SAML response encryption algorithms.#253ebsi-pjoshi wants to merge 2 commits into
Conversation
|
@Revsgaard please review |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for multiple SAML response encryption algorithms by introducing new encryption algorithm constants, validation logic, and configuration options. The changes allow users to specify different encryption algorithms instead of being limited to the hardcoded AES256.
- Added comprehensive set of encryption algorithm constants for various AES modes and key sizes
- Introduced encryption algorithm validation with specific error handling for unsupported algorithms
- Updated the encryption process to use configurable algorithms instead of hardcoded AES256
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Saml2EncryptionAlgorithms.cs | New file defining encryption algorithm URL constants for AES, RSA, and SHA variants |
| Saml2AuthnResponse.cs | Added encryption algorithm property and validation call during message encryption |
| Saml2EncryptedXml.cs | Modified encryption method to accept algorithm parameter and set appropriate key sizes |
| EncryptionAlgorithm.cs | New validation class that checks algorithm support and throws specific errors |
| Saml2Configuration.cs | Added EncryptionAlgorithm property with AES256 as default |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| else if (encryptionAlgorithm.Equals(Saml2EncryptionAlgorithms.XmlEncSHA256Url, StringComparison.InvariantCulture)) | ||
| { | ||
| return; | ||
| } | ||
| else if (encryptionAlgorithm.Equals(Saml2EncryptionAlgorithms.XmlEncSHA512Url, StringComparison.InvariantCulture)) | ||
| { | ||
| return; | ||
| } |
There was a problem hiding this comment.
The validation allows SHA256 and SHA512 algorithms to pass as valid encryption methods, but these are message digest algorithms, not encryption algorithms. They should not be accepted for SAML assertion encryption.
| else if (encryptionAlgorithm.Equals(Saml2EncryptionAlgorithms.XmlEncSHA256Url, StringComparison.InvariantCulture)) | |
| { | |
| return; | |
| } | |
| else if (encryptionAlgorithm.Equals(Saml2EncryptionAlgorithms.XmlEncSHA512Url, StringComparison.InvariantCulture)) | |
| { | |
| return; | |
| } |
…ports only 128, 192 and 256.
No description provided.