I encountered an issue while executing the following code:
assertions, err := sp.RetrieveAssertionInfo(samlResponse)
The code results in the following error:
error validating response: unable to create element from decrypted assertion bytes: flate: corrupt input before offset 1
Upon investigation, I found that the problem occurs because I receive a 16-byte block instead of the expected 8-byte block for the 3DES encryption method. This seems to be related to the encryption method handling in the DecryptSymmetricKey function.
Here’s the relevant code in the repository:
EncryptedKey.DecryptSymmetricKey
if MethodTripleDESCBC == ek.EncryptionMethod {
// Use 3DES cipher for 8-byte blocks
b, err := des.NewTripleDESCipher(pt)
if err != nil {
return nil, err
}
} else {
// Use AES cipher for 16-byte blocks
b, err := aes.NewCipher(pt)
if err != nil {
return nil, err
}
}
This change ensures proper decryption of TripleDES-encrypted assertions and avoids the "flate: corrupt input" error.
Would it be possible to include this fix in the library? Let me know if additional details or a pull request would be helpful.
I encountered an issue while executing the following code:
assertions, err := sp.RetrieveAssertionInfo(samlResponse)The code results in the following error:
error validating response: unable to create element from decrypted assertion bytes: flate: corrupt input before offset 1
Upon investigation, I found that the problem occurs because I receive a 16-byte block instead of the expected 8-byte block for the 3DES encryption method. This seems to be related to the encryption method handling in the DecryptSymmetricKey function.
Here’s the relevant code in the repository:
EncryptedKey.DecryptSymmetricKey
This change ensures proper decryption of TripleDES-encrypted assertions and avoids the "flate: corrupt input" error.
Would it be possible to include this fix in the library? Let me know if additional details or a pull request would be helpful.