[WSS4J] wss4j/src/org/apache/ws/security/message WSEncryptBody.java,1.28,1.29

[email protected] Tue, 03 Feb 2004 23:22:18 -0800
Newsgroups gmane.text.xml.wss4j
Message-ID <[email protected]>
Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12553/src/org/apache/ws/security/message

Modified Files:
	WSEncryptBody.java 
Log Message:
Same weak point as in WSSigneEnvelope - test for null and zero length.

Index: WSEncryptBody.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message/WSEncryptBody.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** WSEncryptBody.java	21 Jan 2004 13:21:37 -0000	1.28
--- WSEncryptBody.java	4 Feb 2004 07:22:15 -0000	1.29
***************
*** 343,347 ****
  		 */
  		X509Certificate remoteCert = null;
! 		remoteCert = crypto.getCertificates(user)[0];
  		if (tlog.isDebugEnabled()) {
  			t2 = System.currentTimeMillis();
--- 343,352 ----
  		 */
  		X509Certificate remoteCert = null;
! 		X509Certificate[] certs = crypto.getCertificates(user);
! 		if (certs == null || certs.length <= 0) {
! 			throw new WSSecurityException(WSSecurityException.FAILURE,
! 				"invalidX509Data", new Object[]{"for Encryption"});
! 		}
! 		remoteCert = certs[0];
  		if (tlog.isDebugEnabled()) {
  			t2 = System.currentTimeMillis();



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn