Skip to content

Commit

Permalink
allow change assertion encrypt algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
yvgenycyolo committed Jun 20, 2024
1 parent a32b643 commit c3d51ea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type IdentityProvider struct {
SessionProvider SessionProvider
AssertionMaker AssertionMaker
SignatureMethod string
AssertionDigestMethod *xmlenc.DigestMethod
ValidDuration *time.Duration
}

Expand Down Expand Up @@ -867,7 +868,13 @@ func (req *IdpAuthnRequest) MakeAssertionEl() error {

encryptor := xmlenc.OAEP()
encryptor.BlockCipher = xmlenc.AES128CBC
encryptor.DigestMethod = &xmlenc.SHA1
// Default to using SHA1 if the signature method isn't set.
if req.IDP.AssertionDigestMethod == nil {
encryptor.DigestMethod = &xmlenc.SHA1
} else {
encryptor.DigestMethod = *req.IDP.AssertionDigestMethod
}

encryptedDataEl, err := encryptor.Encrypt(certBuf, signedAssertionBuf, nil)
if err != nil {
return err
Expand Down

0 comments on commit c3d51ea

Please sign in to comment.