Bug 46732 - Failed to add more than one child element to EncryptionMethod.
Summary: Failed to add more than one child element to EncryptionMethod.
Status: RESOLVED FIXED
Alias: None
Product: Security - Now in JIRA
Classification: Unclassified
Component: Encryption (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 major
Target Milestone: ---
Assignee: XML Security Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 00:45 UTC by Natallia
Modified: 2009-02-19 08:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natallia 2009-02-19 00:45:54 UTC
According to the w3c EncryptionMethod element schema the number of parameters (child elements) is unbounded. 

http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sec-EncryptionMethod

While org.apache.xml.security.encryption.XMLCipher.Factory.EncryptionMethodImpl implementation places into Element only ONE parameter from the encryptionMethodInformation List.

org.apache.xml.security.encryption.XMLCipher.Factory.EncryptionMethodImpl {

           private List encryptionMethodInformation = null;
           ...
           Element toElement() {
           ...
               if (!encryptionMethodInformation.isEmpty()) {
                   Iterator itr = encryptionMethodInformation.iterator();
                   result.appendChild((Element) itr.next());
               }

               return (result);
           }
       }
}
Comment 1 sean.mullan 2009-02-19 08:14:59 UTC
Fixed. Normally I add a test case but this fix seemed very low risk. However, if you have a test case, please send it to me and I will incorporate it.