You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by we...@apache.org on 2004/03/21 19:00:39 UTC
cvs commit: ws-fx/wss4j/test/wssec TestWSSecurity4.java TestWSSecurity11.java TestWSSecurity.java PackageTests.java
werner 2004/03/21 10:00:39
Modified: wss4j/test/wssec TestWSSecurity4.java TestWSSecurity11.java
TestWSSecurity.java PackageTests.java
Log:
Disable tests that would test disabaled WSS4J functions that would
introduce some security risks.
Revision Changes Path
1.3 +37 -37 ws-fx/wss4j/test/wssec/TestWSSecurity4.java
Index: TestWSSecurity4.java
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/test/wssec/TestWSSecurity4.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestWSSecurity4.java 29 Feb 2004 12:32:22 -0000 1.2
+++ TestWSSecurity4.java 21 Mar 2004 18:00:39 -0000 1.3
@@ -121,31 +121,31 @@
*
* @throws java.lang.Exception Thrown when there is any problem in signing or verification
*/
- public void testX509SignatureSKIDirect() throws Exception {
- SOAPEnvelope envelope = null;
- WSSignEnvelope builder = new WSSignEnvelope();
- builder.setUserInfo("wss4jcert", "security");
- builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
-
- // builder.setUserInfo("john", "keypass");
- log.info("Before Signing....");
- Document doc = unsignedEnvelope.getAsDocument();
- Document signedDoc = builder.build(doc, crypto);
-
- /*
- * convert the resulting document into a message first. The toSOAPMessage()
- * mehtod performs the necessary c14n call to properly set up the signed
- * document and convert it into a SOAP message. After that we extract it
- * as a document again for further processing.
- */
-
- Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
- XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
-
- signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
- log.info("After Signing....");
- verify(signedDoc);
- }
+// public void testX509SignatureSKIDirect() throws Exception {
+// SOAPEnvelope envelope = null;
+// WSSignEnvelope builder = new WSSignEnvelope();
+// builder.setUserInfo("wss4jcert", "security");
+// builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
+//
+// // builder.setUserInfo("john", "keypass");
+// log.info("Before Signing....");
+// Document doc = unsignedEnvelope.getAsDocument();
+// Document signedDoc = builder.build(doc, crypto);
+//
+// /*
+// * convert the resulting document into a message first. The toSOAPMessage()
+// * mehtod performs the necessary c14n call to properly set up the signed
+// * document and convert it into a SOAP message. After that we extract it
+// * as a document again for further processing.
+// */
+//
+// Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
+// XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
+//
+// signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
+// log.info("After Signing....");
+// verify(signedDoc);
+// }
/**
* Test that signs (twice) and verifies a WS-Security envelope
@@ -153,18 +153,18 @@
*
* @throws java.lang.Exception Thrown when there is any problem in signing or verification
*/
- public void testDoubleX509SignatureSKIDirect() throws Exception {
- SOAPEnvelope envelope = null;
- WSSignEnvelope builder = new WSSignEnvelope();
- builder.setUserInfo("wss4jcert", "security");
- builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
-
- // builder.setUserInfo("john", "keypass");
- Document doc = unsignedEnvelope.getAsDocument();
- Document signedDoc = builder.build(doc, crypto);
- Document signedDoc1 = builder.build(signedDoc, crypto);
- verify(signedDoc1);
- }
+// public void testDoubleX509SignatureSKIDirect() throws Exception {
+// SOAPEnvelope envelope = null;
+// WSSignEnvelope builder = new WSSignEnvelope();
+// builder.setUserInfo("wss4jcert", "security");
+// builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
+//
+// // builder.setUserInfo("john", "keypass");
+// Document doc = unsignedEnvelope.getAsDocument();
+// Document signedDoc = builder.build(doc, crypto);
+// Document signedDoc1 = builder.build(signedDoc, crypto);
+// verify(signedDoc1);
+// }
/**
* Verifies the soap envelope
1.3 +82 -82 ws-fx/wss4j/test/wssec/TestWSSecurity11.java
Index: TestWSSecurity11.java
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/test/wssec/TestWSSecurity11.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestWSSecurity11.java 29 Feb 2004 12:32:22 -0000 1.2
+++ TestWSSecurity11.java 21 Mar 2004 18:00:39 -0000 1.3
@@ -184,47 +184,47 @@
*
* @throws java.lang.Exception Thrown when there is any problem in signing or verification
*/
- public void testX509SignatureISDirectSTR() throws Exception {
- SOAPEnvelope envelope = null;
- WSSignEnvelope builder = new WSSignEnvelope();
- builder.setUserInfo("wss4jcert", "security");
- // builder.setUserInfo("john", "keypass");
- SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(unsignedEnvelope);
- Vector parts = new Vector();
-
- /*
- * Set up to sign body and use STRTransorm to sign
- * the signature token (e.g. X.509 certificate)
- */
- WSEncryptionPart encP =
- new WSEncryptionPart(
- soapConstants.getBodyQName().getLocalPart(), // define the body
- soapConstants.getEnvelopeURI(),
- "Content");
- parts.add(encP);
- encP =
- new WSEncryptionPart(
- "STRTransform", // reserved word to use STRTransform
- soapConstants.getEnvelopeURI(),
- "Content");
- parts.add(encP);
-
- builder.setParts(parts);
- builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL_DIRECT);
-
- log.info("Before Signing STR ISDirect....");
- Document doc = unsignedEnvelope.getAsDocument();
- Document signedDoc = builder.build(doc, crypto);
-
- Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
- if (log.isDebugEnabled()) {
- log.debug("Signed message with STR IssuerSerialDirect key identifier:");
- XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
- }
- signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
- log.info("After Signing STR ISDirect....");
- verify(signedDoc);
- }
+// public void testX509SignatureISDirectSTR() throws Exception {
+// SOAPEnvelope envelope = null;
+// WSSignEnvelope builder = new WSSignEnvelope();
+// builder.setUserInfo("wss4jcert", "security");
+// // builder.setUserInfo("john", "keypass");
+// SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(unsignedEnvelope);
+// Vector parts = new Vector();
+//
+// /*
+// * Set up to sign body and use STRTransorm to sign
+// * the signature token (e.g. X.509 certificate)
+// */
+// WSEncryptionPart encP =
+// new WSEncryptionPart(
+// soapConstants.getBodyQName().getLocalPart(), // define the body
+// soapConstants.getEnvelopeURI(),
+// "Content");
+// parts.add(encP);
+// encP =
+// new WSEncryptionPart(
+// "STRTransform", // reserved word to use STRTransform
+// soapConstants.getEnvelopeURI(),
+// "Content");
+// parts.add(encP);
+//
+// builder.setParts(parts);
+// builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL_DIRECT);
+//
+// log.info("Before Signing STR ISDirect....");
+// Document doc = unsignedEnvelope.getAsDocument();
+// Document signedDoc = builder.build(doc, crypto);
+//
+// Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
+// if (log.isDebugEnabled()) {
+// log.debug("Signed message with STR IssuerSerialDirect key identifier:");
+// XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
+// }
+// signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
+// log.info("After Signing STR ISDirect....");
+// verify(signedDoc);
+// }
/**
* Test that signs and verifies a WS-Security envelope.
@@ -342,47 +342,47 @@
*/
- public void testX509SignatureSKIDirectSTR() throws Exception {
- SOAPEnvelope envelope = null;
- WSSignEnvelope builder = new WSSignEnvelope();
- builder.setUserInfo("wss4jcert", "security");
- // builder.setUserInfo("john", "keypass");
- SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(unsignedEnvelope);
- Vector parts = new Vector();
-
- /*
- * Set up to sign body and use STRTransorm to sign
- * the signature token (e.g. X.509 certificate)
- */
- WSEncryptionPart encP =
- new WSEncryptionPart(
- soapConstants.getBodyQName().getLocalPart(), // define the body
- soapConstants.getEnvelopeURI(),
- "Content");
- parts.add(encP);
- encP =
- new WSEncryptionPart(
- "STRTransform", // reserved word to use STRTransform
- soapConstants.getEnvelopeURI(),
- "Content");
- parts.add(encP);
-
- builder.setParts(parts);
- builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
-
- log.info("Before Signing STR SKIDirect....");
- Document doc = unsignedEnvelope.getAsDocument();
- Document signedDoc = builder.build(doc, crypto);
-
- Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
- if (log.isDebugEnabled()) {
- log.debug("Signed message with STR SKIDirect key identifier:");
- XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
- }
- signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
- log.info("After Signing STR SKIDirect....");
- verify(signedDoc);
- }
+// public void testX509SignatureSKIDirectSTR() throws Exception {
+// SOAPEnvelope envelope = null;
+// WSSignEnvelope builder = new WSSignEnvelope();
+// builder.setUserInfo("wss4jcert", "security");
+// // builder.setUserInfo("john", "keypass");
+// SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(unsignedEnvelope);
+// Vector parts = new Vector();
+//
+// /*
+// * Set up to sign body and use STRTransorm to sign
+// * the signature token (e.g. X.509 certificate)
+// */
+// WSEncryptionPart encP =
+// new WSEncryptionPart(
+// soapConstants.getBodyQName().getLocalPart(), // define the body
+// soapConstants.getEnvelopeURI(),
+// "Content");
+// parts.add(encP);
+// encP =
+// new WSEncryptionPart(
+// "STRTransform", // reserved word to use STRTransform
+// soapConstants.getEnvelopeURI(),
+// "Content");
+// parts.add(encP);
+//
+// builder.setParts(parts);
+// builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER_DIRECT);
+//
+// log.info("Before Signing STR SKIDirect....");
+// Document doc = unsignedEnvelope.getAsDocument();
+// Document signedDoc = builder.build(doc, crypto);
+//
+// Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
+// if (log.isDebugEnabled()) {
+// log.debug("Signed message with STR SKIDirect key identifier:");
+// XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
+// }
+// signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
+// log.info("After Signing STR SKIDirect....");
+// verify(signedDoc);
+// }
/**
1.4 +19 -19 ws-fx/wss4j/test/wssec/TestWSSecurity.java
Index: TestWSSecurity.java
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/test/wssec/TestWSSecurity.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestWSSecurity.java 7 Mar 2004 10:36:44 -0000 1.3
+++ TestWSSecurity.java 21 Mar 2004 18:00:39 -0000 1.4
@@ -157,25 +157,25 @@
*
* @throws java.lang.Exception Thrown when there is any problem in signing or verification
*/
- public void testX509SignatureISDirect() throws Exception {
- SOAPEnvelope envelope = null;
- WSSignEnvelope builder = new WSSignEnvelope();
- builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
- builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL_DIRECT);
- // builder.setUserInfo("john", "keypass");
- log.info("Before Signing ISDirect....");
- Document doc = unsignedEnvelope.getAsDocument();
- Document signedDoc = builder.build(doc, crypto);
-
- Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
- if (log.isDebugEnabled()) {
- log.debug("Signed message with IssuerSerialDirect key identifier:");
- XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
- }
- signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
- log.info("After Signing ISDirect....");
- verify(signedDoc);
- }
+// public void testX509SignatureISDirect() throws Exception {
+// SOAPEnvelope envelope = null;
+// WSSignEnvelope builder = new WSSignEnvelope();
+// builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
+// builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL_DIRECT);
+// // builder.setUserInfo("john", "keypass");
+// log.info("Before Signing ISDirect....");
+// Document doc = unsignedEnvelope.getAsDocument();
+// Document signedDoc = builder.build(doc, crypto);
+//
+// Message signedMsg = (Message) AxisUtil.toSOAPMessage(signedDoc);
+// if (log.isDebugEnabled()) {
+// log.debug("Signed message with IssuerSerialDirect key identifier:");
+// XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
+// }
+// signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
+// log.info("After Signing ISDirect....");
+// verify(signedDoc);
+// }
/**
* Test that signs (twice) and verifies a WS-Security envelope.
1.4 +1 -1 ws-fx/wss4j/test/wssec/PackageTests.java
Index: PackageTests.java
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/test/wssec/PackageTests.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PackageTests.java 29 Feb 2004 12:48:02 -0000 1.3
+++ PackageTests.java 21 Mar 2004 18:00:39 -0000 1.4
@@ -53,7 +53,7 @@
suite.addTestSuite(TestWSSecurity.class);
suite.addTestSuite(TestWSSecurity2.class);
suite.addTestSuite(TestWSSecurity3.class);
- suite.addTestSuite(TestWSSecurity4.class);
+// suite.addTestSuite(TestWSSecurity4.class);
suite.addTestSuite(TestWSSecurity5.class);
suite.addTestSuite(TestWSSecurity6.class);
suite.addTestSuite(TestWSSecurity7.class);