feat: configurable encryption algorithm types #924
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The feature or problem addressed by this PR
Encrypt assertion session key and transport key algorithms were hardcoded.
closes: #821
What your changes do and why you chose this solution
Added
encrypt_assertion_session_key_algs
andencrypt_assertion_cert_key_algs
configuration options to specify algorithms which can be used for encrypting assertions. Both of them are lists and index represents algorithm priority (first one has highest priority).When there is not cert prvided in parameters program will try to find one in metadata. Keys in metadata are prioritized in following order.
use=encryption
and specifiedEncryptionMethods
use=encryption
use=encryption
If key has
EncryptionMethods
program will make intersect with configuration options and will take algorithms by its priority. If intersect is empty or there is notEncryptionMethod
program will use first ones from config options.Added paramters and their propagation to
Server.create_authn_response
specifying session key and transport key algorithms forencrypt_cert_advice
andencrypt_cert_assertion
. If they are not provided program will use first ones from new config options.For support
http://www.w3.org/2009/xmlenc11#rsa-oaep
transport key alg withMGF1
xmlsec version>=1.3.0
is required.Checklist