|
From: <bob...@us...> - 2003-12-15 09:51:38
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv20508/src/hk/hku/cecid/phoenix/message/packaging
Modified Files:
EbxmlMessage.java PKISignatureImpl.java
Log Message:
Take out soap envelope parsing logic from
Message.getMessageFromDataSource() to form
another method parseSoapEnvelopeOnly().
Change Http.send() to return a EbxmlMessage rather than a soap message
Store the byte array of soap envelope when received my Http and Mail,
and also change the signature verification logic to read those byte array.
It will fix the bug on signature verification of a non "soap-env" namespace
message received from Sync Reply channel.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** EbxmlMessage.java 11 Dec 2003 06:41:29 -0000 1.39
--- EbxmlMessage.java 15 Dec 2003 09:51:34 -0000 1.40
***************
*** 182,185 ****
--- 182,187 ----
private int soapMessageLength;
+
+ private byte[] soapEnvelopeBytes = null;
/**
***************
*** 1578,1581 ****
--- 1580,1598 ----
public String getFileName() {
return filename;
+ }
+
+ /**
+ * Get the soap envelope in bytes
+ */
+ public byte[] getSoapEnvelopeBytes() {
+ return soapEnvelopeBytes;
+ }
+
+ /**
+ * set the soap envelope in bytes. This bytes will be used to verify
+ * the signature.
+ */
+ public void setSoapEnvelopeBytes(byte[] soapEnvelopeBytes) {
+ this.soapEnvelopeBytes = soapEnvelopeBytes;
}
}
Index: PKISignatureImpl.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/PKISignatureImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PKISignatureImpl.java 11 Dec 2003 06:41:29 -0000 1.12
--- PKISignatureImpl.java 15 Dec 2003 09:51:35 -0000 1.13
***************
*** 255,259 ****
ByteArrayOutputStream baos = new ByteArrayOutputStream();
String fileName = ebxmlMessage.getFileName();
! if (fileName != null) {
FileInputStream fis = new FileInputStream(fileName);
int skipped = ebxmlMessage.getSOAPMessageFileOffset()[0];
--- 255,262 ----
ByteArrayOutputStream baos = new ByteArrayOutputStream();
String fileName = ebxmlMessage.getFileName();
! byte[] soapEnvelopeBytes = ebxmlMessage.getSoapEnvelopeBytes();
! if (soapEnvelopeBytes != null) {
! baos.write(soapEnvelopeBytes);
! } else if (fileName != null) {
FileInputStream fis = new FileInputStream(fileName);
int skipped = ebxmlMessage.getSOAPMessageFileOffset()[0];
|