You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2024/04/05 06:34:00 UTC

[jira] [Commented] (SANTUARIO-616) ClassCastException regression in XMLCipher related to new AgreementMethod support

    [ https://issues.apache.org/jira/browse/SANTUARIO-616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834153#comment-17834153 ] 

Colm O hEigeartaigh commented on SANTUARIO-616:
-----------------------------------------------

[~jrihtarsic]  can you take a look please?

> ClassCastException regression in XMLCipher related to new AgreementMethod support
> ---------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-616
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-616
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 3.0.4, Java 4.0.2
>         Environment: Java 17
>            Reporter: Brent Putman
>            Assignee: Colm O hEigeartaigh
>            Priority: Major
>
> The 3.0.4 release (and I assume also the corresponding 4.0.x release, but I can't test that) introduced a regression in  {{XMLCipher}} related to the new support for ECDH and {{{}AgreementMethod{}}}.
> The code in {{XMLCipher#getAlgorithmParameters(EncryptedKey)}} seems to implicitly assume that if there are {{AgreementMethod}} elements present in the KeyInfo, that it needs to actually "do" key agreement, so it unconditionally casts the supplied input {{Key}} to {{PrivateKey}} (assuming it is an {{{}ECPrivateKey{}}}, for example).
> This assumption doesn't hold, because the caller may have already performed the key agreement op independently on the {{KeyInfo}} data, and has inited {{XMLCipher}} with the resulting {{{}SecretKey{}}}. OpenSAML implemented ECDH (and DH classic) support several years ago using this approach.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)