You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Pelle B. <pe...@us...> - 2004-03-21 00:58:40
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2857/src/java/org/neuclear/ledger/servlets Modified Files: LedgerServlet.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: LedgerServlet.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/servlets/LedgerServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LedgerServlet.java 2 Jan 2004 23:18:34 -0000 1.3 --- LedgerServlet.java 21 Mar 2004 00:48:36 -0000 1.4 *************** *** 4,17 **** import org.neuclear.commons.servlets.ServletTools; import org.neuclear.commons.sql.JNDIConnectionSource; - import org.neuclear.commons.sql.statements.StatementFactory; import org.neuclear.commons.sql.statements.SimpleStatementFactory; import org.neuclear.commons.time.TimeTools; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NSTools; import org.neuclear.ledger.LowlevelLedgerException; - import org.neuclear.ledger.UnknownBookException; - import org.neuclear.ledger.PopulateLedger; import org.neuclear.ledger.browser.BookBrowser; ! import org.neuclear.ledger.implementations.SQLLedger; import javax.servlet.ServletConfig; --- 4,15 ---- import org.neuclear.commons.servlets.ServletTools; import org.neuclear.commons.sql.JNDIConnectionSource; import org.neuclear.commons.sql.statements.SimpleStatementFactory; + import org.neuclear.commons.sql.statements.StatementFactory; import org.neuclear.commons.time.TimeTools; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NSTools; import org.neuclear.ledger.LowlevelLedgerException; import org.neuclear.ledger.browser.BookBrowser; ! import org.neuclear.ledger.browser.LedgerBrowser; import javax.servlet.ServletConfig; *************** *** 46,49 **** --- 44,50 ---- $Id$ $Log$ + Revision 1.4 2004/03/21 00:48:36 pelle + The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + Revision 1.3 2004/01/02 23:18:34 pelle Added StatementFactory pattern and refactored the ledger to use it. *************** *** 65,78 **** public class LedgerServlet extends HttpServlet { public void init(ServletConfig config) throws ServletException { ! datasource = ServletTools.getInitParam("datasource",config); ! serviceid = ServletTools.getInitParam("serviceid",config); try { fact = new SimpleStatementFactory(new JNDIConnectionSource(datasource)); ! ledger= new SQLLedger( ! fact, ! serviceid ! ); ! if (!ledger.bookExists("neu://alice@test")) ! PopulateLedger.main(null); } catch (Exception e) { throw new ServletException(e); --- 66,79 ---- public class LedgerServlet extends HttpServlet { public void init(ServletConfig config) throws ServletException { ! datasource = ServletTools.getInitParam("datasource", config); ! serviceid = ServletTools.getInitParam("serviceid", config); try { fact = new SimpleStatementFactory(new JNDIConnectionSource(datasource)); ! // ledger= new SQLLedger( ! // fact, ! // serviceid ! // ); ! // if (!ledger.bookExists("neu://alice@test")) ! // PopulateLedger.main(null); } catch (Exception e) { throw new ServletException(e); *************** *** 83,102 **** protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); ! PrintWriter out=response.getWriter(); ! ServletTools.printHeader(out,request,"Account Browser"); ! String url=ServletTools.getAbsoluteURL(request,request.getServletPath()); try { ! Principal user=request.getUserPrincipal(); ! String book=request.getPathInfo(); if (Utility.isEmpty(book)) ! book=serviceid; else ! book="neu:/"+book; ! BookBrowser stmt=ledger.browse(ledger.getBook(book)); out.println("<table><tr><th>Transaction ID</th><th>Time</th><th>Counterparty</th><th>Comment</th><th>Amount</th></tr>"); ! while(stmt.next()){ final BigDecimal amount = stmt.getAmount(); out.print("<tr"); ! if (amount.compareTo(ZERO)<0) out.print(" class=\"negative\""); out.print("><td style=\"size:small\">"); --- 84,103 ---- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); ! PrintWriter out = response.getWriter(); ! ServletTools.printHeader(out, request, "Account Browser"); ! String url = ServletTools.getAbsoluteURL(request, request.getServletPath()); try { ! Principal user = request.getUserPrincipal(); ! String book = request.getPathInfo(); if (Utility.isEmpty(book)) ! book = serviceid; else ! book = "neu:/" + book; ! BookBrowser stmt = ledger.browse(book); out.println("<table><tr><th>Transaction ID</th><th>Time</th><th>Counterparty</th><th>Comment</th><th>Amount</th></tr>"); ! while (stmt.next()) { final BigDecimal amount = stmt.getAmount(); out.print("<tr"); ! if (amount.compareTo(ZERO) < 0) out.print(" class=\"negative\""); out.print("><td style=\"size:small\">"); *************** *** 109,113 **** out.print(NSTools.name2path(stmt.getCounterparty())); else ! out.print("/"+stmt.getCounterparty()); out.println("\">"); out.print(stmt.getCounterparty()); --- 110,114 ---- out.print(NSTools.name2path(stmt.getCounterparty())); else ! out.print("/" + stmt.getCounterparty()); out.println("\">"); out.print(stmt.getCounterparty()); *************** *** 122,136 **** } catch (InvalidNamedObjectException e) { e.printStackTrace(); - } catch (UnknownBookException e) { - e.printStackTrace(); } catch (LowlevelLedgerException e) { e.printStackTrace(); } } private DataSource ds; private String datasource; private String serviceid; ! private static final BigDecimal ZERO=new BigDecimal(0); ! private SQLLedger ledger; private StatementFactory fact; } --- 123,136 ---- } catch (InvalidNamedObjectException e) { e.printStackTrace(); } catch (LowlevelLedgerException e) { e.printStackTrace(); } } + private DataSource ds; private String datasource; private String serviceid; ! private static final BigDecimal ZERO = new BigDecimal(0); ! private LedgerBrowser ledger; private StatementFactory fact; } |
|
From: Pelle B. <pe...@us...> - 2004-03-21 00:58:40
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/implementations In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2857/src/java/org/neuclear/ledger/implementations Removed Files: SQLLedger.java SimpleLedger.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. --- SimpleLedger.java DELETED --- --- SQLLedger.java DELETED --- |
|
From: <bug...@ve...> - 2004-03-21 00:24:51
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-19 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-19 Summary: Hibernate Ledger Implementation Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: SQL Ledger Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Sat, 20 Mar 2004 4:23 PM Updated: Sat, 20 Mar 2004 4:23 PM Description: New implementation needed in Hibernate. This should implement a BrowsableLedger as well for use in Web report generators. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-21 00:22:36
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-18 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-18 Summary: CancelHeld and CompleteHeld not working in Prevalent Ledger Type: Bug Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: Prevalent Ledger Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Sat, 20 Mar 2004 4:22 PM Updated: Sat, 20 Mar 2004 4:22 PM Description: Cancel doesnt seem to do anything. Complete is incomplete. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-21 00:22:36
|
Message: Work on this issue has been started by Pelle Braendgaard (mailto:pe...@ve...) --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/GL-18 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-18 Summary: CancelHeld and CompleteHeld not working in Prevalent Ledger Type: Bug Status: In Progress Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Components: Prevalent Ledger Versions: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Sat, 20 Mar 2004 4:22 PM Updated: Sat, 20 Mar 2004 4:22 PM Description: Cancel doesnt seem to do anything. Complete is incomplete. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-21 00:20:35
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Sat, 20 Mar 2004 4:20 PM
This has been added in a seperate neuclear-ledger-prevalent model.
Further unit testing is necessary.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/GL-4
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GL-4
Summary: High speed prevalent ledger implementation.
Type: New Feature
Status: Closed
Priority: Minor
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Ledger
Components:
Prevalent Ledger
Fix Fors:
r_0_4
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Wed, 16 Jul 2003 6:21 PM
Updated: Sat, 20 Mar 2004 4:20 PM
Description:
This implementation of the ledger will only support transactions and balances. There will be no history of transactions available.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2004-03-20 23:42:38
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Sat, 20 Mar 2004 3:41 PM
This has been fixed. It was due to a problem in the XPath Transform
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/XMLSIG-6
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XMLSIG-6
Summary: SimpleXMLSigTest fails on Enveloped signatures
Type: Bug
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear XMLSig
Fix Fors:
0.12
Versions:
0.12
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Thu, 11 Mar 2004 3:37 PM
Updated: Sat, 20 Mar 2004 3:41 PM
Description:
/opt/blackdown-jdk-1.4.1/bin/java -Xdebug -Xnoagent -Djava.compiler=3DNONE =
-Xrunjdwp:transport=3Ddt_socket,server=3Dy,suspend=3Dn,address=3D5005 -Dfil=
e.encoding=3DUS-ASCII -classpath /opt/blackdown-jdk-1.4.1/jre/lib/jsse.jar:=
/opt/blackdown-jdk-1.4.1/jre/lib/sunrsasign.jar:/opt/blackdown-jdk-1.4.1/jr=
e/lib/charsets.jar:/opt/blackdown-jdk-1.4.1/jre/lib/javaplugin.jar:/opt/bla=
ckdown-jdk-1.4.1/jre/lib/rt.jar:/opt/blackdown-jdk-1.4.1/jre/lib/jce.jar:/o=
pt/blackdown-jdk-1.4.1/jre/lib/ext/dnsns.jar:/opt/blackdown-jdk-1.4.1/jre/l=
ib/ext/mysql-connector-java-3.0.8-stable-bin.jar:/opt/blackdown-jdk-1.4.1/j=
re/lib/ext/sunjce_provider.jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/ldapsec=
.jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/localedata.jar:/home/pelleb/code/=
neuclear-xmlsig/target/test-classes:/home/pelleb/code/neuclear-xmlsig/targe=
t/classes:/usr/share/dom4j/lib/dom4j-1.4.jar:/opt/crypto-120/jars/bcprov-jd=
k14-120.jar:/home/pelleb/.maven/repository/servletapi/jars/servletapi-2.3.j=
ar:/home/pelleb/.maven/repository/junit/jars/junit-3.8.1.jar:/home/pelleb/c=
ode/neuclear-commons/target/test-classes:/home/pelleb/code/neuclear-commons=
/target/classes:/opt/hsqldb/lib/hsqldb.jar:/opt/jotm-1.4.3/lib/jotm.jar:/op=
t/jotm-1.4.3/lib/jta-spec1_0_1.jar:/opt/jotm-1.4.3/lib/carol.jar:/opt/jotm-=
1.4.3/lib/jotm_jrmp_stubs.jar:/opt/jotm-1.4.3/lib/jts1_0.jar:/opt/jotm-1.4.=
3/lib/objectweb-datasource.jar:/opt/jotm-1.4.3/lib/xapool.jar:/home/pelleb/=
.maven/repository/jline/jars/jline-0.8.1.jar:/opt/mysql-connector-java-3.1.=
0-alpha/mysql-connector-java-3.1.0-alpha-bin.jar:/home/pelleb/.maven/reposi=
tory/picocontainer/jars/picocontainer-1.0-beta-3.jar:/opt/jakarta-cactus-13=
-1.5/lib/cactus-1.5.jar:/opt/jakarta-cactus-13-1.5/lib/commons-httpclient-2=
.0-rc2.jar:/opt/jakarta-cactus-13-1.5/lib/httpunit-1.5.3.jar:/opt/jakarta-c=
actus-13-1.5/lib/aspectjrt-1.1.1.jar:/opt/jakarta-cactus-13-1.5/lib/nekohtm=
l-0.7.4.jar:/home/pelleb/code/waterken/jar/URL/safe/url.jar:/opt/idea/Intel=
liJ-IDEA-4.0/lib/idea_rt.jar:/opt/idea/IntelliJ-IDEA-4.0/lib/idea_rt.jar -D=
idea.launcher.port=3D7532 -Didea.launcher.library=3D/opt/idea/IntelliJ-IDEA=
-4.0/bin/libbreakgen.so com.intellij.rt.execution.application.AppMain com.i=
ntellij.rt.execution.junit2.JUnitStarter -ideVersion5 org.neuclear.xml.xmls=
ec.SimpleXMLSigTest
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
AlwaysTheSamePassphraseAgent started.
DO NOT USE FOR PRODUCTION SERVERS
Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@163 didnt sign th=
is signature
junit.framework.AssertionFailedError: Test if Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignRSAKeyPair=
(SimpleXMLSigTest.java:145)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@fffffe5e didnt si=
gn this signature
junit.framework.AssertionFailedError: Test if DSA Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignDSAKeyPair=
(SimpleXMLSigTest.java:178)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
junit.framework.AssertionFailedError: Test if Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadRSASignature(SimpleXM=
LSigTest.java:186)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
junit.framework.AssertionFailedError: Test if DSA Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadDSASignature(SimpleXM=
LSigTest.java:197)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi=
s signature
junit.framework.AssertionFailedError: Test if Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsingSigner(Sim=
pleXMLSigTest.java:209)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi=
s signature
junit.framework.AssertionFailedError: Test if Signature is valid
=09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testComplexEnvelopedUsingSig=
ner(SimpleXMLSigTest.java:229)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.=
java:39)
=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces=
sorImpl.java:25)
=09at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: Pelle B. <pe...@us...> - 2004-03-20 17:30:10
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19634/src/test/org/neuclear/id Modified Files: IdentityTests.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: IdentityTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/IdentityTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IdentityTests.java 8 Mar 2004 23:51:11 -0000 1.6 --- IdentityTests.java 20 Mar 2004 17:19:55 -0000 1.7 *************** *** 12,15 **** --- 12,16 ---- import org.neuclear.id.verifier.VerifyingReader; import org.neuclear.tests.AbstractObjectCreationTest; + import org.neuclear.xml.xmlsec.EnvelopedSignature; import org.neuclear.xml.xmlsec.XMLSecurityException; import org.neuclear.xml.xmlsec.XMLSignature; *************** *** 53,58 **** --- 54,64 ---- public void testAnonymous() throws NoSuchAlgorithmException { + <<<<<<< IdentityTests.java + KeyPair kp = CryptoTools.createTinyDSAKeyPair(); + Identity id = new Identity(kp.getPublic()); + ======= KeyPair kp = CryptoTools.createTinyRSAKeyPair(); Identity id = new Identity(kp.getPublic()); + >>>>>>> 1.6 assertNotNull(id); assertNotNull(id.getName()); *************** *** 63,71 **** } public void testEmbedded() throws NoSuchAlgorithmException, XMLSecurityException, CryptoException, NameResolutionException, InvalidNamedObjectException { ! KeyPair kp = CryptoTools.createTinyRSAKeyPair(); Document doc = DocumentHelper.createDocument(); Element elem = doc.addElement("TestElement"); ! XMLSignature sig = new XMLSignature(kp, elem); assertEquals(kp.getPublic(), sig.getSignersKey()); SignedNamedObject obj = VerifyingReader.getInstance().read(elem); --- 69,78 ---- } + <<<<<<< IdentityTests.java public void testEmbedded() throws NoSuchAlgorithmException, XMLSecurityException, CryptoException, NameResolutionException, InvalidNamedObjectException { ! KeyPair kp = CryptoTools.createTinyDSAKeyPair(); Document doc = DocumentHelper.createDocument(); Element elem = doc.addElement("TestElement"); ! XMLSignature sig = new EnvelopedSignature(kp, elem); assertEquals(kp.getPublic(), sig.getSignersKey()); SignedNamedObject obj = VerifyingReader.getInstance().read(elem); *************** *** 74,87 **** assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(kp.getPublic().getEncoded())), obj.getName().substring(5, 37)); assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(obj.getEncoded().getBytes())), obj.getName().substring(obj.getName().length() - 32)); ! Identity id = obj.getSignatory(); ! assertNotNull(id); ! assertNotNull(id.getName()); ! assertEquals("sha1:", id.getName().substring(0, 5)); ! assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(kp.getPublic().getEncoded())), id.getName().substring(5)); ! assertEquals(kp.getPublic(), id.getPublicKey()); } - } --- 81,109 ---- assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(kp.getPublic().getEncoded())), obj.getName().substring(5, 37)); assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(obj.getEncoded().getBytes())), obj.getName().substring(obj.getName().length() - 32)); + ======= + public void testEmbedded + () throws NoSuchAlgorithmException, XMLSecurityException, CryptoException, NameResolutionException, InvalidNamedObjectException + { + KeyPair kp = CryptoTools.createTinyRSAKeyPair(); + Document doc = DocumentHelper.createDocument(); + Element elem = doc.addElement("TestElement"); + XMLSignature sig = new XMLSignature(kp, elem); + assertEquals(kp.getPublic(), sig.getSignersKey()); + SignedNamedObject obj = VerifyingReader.getInstance().read(elem); + System.out.println("Name: " + obj.getName()); + assertEquals("sha1:", obj.getName().substring(0, 5)); + assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(kp.getPublic().getEncoded())), obj.getName().substring(5, 37)); + assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(obj.getEncoded().getBytes())), obj.getName().substring(obj.getName().length() - 32)); + >>>>>>> 1.6 ! Identity id = obj.getSignatory(); ! assertNotNull(id); ! assertNotNull(id.getName()); ! assertEquals("sha1:", id.getName().substring(0, 5)); ! assertEquals(CryptoTools.encodeBase32(CryptoTools.digest(kp.getPublic().getEncoded())), id.getName().substring(5)); ! assertEquals(kp.getPublic(), id.getPublicKey()); + } } |
|
From: Pelle B. <pe...@us...> - 2004-03-20 17:30:10
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19634/src/java/org/neuclear/id Modified Files: SignedNamedCore.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: SignedNamedCore.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedCore.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** SignedNamedCore.java 3 Mar 2004 23:26:42 -0000 1.21 --- SignedNamedCore.java 20 Mar 2004 17:19:55 -0000 1.22 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.22 2004/03/20 17:19:55 pelle + * The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + * * Revision 1.21 2004/03/03 23:26:42 pelle * Updated various tests to use the AbstractObjectCreationTest *************** *** 289,296 **** import org.neuclear.commons.LowLevelException; import org.neuclear.commons.crypto.CryptoTools; ! import org.neuclear.xml.xmlsec.InvalidSignatureException; ! import org.neuclear.xml.xmlsec.XMLSecTools; ! import org.neuclear.xml.xmlsec.XMLSecurityException; ! import org.neuclear.xml.xmlsec.XMLSignature; import java.security.PublicKey; --- 292,296 ---- import org.neuclear.commons.LowLevelException; import org.neuclear.commons.crypto.CryptoTools; ! import org.neuclear.xml.xmlsec.*; import java.security.PublicKey; *************** *** 302,305 **** --- 302,306 ---- * </p><p> * The SignedNamedCore has + * * @see NamedObjectReader * @see SignedNamedObject *************** *** 312,322 **** /** * SignedNamedCore for use in creating Identities for anonymous keys * @param pub */ ! public SignedNamedCore(final PublicKey pub){ ! this.digest=CryptoTools.encodeBase32(CryptoTools.digest(pub.getEncoded())); ! this.name="sha1:"+digest; ! this.timestamp=System.currentTimeMillis(); ! this.encoded=new String(pub.getEncoded()); this.signer = null;//new Identity(this,pub); } --- 313,324 ---- /** * SignedNamedCore for use in creating Identities for anonymous keys + * * @param pub */ ! public SignedNamedCore(final PublicKey pub) { ! this.digest = CryptoTools.encodeBase32(CryptoTools.digest(pub.getEncoded())); ! this.name = "sha1:" + digest; ! this.timestamp = System.currentTimeMillis(); ! this.encoded = new String(pub.getEncoded()); this.signer = null;//new Identity(this,pub); } *************** *** 324,339 **** /** * SignedNamedCore for creating SignedNamedObjects from Nymous sources * @param pub * @param encoded */ ! private SignedNamedCore(final PublicKey pub, final String encoded){ this.signer = new Identity(pub); ! this.digest=CryptoTools.encodeBase32(CryptoTools.digest(encoded.getBytes())); ! this.name=signer.getName()+"!"+digest; ! this.timestamp=System.currentTimeMillis(); ! this.encoded=encoded; } /** * SignedNamedCore for normal signed named objects * @param name * @param signer --- 326,344 ---- /** * SignedNamedCore for creating SignedNamedObjects from Nymous sources + * * @param pub * @param encoded */ ! private SignedNamedCore(final PublicKey pub, final String encoded) { this.signer = new Identity(pub); ! this.digest = CryptoTools.encodeBase32(CryptoTools.digest(encoded.getBytes())); ! this.name = signer.getName() + "!" + digest; ! this.timestamp = System.currentTimeMillis(); ! this.encoded = encoded; } + /** * SignedNamedCore for normal signed named objects + * * @param name * @param signer *************** *** 346,366 **** this.timestamp = timestamp.getTime(); this.encoded = encoded; ! this.digest=CryptoTools.encodeBase32(CryptoTools.digest(encoded.getBytes())); } ! private SignedNamedCore() { ! this.name="neu://"; ! this.signer=null;//new Identity(this,Identity.getRootPK()); final byte[] encoded = Identity.getRootPK().getEncoded(); ! this.digest=CryptoTools.encodeBase32(CryptoTools.digest(encoded)); ! this.timestamp=System.currentTimeMillis(); ! this.encoded=new String(encoded); } /** * Used to read and authenticate a SignedNamedCore. ! * ! * @param elem ! * @return * @throws InvalidNamedObjectException */ --- 351,371 ---- this.timestamp = timestamp.getTime(); this.encoded = encoded; ! this.digest = CryptoTools.encodeBase32(CryptoTools.digest(encoded.getBytes())); } ! private SignedNamedCore() { ! this.name = "neu://"; ! this.signer = null;//new Identity(this,Identity.getRootPK()); final byte[] encoded = Identity.getRootPK().getEncoded(); ! this.digest = CryptoTools.encodeBase32(CryptoTools.digest(encoded)); ! this.timestamp = System.currentTimeMillis(); ! this.encoded = new String(encoded); } /** * Used to read and authenticate a SignedNamedCore. ! * ! * @param elem ! * @return * @throws InvalidNamedObjectException */ *************** *** 413,419 **** private static SignedNamedCore readUnnamed(final Element elem) throws XMLSecurityException, InvalidNamedObjectException { try { ! final XMLSignature sig=XMLSecTools.getXMLSignature(elem); final PublicKey pub = sig.getSignersKey(); ! return new SignedNamedCore(pub,encodeElement(elem)); } catch (InvalidSignatureException e) { throw new InvalidNamedObjectException("Unnamed object failed Signature verification"); --- 418,424 ---- private static SignedNamedCore readUnnamed(final Element elem) throws XMLSecurityException, InvalidNamedObjectException { try { ! final XMLSignature sig = new EnvelopedSignature(elem); final PublicKey pub = sig.getSignersKey(); ! return new SignedNamedCore(pub, encodeElement(elem)); } catch (InvalidSignatureException e) { throw new InvalidNamedObjectException("Unnamed object failed Signature verification"); *************** *** 423,427 **** private static String getSignatoryName(final Element elem) throws InvalidNamedObjectException { final String name = elem.attributeValue(getNameAttrQName()); ! if (name==null) return null; return NSTools.normalizeNameURI(name); --- 428,432 ---- private static String getSignatoryName(final Element elem) throws InvalidNamedObjectException { final String name = elem.attributeValue(getNameAttrQName()); ! if (name == null) return null; return NSTools.normalizeNameURI(name); *************** *** 440,443 **** --- 445,449 ---- return DocumentHelper.createQName("name", NSTools.NS_NEUID); } + private static QName createQName(String name) { return DocumentHelper.createQName(name, NSTools.NS_NEUID); *************** *** 513,524 **** public final boolean equals(Object object) { ! if (object==this) return true; if (object instanceof SignedNamedCore) return true; ! return encoded.equals(((SignedNamedCore)object).getEncoded()); //To change body of overriden methods use Options | File Templates. } ! static Identity createSimpleIdentity(PublicKey pub){ ! return new Identity(new SignedNamedCore(pub),pub,null,null); } --- 519,531 ---- public final boolean equals(Object object) { ! if (object == this) return true; if (object instanceof SignedNamedCore) return true; ! return encoded.equals(((SignedNamedCore) object).getEncoded()); //To change body of overriden methods use Options | File Templates. } ! ! static Identity createSimpleIdentity(PublicKey pub) { ! return new Identity(new SignedNamedCore(pub), pub, null, null); } |
|
From: Pelle B. <pe...@us...> - 2004-03-20 17:29:41
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/transforms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19580/src/java/org/neuclear/xml/transforms Modified Files: XPathTransform.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: XPathTransform.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/transforms/XPathTransform.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** XPathTransform.java 8 Mar 2004 23:51:03 -0000 1.5 --- XPathTransform.java 20 Mar 2004 17:19:42 -0000 1.6 *************** *** 60,63 **** --- 60,71 ---- public final Object transformNode(final Object in) { + if (in instanceof Element) { + Element copy = ((Element) in).createCopy(); + return transform(copy); + } + return transform(in); + } + + private final Object transform(final Object in) { // XPath needs a document. So if element doesnt have one we add it. if (in instanceof Element) { *************** *** 78,82 **** while (iter.hasNext()) { final Node node = (Node) iter.next(); ! if (transformNode(node) == null) iter.remove(); } --- 86,90 ---- while (iter.hasNext()) { final Node node = (Node) iter.next(); ! if (transform(node) == null) iter.remove(); } |
|
From: Pelle B. <pe...@us...> - 2004-03-20 17:29:41
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19580/src/test/org/neuclear/xml/xmlsec Modified Files: InteropTests.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: InteropTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/InteropTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InteropTests.java 19 Mar 2004 23:38:25 -0000 1.2 --- InteropTests.java 20 Mar 2004 17:19:42 -0000 1.3 *************** *** 8,11 **** --- 8,14 ---- * $Id$ * $Log$ + * Revision 1.3 2004/03/20 17:19:42 pelle + * The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + * * Revision 1.2 2004/03/19 23:38:25 pelle * I now know the problem is in the Reference element *************** *** 126,134 **** public final void testMerlin23() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/merlin-xmldsig-twenty-three", 11);//,"signature-enveloping-dsa\\.xml"); } public final void testPhaos() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/phaos-xmldsig-two", 0); } --- 129,137 ---- public final void testMerlin23() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/merlin-xmldsig-twenty-three", 10);//,"signature-enveloping-dsa\\.xml"); } public final void testPhaos() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/phaos-xmldsig-two", 30); } *************** *** 170,174 **** } catch (Exception e) { System.out.println("ERROR: " + (errors++) + e.getMessage()); ! e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } --- 173,177 ---- } catch (Exception e) { System.out.println("ERROR: " + (errors++) + e.getMessage()); ! // e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } *************** *** 184,187 **** --- 187,191 ---- return true; } catch (InvalidSignatureException e) { + System.out.println(e.getMessage()); return false; } |
|
From: Pelle B. <pe...@us...> - 2004-03-20 17:29:41
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19580/src/java/org/neuclear/xml/xmlsec Modified Files: InvalidSignatureException.java SignedInfo.java XMLSignature.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: InvalidSignatureException.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/InvalidSignatureException.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InvalidSignatureException.java 19 Mar 2004 22:21:51 -0000 1.5 --- InvalidSignatureException.java 20 Mar 2004 17:19:42 -0000 1.6 *************** *** 12,16 **** public class InvalidSignatureException extends Exception { public InvalidSignatureException(byte[] a, byte[] b) { ! super("Digest: '" + a + "' not equal to: " + b); } --- 12,16 ---- public class InvalidSignatureException extends Exception { public InvalidSignatureException(byte[] a, byte[] b) { ! super("Digest: '" + new String(a) + "' not equal to: " + new String(b)); } Index: SignedInfo.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/SignedInfo.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SignedInfo.java 19 Mar 2004 22:21:51 -0000 1.5 --- SignedInfo.java 20 Mar 2004 17:19:42 -0000 1.6 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.6 2004/03/20 17:19:42 pelle + * The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + * * Revision 1.5 2004/03/19 22:21:51 pelle * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: *************** *** 279,285 **** try { final byte[] cansi = canonicalize(); ! System.out.println("Signing Canonicalized:"); ! System.out.println(new String(cansi)); ! System.out.println("------"); return CryptoTools.sign(key, cansi); --- 282,288 ---- try { final byte[] cansi = canonicalize(); ! // System.out.println("Signing Canonicalized:"); ! // System.out.println(new String(cansi)); ! // System.out.println("------"); return CryptoTools.sign(key, cansi); Index: XMLSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSignature.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** XMLSignature.java 19 Mar 2004 23:38:25 -0000 1.17 --- XMLSignature.java 20 Mar 2004 17:19:42 -0000 1.18 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.18 2004/03/20 17:19:42 pelle + * The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + * * Revision 1.17 2004/03/19 23:38:25 pelle * I now know the problem is in the Reference element *************** *** 276,282 **** final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! System.out.println("Verifying Canonicalized: "); ! System.out.println(new String(cansi)); ! System.out.println("------"); try { --- 279,285 ---- final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! // System.out.println("Verifying Canonicalized: "); ! // System.out.println(new String(cansi)); ! // System.out.println("------"); try { |
|
From: Pelle B. <pe...@us...> - 2004-03-19 23:48:17
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3872/src/java/org/neuclear/xml/xmlsec Modified Files: XMLSignature.java Log Message: I now know the problem is in the Reference element Index: XMLSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSignature.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** XMLSignature.java 19 Mar 2004 22:21:51 -0000 1.16 --- XMLSignature.java 19 Mar 2004 23:38:25 -0000 1.17 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.17 2004/03/19 23:38:25 pelle + * I now know the problem is in the Reference element + * * Revision 1.16 2004/03/19 22:21:51 pelle * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: *************** *** 273,279 **** final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! // System.out.println("Verifying Canonicalized: "); ! // System.out.println(new String(cansi)); ! // System.out.println("------"); try { --- 276,282 ---- final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! System.out.println("Verifying Canonicalized: "); ! System.out.println(new String(cansi)); ! System.out.println("------"); try { |
|
From: Pelle B. <pe...@us...> - 2004-03-19 23:48:17
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3872/src/test/org/neuclear/xml/xmlsec Modified Files: InteropTests.java Log Message: I now know the problem is in the Reference element Index: InteropTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/InteropTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InteropTests.java 19 Mar 2004 22:21:51 -0000 1.1 --- InteropTests.java 19 Mar 2004 23:38:25 -0000 1.2 *************** *** 8,11 **** --- 8,14 ---- * $Id$ * $Log$ + * Revision 1.2 2004/03/19 23:38:25 pelle + * I now know the problem is in the Reference element + * * Revision 1.1 2004/03/19 22:21:51 pelle * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: *************** *** 123,131 **** public final void testMerlin23() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/merlin-xmldsig-twenty-three", 10);//,"signature-enveloping-dsa\\.xml"); } public final void testPhaos() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/phaos-xmldsig-two", 29); } --- 126,134 ---- public final void testMerlin23() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/merlin-xmldsig-twenty-three", 11);//,"signature-enveloping-dsa\\.xml"); } public final void testPhaos() throws IOException, DocumentException, NeuClearException { ! runDirectoryTest("src/testdata/phaos-xmldsig-two", 0); } |
|
From: Pelle B. <pe...@us...> - 2004-03-19 22:31:43
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19896/src/java/org/neuclear/xml/xmlsec Modified Files: AbstractXMLSigElement.java InvalidSignatureException.java KeyInfo.java Reference.java SignedElement.java SignedInfo.java XMLSecTools.java XMLSignature.java Added Files: AnyXMLSignature.java DataObjectSignature.java EnvelopedSignature.java InvalidReferencesException.java Log Message: Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: - Enveloped - DataObjects - (Enveloping) - Any for interop testing mainly. --- NEW FILE: InvalidReferencesException.java --- package org.neuclear.xml.xmlsec; /** * Created by IntelliJ IDEA. * User: pelleb * Date: Mar 19, 2004 * Time: 2:16:55 PM * To change this template use File | Settings | File Templates. */ public class InvalidReferencesException extends InvalidSignatureException { public InvalidReferencesException(int count) { super("Invalid reference count: " + count); } public InvalidReferencesException() { super("Invalid reference type"); } } Index: Reference.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/Reference.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Reference.java 8 Mar 2004 23:51:03 -0000 1.16 --- Reference.java 19 Mar 2004 22:21:51 -0000 1.17 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.17 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.16 2004/03/08 23:51:03 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 290,300 **** } else { Node node = refObject; ! final List list = elem.element(XMLSecTools.createQName("Transforms")).elements(XMLSecTools.createQName("Transform")); ! for (int i = 0; i < list.size() - 1; i++) { ! Transform o = TransformerFactory.make((Element) list.get(i)); ! node = (Node) o.transformNode(node); } ! ! dig2 = createDigest((Canonicalizer) TransformerFactory.make((Element) list.get(list.size() - 1)), node); } if (!CryptoTools.equalByteArrays(digest, dig2)) --- 296,314 ---- } else { Node node = refObject; ! final Element trelem = elem.element(XMLSecTools.createQName("Transforms")); ! Canonicalizer canon = null; ! if (trelem != null) { ! final List list = trelem.elements(XMLSecTools.createQName("Transform")); ! for (int i = 0; i < list.size(); i++) { ! Transform o = TransformerFactory.make((Element) list.get(i)); ! if (i == list.size() - 1 && o instanceof Canonicalizer) ! canon = (Canonicalizer) TransformerFactory.make((Element) list.get(list.size() - 1)); ! else ! node = (Node) o.transformNode(node); ! } } ! if (canon == null) ! canon = new Canonicalizer(); ! dig2 = createDigest(canon, node); } if (!CryptoTools.equalByteArrays(digest, dig2)) Index: XMLSecTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSecTools.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** XMLSecTools.java 8 Mar 2004 23:51:03 -0000 1.13 --- XMLSecTools.java 19 Mar 2004 22:21:51 -0000 1.14 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.14 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.13 2004/03/08 23:51:03 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 181,186 **** import org.neuclear.commons.crypto.Base64; import org.neuclear.commons.crypto.CryptoException; - import org.neuclear.commons.crypto.passphraseagents.UserCancellationException; - import org.neuclear.commons.crypto.signers.NonExistingSignerException; import org.neuclear.xml.XMLException; import org.neuclear.xml.c14.Canonicalizer; --- 187,190 ---- *************** *** 189,193 **** import java.io.StringWriter; import java.math.BigInteger; - import java.security.KeyPair; import java.security.KeyStore; import java.security.KeyStoreException; --- 193,196 ---- *************** *** 217,263 **** /** - * Signs an element with a given keypair and envelopes the signature within. - * - * @param root Element to be signed - * @param keypair RSA/DSA KeyPair - * @throws XMLSecurityException - */ - public static XMLSignature signElement(final Element root, final KeyPair keypair) throws XMLSecurityException, CryptoException {//, KeyStoreException { - final XMLSignature sig = new XMLSignature(keypair, root); - return sig; - } - - - /** - * Signs an element with a given Private Key and "Envelopes" the signature within. - * - * @param root Element to be signed - * @param name Alias of key to be used for signing - * @param signer NeuClear Signer - * @throws XMLSecurityException - */ - public static XMLSignature signElement(final Element root, final String name, final org.neuclear.commons.crypto.signers.Signer signer) throws XMLSecurityException, NonExistingSignerException, UserCancellationException {//, KeyStoreException { - return new XMLSignature(name, signer, root, true); - } - - /** - * Signs an element with a given keypair and embeds the element within the Signature. - * - * @param root Element to be signed - * @param keypair RSA/DSA KeyPair - * @throws XMLSecurityException - */ - public static XMLSignature signElementEnveloping(final Element root, final KeyPair keypair) throws XMLSecurityException, CryptoException {//, KeyStoreException { - final XMLSignature sig = new XMLSignature(keypair, root, false); - return sig; - } - - /** * Creates a KeyInfo Element containing the public key of a key stored in the given keystore. ! * * @param ks KeyStore to use * @param s Identifier of Key * @return Element containg valid KeyInfo ! * @throws KeyStoreException */ public static Element createKeyInfo(final KeyStore ks, final String s) throws KeyStoreException { --- 220,229 ---- /** * Creates a KeyInfo Element containing the public key of a key stored in the given keystore. ! * * @param ks KeyStore to use * @param s Identifier of Key * @return Element containg valid KeyInfo ! * @throws KeyStoreException */ public static Element createKeyInfo(final KeyStore ks, final String s) throws KeyStoreException { *************** *** 305,310 **** * @throws XMLSecurityException */ ! public static XMLSignature getXMLSignature(final Element elem) throws XMLSecurityException, InvalidSignatureException { final QName qname = XMLSecTools.createQName("Signature"); Element xmlSigElement = elem.element(qname); if (xmlSigElement == null || (isInXMLSigNS(xmlSigElement))) { --- 271,278 ---- * @throws XMLSecurityException */ ! public static Element getSignatureElement(final Element elem) throws XMLSecurityException { final QName qname = XMLSecTools.createQName("Signature"); + if (elem.getQName().equals(qname)) + return elem; Element xmlSigElement = elem.element(qname); if (xmlSigElement == null || (isInXMLSigNS(xmlSigElement))) { *************** *** 314,318 **** throw new XMLSecurityException("No Signature Found"); } ! return new XMLSignature(xmlSigElement); } --- 282,286 ---- throw new XMLSecurityException("No Signature Found"); } ! return xmlSigElement; } *************** *** 322,360 **** /** - * Verifies the signature of a given element - * - * @param elem Element to verify - * @param pub Public Key to verify against - * @return true if it verifies - * @throws XMLSecurityException - */ - public static boolean verifySignature(final Element elem, final PublicKey pub) throws XMLSecurityException { - try { - final XMLSignature sig = getXMLSignature(elem); - return true; - } catch (InvalidSignatureException e) { - return false; - } - } - - /** - * Verifies the signature of a given element. Note this requires an embedded KeyInfo part within the - * Signature Element. - * - * @param elem Element to verify - * @return true if it verifies - * @throws XMLSecurityException - */ - public static boolean verifySignature(final Element elem) throws XMLSecurityException, CryptoException { - try { - final XMLSignature sig = getXMLSignature(elem); - return true; - } catch (InvalidSignatureException e) { - System.out.println(e.getLocalizedMessage()); - return false; - } - } - - /** * This takes a node and outputs it as a byte array. Note this is not canonicalized * --- 290,293 ---- *************** *** 454,461 **** } - public static void rethrowException(final Throwable e) throws XMLSecurityException { - throw new XMLSecurityException(e); - } - /** * Method decodeBigIntegerFromElement --- 387,390 ---- *************** *** 578,611 **** return base64ToElement(localName, Base64.getBytes(big)); } - /* - public static void main(String args[]){ - SAXReader reader = new SAXReader(); - try { - - reader.setValidation(false); - reader.setStripWhitespaceText(false); - reader.setMergeAdjacentText(false); - reader.setStringInternEnabled(false); - - reader.setIncludeExternalDTDDeclarations(false); - Document document = reader.read(System.in); - // if (reader.getXMLFilter()!=null) - // System.out.println("XMLFilter: "+reader.getXMLFilter().getClass().toString()); - // if (reader.getXMLReader()!=null) - // System.out.println("XMLReader: "+reader.getXMLReader().getClass().toString()); - System.out.println("Original:"); - System.out.println(document.asXML()); - System.out.println("C14n:"); - - System.out.write(getElementBytes(document)); - } catch (DocumentException e) { - System.err.println("There was no input"); - e.printStackTrace(); //To change body of catch statement use Options | File Templates. - } catch (IOException e) { - - e.printStackTrace(); //To change body of catch statement use Options | File Templates. - } - - } - */ } --- 507,509 ---- Index: InvalidSignatureException.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/InvalidSignatureException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InvalidSignatureException.java 8 Mar 2004 23:51:03 -0000 1.4 --- InvalidSignatureException.java 19 Mar 2004 22:21:51 -0000 1.5 *************** *** 18,20 **** --- 18,24 ---- super("Public Key: " + pub.toString() + " didnt sign this signature"); } + + protected InvalidSignatureException(String title) { + super(title); + } } Index: KeyInfo.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/KeyInfo.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** KeyInfo.java 14 Jan 2004 17:07:59 -0000 1.9 --- KeyInfo.java 19 Mar 2004 22:21:51 -0000 1.10 *************** *** 67,74 **** } } ! public KeyInfo(final PublicKey pub, final String name){ this(pub); appendKeyName(name); } public KeyInfo(final String name) { super(TAG_NAME); --- 67,76 ---- } } ! ! public KeyInfo(final PublicKey pub, final String name) { this(pub); appendKeyName(name); } + public KeyInfo(final String name) { super(TAG_NAME); *************** *** 85,89 **** super(TAG_NAME); final Element kv = XMLSecTools.createElementInSignatureSpace("X509Data"); ! kv.add(XMLSecTools.base64ToElement("X509Certificate",cert.getEncoded())); addElement(kv); } --- 87,91 ---- super(TAG_NAME); final Element kv = XMLSecTools.createElementInSignatureSpace("X509Data"); ! kv.add(XMLSecTools.base64ToElement("X509Certificate", cert.getEncoded())); addElement(kv); } *************** *** 104,120 **** throws XMLSecurityException { if (pub == null) { ! Iterator iter=getElement().elementIterator(); ! while (iter.hasNext()&&pub==null) { Element element = (Element) iter.next(); ! if(element.getName().equals("KeyName")) return element.getTextTrim(); ! else if(element.getName().equals("X509Data")) ! return "x509v3:"+Base64.encode(extractX509(element).getSerialNumber()); if (element.getName().equals("KeyValue")) ! return "sha1:"+Base64.encode(CryptoTools.digest(parseKeyValue(element).getEncoded())); } } return null; } /** * Method getPublicKey --- 106,123 ---- throws XMLSecurityException { if (pub == null) { ! Iterator iter = getElement().elementIterator(); ! while (iter.hasNext() && pub == null) { Element element = (Element) iter.next(); ! if (element.getName().equals("KeyName")) return element.getTextTrim(); ! else if (element.getName().equals("X509Data")) ! return "x509v3:" + Base64.encode(extractX509(element).getSerialNumber()); if (element.getName().equals("KeyValue")) ! return "sha1:" + Base64.encode(CryptoTools.digest(parseKeyValue(element).getEncoded())); } } return null; } + /** * Method getPublicKey *************** *** 126,156 **** throws XMLSecurityException { if (pub == null) { ! Iterator iter=getElement().elementIterator(); ! while (iter.hasNext()&&pub==null) { Element element = (Element) iter.next(); if (element.getName().equals("KeyValue")) ! pub=parseKeyValue(element); ! else if(element.getName().equals("KeyName")) ! pub=parseKeyName(element); ! else if(element.getName().equals("X509Data")) ! pub=parseX509(element); } } return pub; } ! private PublicKey parseKeyName(final Element element){ ! final String name=element.getTextTrim(); return KeyResolverFactory.getInstance().resolve(name); } private PublicKey parseX509(final Element element) throws XMLSecurityException { return extractX509(element).getPublicKey(); } private X509Certificate extractX509(final Element element) throws XMLSecurityException { ! Element x509Data=element.element("X509Certificate"); ! if (x509Data!=null){ try { ! byte encoded[]=XMLSecTools.decodeBase64Element(x509Data); ! CertificateFactory fact=CertificateFactory.getInstance("X.509"); ! X509Certificate cert=(X509Certificate) fact.generateCertificate(new ByteArrayInputStream(encoded)); return cert; } catch (CertificateException e) { --- 129,162 ---- throws XMLSecurityException { if (pub == null) { ! Iterator iter = getElement().elementIterator(); ! while (iter.hasNext() && pub == null) { Element element = (Element) iter.next(); if (element.getName().equals("KeyValue")) ! pub = parseKeyValue(element); ! else if (element.getName().equals("KeyName")) ! pub = parseKeyName(element); ! else if (element.getName().equals("X509Data")) ! pub = parseX509(element); } } return pub; } ! ! private PublicKey parseKeyName(final Element element) { ! final String name = element.getTextTrim(); return KeyResolverFactory.getInstance().resolve(name); } + private PublicKey parseX509(final Element element) throws XMLSecurityException { return extractX509(element).getPublicKey(); } + private X509Certificate extractX509(final Element element) throws XMLSecurityException { ! Element x509Data = element.element("X509Certificate"); ! if (x509Data != null) { try { ! byte encoded[] = XMLSecTools.decodeBase64Element(x509Data); ! CertificateFactory fact = CertificateFactory.getInstance("X.509"); ! X509Certificate cert = (X509Certificate) fact.generateCertificate(new ByteArrayInputStream(encoded)); return cert; } catch (CertificateException e) { *************** *** 159,164 **** } } ! return null; } private PublicKey parseKeyValue(final Element kvElement) throws XMLSecurityException { try { --- 165,171 ---- } } ! throw new XMLSecurityException("No X509Certificate included"); } + private PublicKey parseKeyValue(final Element kvElement) throws XMLSecurityException { try { *************** *** 183,187 **** final PublicKey pk = keyFactory.generatePublic(rsaKeyspec); ! return pk; } else if (algElement.getName().equalsIgnoreCase("DSAKeyValue")) { keyFactory = KeyFactory.getInstance("DSA"); --- 190,194 ---- final PublicKey pk = keyFactory.generatePublic(rsaKeyspec); ! return pk; } else if (algElement.getName().equalsIgnoreCase("DSAKeyValue")) { keyFactory = KeyFactory.getInstance("DSA"); *************** *** 199,205 **** } } catch (NoSuchAlgorithmException ex) { ! XMLSecTools.rethrowException(ex); } catch (InvalidKeySpecException ex) { ! XMLSecTools.rethrowException(ex); } return null; --- 206,212 ---- } } catch (NoSuchAlgorithmException ex) { ! throw new XMLSecurityException(ex); } catch (InvalidKeySpecException ex) { ! throw new XMLSecurityException(ex); } return null; Index: XMLSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSignature.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** XMLSignature.java 8 Mar 2004 23:51:03 -0000 1.15 --- XMLSignature.java 19 Mar 2004 22:21:51 -0000 1.16 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.16 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.15 2004/03/08 23:51:03 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 195,199 **** */ - import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.neuclear.commons.crypto.Base64; --- 201,204 ---- *************** *** 213,249 **** * This is the base class of Digital Signatures */ ! public class XMLSignature extends AbstractXMLSigElement { ! /** ! * Creates an Enveloped (Embedded) Signature object based on the given element root ! * ! * @param keypair ! * @param root ! * @throws XMLSecurityException ! */ ! public XMLSignature(final KeyPair keypair, final Element root) throws XMLSecurityException { ! this(keypair, root, true); ! } ! ! ! public XMLSignature(final KeyPair kp, final Element elem, final boolean embedded) throws XMLSecurityException { ! this(kp.getPublic(), new SignedInfo(getSignatureAlgorithm(kp.getPublic()), 1)); ! if (embedded) { ! si.setEnvelopedReference(elem); ! elem.add(getElement()); ! } else ! si.addEnvelopingReference(addDataObject("data", elem)); ! sign(kp); } ! public XMLSignature(final String name, final Signer signer, final Element elem, final boolean embedded) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { this(getPublicKey(name, signer), new SignedInfo(getSignatureAlgorithm(getPublicKey(name, signer)), 1)); - if (embedded) { - si.setEnvelopedReference(elem); - elem.add(getElement()); - } else - si.addEnvelopingReference(addDataObject("data", elem)); - sign(name, signer); - } --- 218,229 ---- * This is the base class of Digital Signatures */ ! abstract public class XMLSignature extends AbstractXMLSigElement { ! protected XMLSignature(final PublicKey pub) throws XMLSecurityException { ! this(pub, new SignedInfo(getSignatureAlgorithm(pub), 1)); } ! protected XMLSignature(final String name, final Signer signer) throws XMLSecurityException, NonExistingSignerException { this(getPublicKey(name, signer), new SignedInfo(getSignatureAlgorithm(getPublicKey(name, signer)), 1)); } *************** *** 257,261 **** } ! public XMLSignature(final KeyPair kp, final SignedInfo si) throws XMLSecurityException, CryptoException { this(kp.getPublic(), si); sign(kp); --- 237,241 ---- } ! protected XMLSignature(final KeyPair kp, final SignedInfo si) throws XMLSecurityException { this(kp.getPublic(), si); sign(kp); *************** *** 263,267 **** ! public XMLSignature(final String name, final Signer signer, final SignedInfo si) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { this(getPublicKey(name, signer), si); sign(name, signer); --- 243,247 ---- ! protected XMLSignature(final String name, final Signer signer, final SignedInfo si) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { this(getPublicKey(name, signer), si); sign(name, signer); *************** *** 276,285 **** * @throws InvalidSignatureException */ ! public XMLSignature(final Element elem) throws XMLSecurityException, InvalidSignatureException { super(elem); final Element siElem = elem.element(XMLSecTools.createQName("SignedInfo")); ! if (!elem.getQName().equals(XMLSecTools.createQName(TAG_NAME)) || siElem == null) // Not sure if equals is imeplemented properly for QNames throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); si = new SignedInfo(siElem); KeyInfo key = getKeyInfo(); if (key == null) --- 256,270 ---- * @throws InvalidSignatureException */ ! protected XMLSignature(final Element elem) throws XMLSecurityException, InvalidSignatureException { super(elem); final Element siElem = elem.element(XMLSecTools.createQName("SignedInfo")); ! if (!elem.getQName().equals(XMLSecTools.createQName(TAG_NAME))) // Not sure if equals is imeplemented properly for QNames throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); + if (siElem == null) + throw new XMLSecurityException("Signature does not contain a SignedInfo element"); si = new SignedInfo(siElem); + + verifyReferencesStructure(); + KeyInfo key = getKeyInfo(); if (key == null) *************** *** 288,292 **** final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! // System.out.println("Canonicalized:"); // System.out.println(new String(cansi)); // System.out.println("------"); --- 273,277 ---- final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); ! // System.out.println("Verifying Canonicalized: "); // System.out.println(new String(cansi)); // System.out.println("------"); *************** *** 300,312 **** } ! public XMLSignature(final Element elem, PublicKey pub) throws XMLSecurityException, InvalidSignatureException { ! super(elem); ! final Element siElem = elem.element(XMLSecTools.createQName("SignedInfo")); ! if (!elem.getQName().equals(XMLSecTools.createQName(TAG_NAME)) || siElem == null) // Not sure if equals is imeplemented properly for QNames ! throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); ! si = new SignedInfo(siElem); ! final byte[] sig = getSignature(); ! if (!si.verify(pub, sig)) ! throw new InvalidSignatureException(pub); } --- 285,295 ---- } ! ! /** ! * This will be called by the constructor with Element parameter ! * Override this for specific Signature models. ! */ ! protected void verifyReferencesStructure() throws InvalidReferencesException { ! ; } *************** *** 315,334 **** } ! private void sign(final KeyPair kp) throws XMLSecurityException { sigval.setText(Base64.encode(si.sign(kp.getPrivate()))); } ! private void sign(final String name, final Signer signer) throws XMLSecurityException, NonExistingSignerException, UserCancellationException { sigval.setText(Base64.encode(si.sign(name, signer))); } - private Element addDataObject(final String id, final Element root) { - final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); - objElem.addAttribute("Id", id); - DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc - objElem.add(root); - getElement().add(objElem); - return objElem; - } private static PublicKey getPublicKey(final String name, final Signer signer) throws XMLSecurityException, NonExistingSignerException { --- 298,309 ---- } ! protected void sign(final KeyPair kp) throws XMLSecurityException { sigval.setText(Base64.encode(si.sign(kp.getPrivate()))); } ! protected void sign(final String name, final Signer signer) throws XMLSecurityException, NonExistingSignerException, UserCancellationException { sigval.setText(Base64.encode(si.sign(name, signer))); } private static PublicKey getPublicKey(final String name, final Signer signer) throws XMLSecurityException, NonExistingSignerException { *************** *** 376,380 **** } ! private SignedInfo si; private Element sigval; private KeyInfo ki; --- 351,359 ---- } ! public final Element getPrimaryReferenceElement() { ! return si.getPrimaryReferenceElement(); ! } ! ! protected SignedInfo si; private Element sigval; private KeyInfo ki; --- NEW FILE: AnyXMLSignature.java --- package org.neuclear.xml.xmlsec; import org.dom4j.Element; /** * This is the most general form of a XMLSignature. It doesnt check for the references it only checks to see if a * the signature is valid. As such this should NEVER be used in anything but applications that check for interoperabiity. */ public class AnyXMLSignature extends XMLSignature { public AnyXMLSignature(Element elem) throws XMLSecurityException, InvalidSignatureException { super(XMLSecTools.getSignatureElement(elem)); } } Index: AbstractXMLSigElement.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/AbstractXMLSigElement.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractXMLSigElement.java 11 Dec 2003 23:56:53 -0000 1.3 --- AbstractXMLSigElement.java 19 Mar 2004 22:21:51 -0000 1.4 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.4 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.3 2003/12/11 23:56:53 pelle * Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort. *************** *** 52,55 **** --- 58,63 ---- protected AbstractXMLSigElement(final Element elem) throws XMLSecurityException { super(elem); + if (elem == null) + throw new XMLSecurityException("Null Element Passed"); if (!elem.getNamespaceURI().equalsIgnoreCase(XMLSecTools.NS_DS.getURI())) throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not part of XML NS: " + XMLSecTools.NS_DS.getURI()); --- NEW FILE: EnvelopedSignature.java --- package org.neuclear.xml.xmlsec; import org.dom4j.Element; import org.neuclear.commons.Utility; import org.neuclear.commons.crypto.passphraseagents.UserCancellationException; import org.neuclear.commons.crypto.signers.NonExistingSignerException; import org.neuclear.commons.crypto.signers.Signer; import java.security.KeyPair; import java.util.List; /** * This is a standard Enveloped Signature with only one Reference object. */ public class EnvelopedSignature extends XMLSignature { public EnvelopedSignature(Element elem) throws XMLSecurityException, InvalidSignatureException { super(XMLSecTools.getSignatureElement(elem)); } public EnvelopedSignature(String name, Signer signer, Element elem) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { super(name, signer); si.setEnvelopedReference(elem); elem.add(getElement()); sign(name, signer); } public EnvelopedSignature(KeyPair kp, Element elem) throws XMLSecurityException { super(kp.getPublic()); si.setEnvelopedReference(elem); elem.add(getElement()); sign(kp); } protected void verifyReferencesStructure() throws InvalidReferencesException { List refs = si.getReferences(); if (refs.size() != 1) throw new InvalidReferencesException(refs.size()); if (!Utility.isEmpty(si.getPrimaryReference().getUri())) throw new InvalidReferencesException(); } } Index: SignedElement.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/SignedElement.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SignedElement.java 8 Mar 2004 23:51:03 -0000 1.11 --- SignedElement.java 19 Mar 2004 22:21:51 -0000 1.12 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.12 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.11 2004/03/08 23:51:03 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 158,162 **** public abstract class SignedElement extends AbstractElementProxy { ! private XMLSignature sig; public SignedElement(final QName qname) { --- 164,168 ---- public abstract class SignedElement extends AbstractElementProxy { ! private EnvelopedSignature sig; public SignedElement(final QName qname) { *************** *** 169,173 **** if (sigElement != null) try { ! sig = new XMLSignature(sigElement); } catch (XMLException e) { throw new XMLSecurityException(e); --- 175,179 ---- if (sigElement != null) try { ! sig = new EnvelopedSignature(sigElement); } catch (XMLException e) { throw new XMLSecurityException(e); *************** *** 223,228 **** public boolean verify() throws XMLSecurityException { try { ! sig = new XMLSignature(getElement().element(XMLSecTools.createQName("Signature"))); return true; } catch (InvalidSignatureException e) { return false; --- 229,237 ---- public boolean verify() throws XMLSecurityException { try { ! if (sig == null) ; ! sig = new EnvelopedSignature(getElement()); ! return true; + } catch (InvalidSignatureException e) { return false; *************** *** 232,236 **** public final void sign(final String name, final Signer signer) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { preSign(); ! sig = new XMLSignature(name, signer, getElement(), true); postSign(); } --- 241,245 ---- public final void sign(final String name, final Signer signer) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { preSign(); ! sig = new EnvelopedSignature(name, signer, getElement()); postSign(); } Index: SignedInfo.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/SignedInfo.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SignedInfo.java 18 Mar 2004 21:31:33 -0000 1.4 --- SignedInfo.java 19 Mar 2004 22:21:51 -0000 1.5 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.5 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.4 2004/03/18 21:31:33 pelle * Some fixups in SignedInfo *************** *** 208,214 **** * * @return - * @throws XMLSecurityException */ ! public final List getReferences() throws XMLSecurityException { return Collections.unmodifiableList(refs); } --- 214,219 ---- * * @return */ ! public final List getReferences() { return Collections.unmodifiableList(refs); } *************** *** 219,226 **** * @return */ ! public final Element getPrimaryReference() { return ((Reference) refs.get(0)).getReferencedElement(); } final Canonicalizer getCanonicalizer() { final Element c14elem = getElement().element(XMLSecTools.createQName("CanonicalizationMethod")); --- 224,240 ---- * @return */ ! public final Element getPrimaryReferenceElement() { return ((Reference) refs.get(0)).getReferencedElement(); } + /** + * Returns the first Reference + * + * @return + */ + public final Reference getPrimaryReference() { + return ((Reference) refs.get(0)); + } + final Canonicalizer getCanonicalizer() { final Element c14elem = getElement().element(XMLSecTools.createQName("CanonicalizationMethod")); *************** *** 252,257 **** public final byte[] canonicalize() throws XMLSecurityException { ! return XMLSecTools.canonicalize(getCanonicalizer(), getElement()); ! } /** --- 266,271 ---- public final byte[] canonicalize() throws XMLSecurityException { ! return getCanonicalizer().canonicalize(getElement()); ! }; /** *************** *** 264,268 **** public final byte[] sign(PrivateKey key) throws XMLSecurityException { try { ! return CryptoTools.sign(key, canonicalize()); } catch (CryptoException e) { throw new XMLSecurityException(e); --- 278,287 ---- public final byte[] sign(PrivateKey key) throws XMLSecurityException { try { ! final byte[] cansi = canonicalize(); ! System.out.println("Signing Canonicalized:"); ! System.out.println(new String(cansi)); ! System.out.println("------"); ! ! return CryptoTools.sign(key, cansi); } catch (CryptoException e) { throw new XMLSecurityException(e); --- NEW FILE: DataObjectSignature.java --- package org.neuclear.xml.xmlsec; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.neuclear.commons.Utility; import org.neuclear.commons.crypto.passphraseagents.UserCancellationException; import org.neuclear.commons.crypto.signers.NonExistingSignerException; import org.neuclear.commons.crypto.signers.Signer; import java.security.KeyPair; import java.util.List; /** * This is a standard Enveloped Signature with only one Reference object. */ public class DataObjectSignature extends XMLSignature { public DataObjectSignature(Element elem) throws XMLSecurityException, InvalidSignatureException { super(elem); } public DataObjectSignature(String name, Signer signer, Element elem) throws XMLSecurityException, UserCancellationException, NonExistingSignerException { super(name, signer); si.addEnvelopingReference(addDataObject("data", elem)); sign(name, signer); } public DataObjectSignature(KeyPair kp, Element elem) throws XMLSecurityException { super(kp.getPublic()); si.addEnvelopingReference(addDataObject("data", elem)); sign(kp); } protected void verifyReferencesStructure() throws InvalidReferencesException { List refs = si.getReferences(); if (refs.size() != 1) throw new InvalidReferencesException(refs.size()); if (Utility.isEmpty(si.getPrimaryReference().getUri())) throw new InvalidReferencesException(); } private Element addDataObject(final String id, final Element root) { final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); objElem.addAttribute("Id", id); DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc objElem.add(root); getElement().add(objElem); return objElem; } } |
|
From: Pelle B. <pe...@us...> - 2004-03-19 22:31:43
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19896/src/test/org/neuclear/xml/xmlsec Modified Files: RefTest.java SimpleXMLSigTest.java Added Files: InteropTests.java Removed Files: SignatureTests.java XMLSignerTest.java Log Message: Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: - Enveloped - DataObjects - (Enveloping) - Any for interop testing mainly. Index: RefTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/RefTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RefTest.java 8 Mar 2004 23:51:04 -0000 1.8 --- RefTest.java 19 Mar 2004 22:21:51 -0000 1.9 *************** *** 33,36 **** --- 33,42 ---- $Id$ $Log$ + Revision 1.9 2004/03/19 22:21:51 pelle + Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + - Enveloped + - DataObjects - (Enveloping) + - Any for interop testing mainly. + Revision 1.8 2004/03/08 23:51:04 pelle More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 92,98 **** public void testEnvelopedReference() throws DocumentException, XMLException, CryptoException { ! Document doc = DocumentHelper.parseText("<test>hello<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><SignedInfo/></Signature></test>"); Reference ref = new Reference(doc.getRootElement(), true); ! doc.getRootElement().element("Signature").element("SignedInfo").add(ref.getElement()); assertNotNull(ref); --- 98,104 ---- public void testEnvelopedReference() throws DocumentException, XMLException, CryptoException { ! Document doc = DocumentHelper.parseText("<test>hello<ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"><ds:SignedInfo/></ds:Signature></test>"); Reference ref = new Reference(doc.getRootElement(), true); ! XMLSecTools.getSignatureElement(doc.getRootElement()).element("SignedInfo").add(ref.getElement()); assertNotNull(ref); Index: SimpleXMLSigTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/SimpleXMLSigTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SimpleXMLSigTest.java 8 Mar 2004 23:51:04 -0000 1.11 --- SimpleXMLSigTest.java 19 Mar 2004 22:21:51 -0000 1.12 *************** *** 16,19 **** --- 16,20 ---- import java.security.KeyPair; import java.security.NoSuchAlgorithmException; + import java.security.interfaces.DSAPublicKey; /** *************** *** 24,31 **** * $Id$ * $Log$ * Revision 1.11 2004/03/08 23:51:04 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. * All the major elements have been refactored to be cleaner and more correct. ! * * Revision 1.10 2004/03/02 23:30:44 pelle * Renamed SignatureInfo to SignedInfo as that is the name of the Element. --- 25,38 ---- * $Id$ * $Log$ + * Revision 1.12 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.11 2004/03/08 23:51:04 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. * All the major elements have been refactored to be cleaner and more correct. ! * <p/> * Revision 1.10 2004/03/02 23:30:44 pelle * Renamed SignatureInfo to SignedInfo as that is the name of the Element. *************** *** 136,180 **** } public final void testEnvelopedUsignRSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature(rsa, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-enveloped-rsa.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } ! public final void testEnvelopingUsignRSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature(rsa, doc.getRootElement(), false); ! final File outputFile = new File("target/testdata/homegrown/signature-enveloping-rsa.xml"); ! XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } ! public final void testEnvelopingUsignDSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature(dsa, doc.getRootElement(), false); ! final File outputFile = new File("target/testdata/homegrown/signature-enveloping-dsa.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } ! public final void testEnvelopedUsignDSAKeyPair() ! throws DocumentException, XMLException, CryptoException { ! // assertTrue("Test if public key is really DSA", dsa.getPublic() instanceof DSAPublicKey); Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature(dsa, doc.getRootElement()); ! ! final File outputFile = new File("target/testdata/homegrown/signature-enveloped-dsa.xml"); ! XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if DSA Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } --- 143,212 ---- } + private void assertValidEnvelopedSignature(Document doc) throws XMLSecurityException { + try { + XMLSignature sig = new EnvelopedSignature(doc.getRootElement()); + } catch (InvalidSignatureException e) { + assertTrue("Signature Failed: " + e.getLocalizedMessage(), false); + } + } + + private void assertInvalidEnvelopedSignature(Document doc) throws XMLSecurityException { + try { + XMLSignature sig = new EnvelopedSignature(doc.getRootElement()); + assertTrue("Invalid Signature Verified", false); + } catch (InvalidSignatureException e) { + assertTrue("Signature Failed", true); + } + } + + private void assertValidEnvelopingSignature(Document doc) throws XMLSecurityException { + try { + XMLSignature sig = new DataObjectSignature(doc.getRootElement()); + } catch (InvalidSignatureException e) { + assertTrue("Signature Failed: " + e.getLocalizedMessage(), false); + } + } + public final void testEnvelopedUsignRSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new EnvelopedSignature(rsa, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-enveloped-rsa.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopedSignature(doc); } ! public final void testEnvelopedUsignDSAKeyPair() ! throws DocumentException, XMLException, CryptoException { ! assertTrue("Test if public key is really DSA", dsa.getPublic() instanceof DSAPublicKey); Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new EnvelopedSignature(dsa, doc.getRootElement()); ! ! final File outputFile = new File("target/testdata/homegrown/signature-enveloped-dsa.xml"); ! XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopedSignature(doc); } ! public final void testEnvelopingUsignRSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new DataObjectSignature(rsa, doc.getRootElement()); ! final File outputFile = new File("target/testdata/homegrown/signature-enveloping-rsa.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopingSignature(doc); } ! public final void testEnvelopingUsignDSAKeyPair() throws DocumentException, XMLException, CryptoException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new DataObjectSignature(dsa, doc.getRootElement()); ! final File outputFile = new File("target/testdata/homegrown/signature-enveloping-dsa.xml"); ! XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopingSignature(doc); } *************** *** 183,190 **** final Document doc = DocumentHelper.parseText(TESTXML); ! XMLSecTools.signElement(doc.getRootElement(), rsa); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement(), rsa.getPublic())); doc.getRootElement().addElement("BadElement"); ! assertTrue("Test that Signature is invalid", !XMLSecTools.verifySignature(doc.getRootElement(), rsa.getPublic())); } --- 215,222 ---- final Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new EnvelopedSignature(rsa, doc.getRootElement()); ! assertValidEnvelopedSignature(doc); doc.getRootElement().addElement("BadElement"); ! assertInvalidEnvelopedSignature(doc); } *************** *** 194,241 **** final Document doc = DocumentHelper.parseText(TESTXML); ! XMLSecTools.signElement(doc.getRootElement(), dsa); ! assertTrue("Test if DSA Signature is valid", XMLSecTools.verifySignature(doc.getRootElement(), dsa.getPublic())); doc.getRootElement().addElement("BadElement"); ! assertTrue("Test that DSA Signature is invalid", !XMLSecTools.verifySignature(doc.getRootElement(), rsa.getPublic())); } public final void testEnvelopedUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature("neu://test", signer, doc.getRootElement(), true); final File outputFile = new File("target/testdata/homegrown/signature-enveloped-signer.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } public final void testEnvelopingUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new XMLSignature("neu://test", signer, doc.getRootElement(), false); final File outputFile = new File("target/testdata/homegrown/signature-enveloping-signer.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } public final void testComplexEnvelopedUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(COMPLEX_XML); ! final XMLSignature sig = new XMLSignature("neu://test", signer, doc.getRootElement(), true); final File outputFile = new File("target/testdata/homegrown/signature-complex-enveloped-signer.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } public final void testComplexEnvelopingUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(COMPLEX_XML); ! final XMLSignature sig = new XMLSignature("neu://test", signer, doc.getRootElement(), false); final File outputFile = new File("target/testdata/homegrown/signature-complex-enveloping-signer.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertTrue("Test if Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); } --- 226,273 ---- final Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new EnvelopedSignature(dsa, doc.getRootElement()); ! assertValidEnvelopedSignature(doc); doc.getRootElement().addElement("BadElement"); ! assertInvalidEnvelopedSignature(doc); } public final void testEnvelopedUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new EnvelopedSignature("neu://test", signer, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-enveloped-signer.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopedSignature(doc); } public final void testEnvelopingUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(TESTXML); ! final XMLSignature sig = new DataObjectSignature("neu://test", signer, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-enveloping-signer.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopingSignature(doc); } public final void testComplexEnvelopedUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(COMPLEX_XML); ! final XMLSignature sig = new EnvelopedSignature("neu://test", signer, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-complex-enveloped-signer.xml"); XMLTools.writeFile(outputFile, doc); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopedSignature(doc); } public final void testComplexEnvelopingUsingSigner() throws DocumentException, XMLException, CryptoException, UserCancellationException { Document doc = DocumentHelper.parseText(COMPLEX_XML); ! final XMLSignature sig = new DataObjectSignature("neu://test", signer, doc.getRootElement()); final File outputFile = new File("target/testdata/homegrown/signature-complex-enveloping-signer.xml"); XMLTools.writeFile(outputFile, sig.getElement()); doc = XMLTools.loadDocument(outputFile); ! assertValidEnvelopingSignature(doc); } --- NEW FILE: InteropTests.java --- package org.neuclear.xml.xmlsec; /** * (C) 2003 Antilles Software Ventures SA * User: pelleb * Date: Feb 3, 2003 * Time: 6:54:20 AM * $Id: InteropTests.java,v 1.1 2004/03/19 22:21:51 pelle Exp $ * $Log: InteropTests.java,v $ * Revision 1.1 2004/03/19 22:21:51 pelle * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: * - Enveloped * - DataObjects - (Enveloping) * - Any for interop testing mainly. * * Revision 1.5 2004/02/19 00:28:00 pelle * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. * * Revision 1.4 2004/01/14 17:07:59 pelle * KeyInfo containing X509Certificates now work correctly. * 10 out of 16 of merlin's tests now work. The missing ones are largely due to key resolution issues. (Read X509) * * Revision 1.3 2004/01/14 16:34:27 pelle * New model of references and signatures now pretty much works. * I am still not 100% sure on the created enveloping signatures. I need to do more testing. * * Revision 1.2 2003/11/21 04:44:31 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. * Otherwise You will Finaliate. * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final. * This should hopefully make everything more stable (and secure). * * Revision 1.1.1.1 2003/11/11 16:33:32 pelle * Moved over from neudist.org * Moved remaining common utilities into commons * * Revision 1.6 2003/10/21 22:30:33 pelle * Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense. * Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy. * Obviously had to perform many changes throughout the code to support these changes. * * Revision 1.5 2003/02/24 14:20:02 pelle * Minor adjustments * * Revision 1.4 2003/02/23 23:21:47 pelle * Yeah. We figured it out. We now have interop. * Granted not on all features as yet, but definitely on simple signatures. * I'm checking in Ramses' fix to QuickEmbeddedSignature and my fixes to the verification process. * * Revision 1.3 2003/02/22 23:19:10 pelle * Additional fixes to the encoding problem. * * Revision 1.2 2003/02/22 16:54:30 pelle * Major structural changes in the whole processing framework. * Verification now supports Enveloping and detached signatures. * The reference element is a lot more important at the moment and handles much of the logic. * Replaced homegrown Base64 with Blackdowns. * Still experiencing problems with decoding foreign signatures. I reall dont understand it. I'm going to have * to reread the specs a lot more and study other implementations sourcecode. * * Revision 1.1 2003/02/21 22:48:19 pelle * New Test Infrastructure * Added test keys in src/testdata/keys * Modified tools to handle these keys * * Revision 1.4 2003/02/11 14:50:25 pelle * Trying onemore time. Added the benchmarking code. * Now generates DigestValue and optionally adds KeyInfo to Signature. * * Revision 1.3 2003/02/08 18:48:38 pelle * The Signature phase has been rewritten. * There now is a new Class called QuickEmbeddedSignature which is more in line with my original idea for this library. * It simply has a template of the xml and signs it in a standard way. * The original XMLSignature class is still used for verification and will in the future handle more thoroughly * all the various flavours of XMLSig. * XMLSecTools has got different flavours of canonicalize now. Including one where you can pass it a Canonicaliser to use. * Of the new Canonicalizer's are CanonicalizerWithComments, which I accidently left out of the last commit. * And CanonicalizerWithoutSignature which leaves out the Signature in the Canonicalization phase and is thus * a lot more efficient than the previous approach. * * Revision 1.2 2003/02/07 22:33:48 pelle * Compliance mostly working. * Merlin's Example 7 hasn't been implemented, but mainly because we havent written the test case yet. * A few of the example c14n files had trailing new lines. I'm not sure what the spec says about that, but I * got rid of them as my implementation doesnt support those. Who is right? * Example 4 has problems with the final element. This seems to be causing problems for lots of people. * To workaround it, I've removed the offending lines from all the files. * TBH I dont understand whats going on with it. Will put it on the back burner and come back. * * Revision 1.1 2003/02/07 21:15:19 pelle * Much improved Canonicalizer and Test Suite. * I've added the merlin-xmldsig-eight Canonicalization test suite. * All tests still dont work. * */ import junit.framework.TestCase; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.RegexFileNameFilter; import java.io.File; import java.io.FileNotFoundException; import java.io.FilenameFilter; import java.io.IOException; public final class InteropTests extends TestCase { public InteropTests(final String s) { super(s); reader = new SAXReader(false); reader.setMergeAdjacentText(false); reader.setStripWhitespaceText(false); reader.setIncludeExternalDTDDeclarations(true); reader.setIncludeInternalDTDDeclarations(true); } // public final void testHomeGrown() throws IOException, DocumentException, NeuClearException { // runDirectoryTest("src/testdata/homegrown"); // } public final void testMerlin23() throws IOException, DocumentException, NeuClearException { runDirectoryTest("src/testdata/merlin-xmldsig-twenty-three", 10);//,"signature-enveloping-dsa\\.xml"); } public final void testPhaos() throws IOException, DocumentException, NeuClearException { runDirectoryTest("src/testdata/phaos-xmldsig-two", 29); } public final void runDirectoryTest(final String path, final int pass) throws DocumentException, IOException, FileNotFoundException, NeuClearException { runDirectoryTest(path, null, pass); } public final void runDirectoryTest(final String path, final String regex, final int pass) throws DocumentException, IOException, FileNotFoundException, NeuClearException { final File dir = new File(path); if (!dir.exists()) { System.out.println("Doesnt exist"); return; } final FilenameFilter filter; if (regex == null) filter = new FilenameFilter() { public boolean accept(final File dirf, final String name) { return name.endsWith(".xml"); } }; else filter = new RegexFileNameFilter(regex); final File[] xmlfiles = dir.listFiles(filter); System.out.println("There are " + xmlfiles.length + " files in the directory"); int errors = 0; int i = 0; for (i = 0; i < xmlfiles.length; i++) { final File xmlfile = xmlfiles[i]; System.out.print("Testing file: " + xmlfile.getName() + "... "); final Document doc = reader.read(xmlfile); System.out.print("root element: " + doc.getRootElement().getQualifiedName() + " ..."); try { if (verifySignature(doc)) System.out.println("Verified"); else System.out.println("FAILED: " + (errors++)); } catch (Exception e) { System.out.println("ERROR: " + (errors++) + e.getMessage()); e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } System.out.println(errors + " out of " + i + " documents failed"); assertTrue("Acheived Pass rate: ", errors <= pass); } private boolean verifySignature(Document doc) throws XMLSecurityException { try { new AnyXMLSignature(doc.getRootElement()); return true; } catch (InvalidSignatureException e) { return false; } } final SAXReader reader; } --- SignatureTests.java DELETED --- --- XMLSignerTest.java DELETED --- |
|
From: Pelle B. <pe...@us...> - 2004-03-19 22:31:42
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19896/src/java/org/neuclear/xml Modified Files: AbstractElementProxy.java Log Message: Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: - Enveloped - DataObjects - (Enveloping) - Any for interop testing mainly. Index: AbstractElementProxy.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/AbstractElementProxy.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AbstractElementProxy.java 2 Mar 2004 23:30:43 -0000 1.11 --- AbstractElementProxy.java 19 Mar 2004 22:21:51 -0000 1.12 *************** *** 2,5 **** --- 2,11 ---- * $Id$ * $Log$ + * Revision 1.12 2004/03/19 22:21:51 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.11 2004/03/02 23:30:43 pelle * Renamed SignatureInfo to SignedInfo as that is the name of the Element. *************** *** 132,135 **** --- 138,142 ---- import org.dom4j.QName; import org.neuclear.xml.xmlsec.XMLSecTools; + import org.neuclear.xml.xmlsec.XMLSecurityException; public abstract class AbstractElementProxy implements ElementProxy { *************** *** 247,252 **** } ! public byte[] canonicalize() throws XMLException { ! return XMLSecTools.canonicalize(this); } /* --- 254,259 ---- } ! public byte[] canonicalize() throws XMLSecurityException { ! return XMLSecTools.canonicalize(element); } /* |
|
From: Pelle B. <pe...@us...> - 2004-03-19 22:31:17
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19769/src/java/org/neuclear/commons/crypto Modified Files: CryptoTools.java Log Message: Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: - Enveloped - DataObjects - (Enveloping) - Any for interop testing mainly. Index: CryptoTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CryptoTools.java 18 Mar 2004 21:31:26 -0000 1.17 --- CryptoTools.java 19 Mar 2004 22:21:24 -0000 1.18 *************** *** 2,5 **** --- 2,11 ---- * $Id$ * $Log$ + * Revision 1.18 2004/03/19 22:21:24 pelle + * Changes in the XMLSignature class, which is now Abstract there are currently 3 implementations for: + * - Enveloped + * - DataObjects - (Enveloping) + * - Any for interop testing mainly. + * * Revision 1.17 2004/03/18 21:31:26 pelle * Some fixups in SignedInfo *************** *** 724,743 **** public static KeyPairGenerator getTinyRSAKeyPairGenerator() throws NoSuchAlgorithmException { ! if (kg == null) { ! kg = KeyPairGenerator.getInstance("RSA"); ! kg.initialize(512, new SecureRandom("Bear it all with NeuDist".getBytes())); } ! return kg; } public static KeyPairGenerator getTinyDSAKeyPairGenerator() throws NoSuchAlgorithmException { ! if (kg == null) { ! kg = KeyPairGenerator.getInstance("DSA"); ! kg.initialize(512, new SecureRandom("Bear it all with NeuDist".getBytes())); } ! return kg; } --- 730,749 ---- public static KeyPairGenerator getTinyRSAKeyPairGenerator() throws NoSuchAlgorithmException { ! if (tkg == null) { ! tkg = KeyPairGenerator.getInstance("RSA"); ! tkg.initialize(512, new SecureRandom("Bear it all with NeuDist".getBytes())); } ! return tkg; } public static KeyPairGenerator getTinyDSAKeyPairGenerator() throws NoSuchAlgorithmException { ! if (tdkg == null) { ! tdkg = KeyPairGenerator.getInstance("DSA"); ! tdkg.initialize(512, new SecureRandom("Bear it all with NeuDist".getBytes())); } ! return tdkg; } *************** *** 868,871 **** --- 874,879 ---- private static KeyPairGenerator kg; private static KeyPairGenerator dkg; + private static KeyPairGenerator tkg; + private static KeyPairGenerator tdkg; public static final String DEFAULT_PBE_ALGORITHM = "PBEWithSHAAnd3-KeyTripleDES-CBC"; public static final String DEFAULT_JCE_PROVIDER = "BC"; |
|
From: Pelle B. <pe...@us...> - 2004-03-18 21:41:14
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12467/src/java/org/neuclear/xml/xmlsec Modified Files: SignedInfo.java Log Message: Some fixups in SignedInfo Index: SignedInfo.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/SignedInfo.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SignedInfo.java 8 Mar 2004 23:51:03 -0000 1.3 --- SignedInfo.java 18 Mar 2004 21:31:33 -0000 1.4 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.4 2004/03/18 21:31:33 pelle + * Some fixups in SignedInfo + * * Revision 1.3 2004/03/08 23:51:03 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 108,111 **** --- 111,115 ---- import org.dom4j.Element; + import org.neuclear.commons.Utility; import org.neuclear.commons.crypto.CryptoException; import org.neuclear.commons.crypto.CryptoTools; *************** *** 115,120 **** import org.neuclear.xml.XMLException; import org.neuclear.xml.c14.Canonicalizer; ! import java.security.*; import java.util.ArrayList; import java.util.Collections; --- 119,128 ---- import org.neuclear.xml.XMLException; import org.neuclear.xml.c14.Canonicalizer; + import org.neuclear.xml.c14.CanonicalizerWithComments; ! import java.security.NoSuchAlgorithmException; ! import java.security.PrivateKey; ! import java.security.PublicKey; ! import java.security.Signature; import java.util.ArrayList; import java.util.Collections; *************** *** 122,126 **** public final class SignedInfo extends AbstractXMLSigElement { ! public SignedInfo(Reference references[], final int sigalg) { this(sigalg, references.length); for (int i = 0; i < references.length; i++) { --- 130,134 ---- public final class SignedInfo extends AbstractXMLSigElement { ! public SignedInfo(Reference references[], final int sigalg) throws XMLSecurityException { this(sigalg, references.length); for (int i = 0; i < references.length; i++) { *************** *** 130,136 **** } ! public SignedInfo(final int sigalg, final int refcount) { super(SignedInfo.TAG_NAME); - this.algType = sigalg; refs = new ArrayList(refcount); --- 138,143 ---- } ! public SignedInfo(final int sigalg, final int refcount) throws XMLSecurityException { super(SignedInfo.TAG_NAME); refs = new ArrayList(refcount); *************** *** 141,147 **** final Element sm = XMLSecTools.createElementInSignatureSpace("SignatureMethod"); if (sigalg == SignedInfo.SIG_ALG_RSA) ! sm.addAttribute("Algorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1"); else ! sm.addAttribute("Algorithm", "http://www.w3.org/2000/09/xmldsig#dsa-sha1"); addElement(sm); --- 148,156 ---- final Element sm = XMLSecTools.createElementInSignatureSpace("SignatureMethod"); if (sigalg == SignedInfo.SIG_ALG_RSA) ! sm.addAttribute("Algorithm", DSIG_ALG_RSA); ! else if (sigalg == SignedInfo.SIG_ALG_DSA) ! sm.addAttribute("Algorithm", DSIG_ALG_DSA); else ! throw new XMLSecurityException("Unsupported Signature algorithm"); addElement(sm); *************** *** 151,166 **** this(sigalg, 1); - final Element cm = XMLSecTools.createElementInSignatureSpace("CanonicalizationMethod"); - cm.addAttribute("Algorithm", "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"); try { - addElement(cm); - - final Element sm = XMLSecTools.createElementInSignatureSpace("SignatureMethod"); - if (sigalg == SignedInfo.SIG_ALG_RSA) - sm.addAttribute("Algorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1"); - else - sm.addAttribute("Algorithm", "http://www.w3.org/2000/09/xmldsig#dsa-sha1"); - - addElement(sm); Reference ref = new Reference(root, enveloped); refs.add(ref); --- 160,164 ---- *************** *** 175,181 **** if (!elem.getQName().equals(XMLSecTools.createQName(TAG_NAME))) throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); - final Element c14elem = elem.element(XMLSecTools.createQName("CanonicalizationMethod")); - if (c14elem != null && c14elem.attributeValue("Algorithm").equals("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")) - c14nType = Canonicalizer.C14NTYPE_WITH_COMMENTS; final List list = elem.elements(XMLSecTools.createQName("Reference")); refs = new ArrayList(list.size()); --- 173,176 ---- *************** *** 229,249 **** final Canonicalizer getCanonicalizer() { ! // if (ref.getSigType() == Reference.XMLSIGTYPE_ENVELOPED) ! // return new CanonicalizerWithoutSignature(); ! // else if (c14nType == Canonicalizer.C14NTYPE_WITH_COMMENTS) ! // return new CanonicalizerWithComments(); return new Canonicalizer(); } ! //TODO Ignore this bit for now final Signature getSignatureAlgorithm() throws XMLSecurityException { try { ! return Signature.getInstance("SHA1withRSA", "BC"); } catch (NoSuchAlgorithmException e) { ! XMLSecTools.rethrowException(e); ! } catch (NoSuchProviderException e) { ! XMLSecTools.rethrowException(e); } - return null; } --- 224,252 ---- final Canonicalizer getCanonicalizer() { ! final Element c14elem = getElement().element(XMLSecTools.createQName("CanonicalizationMethod")); ! if (c14elem != null && c14elem.attributeValue("Algorithm").equals("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")) ! return new CanonicalizerWithComments(); return new Canonicalizer(); } ! // Returns JCE Signature Cipher for SignedInfo final Signature getSignatureAlgorithm() throws XMLSecurityException { + final Element sigElem = getElement().element(XMLSecTools.createQName("SignatureMethod")); + if (sigElem == null) + throw new XMLSecurityException("No SignatureMethod element found"); + + String algname = sigElem.attributeValue("Algorithm"); + if (Utility.isEmpty(algname)) + throw new XMLSecurityException("No algorithm found in SignatureMethod element"); + try { ! if (algname.equals(DSIG_ALG_RSA)) ! return Signature.getInstance(JCE_ALG_RSA); ! if (algname.equals(DSIG_ALG_DSA)) ! return Signature.getInstance(JCE_ALG_DSA); ! throw new XMLSecurityException("Unsupported Signature algorithm: " + algname); } catch (NoSuchAlgorithmException e) { ! throw new XMLSecurityException(e); } } *************** *** 285,294 **** private static final String TAG_NAME = "SignedInfo"; private final List refs; - private int c14nType = 0; - private int algType = 0; public final static int SIG_ALG_RSA = Signer.KEY_RSA; public final static int SIG_ALG_DSA = Signer.KEY_DSA; // private PublicKey pub; } --- 288,300 ---- private static final String TAG_NAME = "SignedInfo"; private final List refs; public final static int SIG_ALG_RSA = Signer.KEY_RSA; public final static int SIG_ALG_DSA = Signer.KEY_DSA; + public final static String DSIG_ALG_RSA = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"; + public final static String DSIG_ALG_DSA = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"; + public final static String JCE_ALG_RSA = "SHA1withRSA"; + public final static String JCE_ALG_DSA = "SHA1withDSA"; + // private PublicKey pub; } |
|
From: Pelle B. <pe...@us...> - 2004-03-18 21:41:06
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12446/src/java/org/neuclear/commons/crypto Modified Files: CryptoTools.java Log Message: Some fixups in SignedInfo Index: CryptoTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CryptoTools.java 8 Mar 2004 23:50:34 -0000 1.16 --- CryptoTools.java 18 Mar 2004 21:31:26 -0000 1.17 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.17 2004/03/18 21:31:26 pelle + * Some fixups in SignedInfo + * * Revision 1.16 2004/03/08 23:50:34 pelle * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. *************** *** 475,479 **** } ! public static Signature getSignatureCipher(final PrivateKey key) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException { Signature sig = null; if (key instanceof RSAPrivateKey) --- 478,482 ---- } ! public static Signature getSignatureCipher(final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException { Signature sig = null; if (key instanceof RSAPrivateKey) |
|
From: <bug...@ve...> - 2004-03-11 23:50:19
|
Message: Work on this issue has been started by Pelle Braendgaard (mailto:pelle@v= eraxpay.com) --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/XMLSIG-6 Here is an overview of the issue: --------------------------------------------------------------------- Key: XMLSIG-6 Summary: SimpleXMLSigTest fails on Enveloped signatures Type: Bug Status: In Progress Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear XMLSig Versions: 0.12 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Thu, 11 Mar 2004 3:37 PM Updated: Thu, 11 Mar 2004 3:38 PM Description: /opt/blackdown-jdk-1.4.1/bin/java -Xdebug -Xnoagent -Djava.compiler=3DNONE = -Xrunjdwp:transport=3Ddt_socket,server=3Dy,suspend=3Dn,address=3D5005 -Dfil= e.encoding=3DUS-ASCII -classpath /opt/blackdown-jdk-1.4.1/jre/lib/jsse.jar:= /opt/blackdown-jdk-1.4.1/jre/lib/sunrsasign.jar:/opt/blackdown-jdk-1.4.1/jr= e/lib/charsets.jar:/opt/blackdown-jdk-1.4.1/jre/lib/javaplugin.jar:/opt/bla= ckdown-jdk-1.4.1/jre/lib/rt.jar:/opt/blackdown-jdk-1.4.1/jre/lib/jce.jar:/o= pt/blackdown-jdk-1.4.1/jre/lib/ext/dnsns.jar:/opt/blackdown-jdk-1.4.1/jre/l= ib/ext/mysql-connector-java-3.0.8-stable-bin.jar:/opt/blackdown-jdk-1.4.1/j= re/lib/ext/sunjce_provider.jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/ldapsec= .jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/localedata.jar:/home/pelleb/code/= neuclear-xmlsig/target/test-classes:/home/pelleb/code/neuclear-xmlsig/targe= t/classes:/usr/share/dom4j/lib/dom4j-1.4.jar:/opt/crypto-120/jars/bcprov-jd= k14-120.jar:/home/pelleb/.maven/repository/servletapi/jars/servletapi-2.3.j= ar:/home/pelleb/.maven/repository/junit/jars/junit-3.8.1.jar:/home/pelleb/c= ode/neuclear-commons/target/test-classes:/home/pelleb/code/neuclear-commons= /target/classes:/opt/hsqldb/lib/hsqldb.jar:/opt/jotm-1.4.3/lib/jotm.jar:/op= t/jotm-1.4.3/lib/jta-spec1_0_1.jar:/opt/jotm-1.4.3/lib/carol.jar:/opt/jotm-= 1.4.3/lib/jotm_jrmp_stubs.jar:/opt/jotm-1.4.3/lib/jts1_0.jar:/opt/jotm-1.4.= 3/lib/objectweb-datasource.jar:/opt/jotm-1.4.3/lib/xapool.jar:/home/pelleb/= .maven/repository/jline/jars/jline-0.8.1.jar:/opt/mysql-connector-java-3.1.= 0-alpha/mysql-connector-java-3.1.0-alpha-bin.jar:/home/pelleb/.maven/reposi= tory/picocontainer/jars/picocontainer-1.0-beta-3.jar:/opt/jakarta-cactus-13= -1.5/lib/cactus-1.5.jar:/opt/jakarta-cactus-13-1.5/lib/commons-httpclient-2= .0-rc2.jar:/opt/jakarta-cactus-13-1.5/lib/httpunit-1.5.3.jar:/opt/jakarta-c= actus-13-1.5/lib/aspectjrt-1.1.1.jar:/opt/jakarta-cactus-13-1.5/lib/nekohtm= l-0.7.4.jar:/home/pelleb/code/waterken/jar/URL/safe/url.jar:/opt/idea/Intel= liJ-IDEA-4.0/lib/idea_rt.jar:/opt/idea/IntelliJ-IDEA-4.0/lib/idea_rt.jar -D= idea.launcher.port=3D7532 -Didea.launcher.library=3D/opt/idea/IntelliJ-IDEA= -4.0/bin/libbreakgen.so com.intellij.rt.execution.application.AppMain com.i= ntellij.rt.execution.junit2.JUnitStarter -ideVersion5 org.neuclear.xml.xmls= ec.SimpleXMLSigTest AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@163 didnt sign th= is signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignRSAKeyPair= (SimpleXMLSigTest.java:145) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@fffffe5e didnt si= gn this signature junit.framework.AssertionFailedError: Test if DSA Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignDSAKeyPair= (SimpleXMLSigTest.java:178) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadRSASignature(SimpleXM= LSigTest.java:186) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) junit.framework.AssertionFailedError: Test if DSA Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadDSASignature(SimpleXM= LSigTest.java:197) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi= s signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsingSigner(Sim= pleXMLSigTest.java:209) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi= s signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testComplexEnvelopedUsingSig= ner(SimpleXMLSigTest.java:229) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-11 23:48:22
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/XMLSIG-6 Here is an overview of the issue: --------------------------------------------------------------------- Key: XMLSIG-6 Summary: SimpleXMLSigTest fails on Enveloped signatures Type: Bug Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear XMLSig Versions: 0.12 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Thu, 11 Mar 2004 3:37 PM Updated: Thu, 11 Mar 2004 3:37 PM Description: /opt/blackdown-jdk-1.4.1/bin/java -Xdebug -Xnoagent -Djava.compiler=3DNONE = -Xrunjdwp:transport=3Ddt_socket,server=3Dy,suspend=3Dn,address=3D5005 -Dfil= e.encoding=3DUS-ASCII -classpath /opt/blackdown-jdk-1.4.1/jre/lib/jsse.jar:= /opt/blackdown-jdk-1.4.1/jre/lib/sunrsasign.jar:/opt/blackdown-jdk-1.4.1/jr= e/lib/charsets.jar:/opt/blackdown-jdk-1.4.1/jre/lib/javaplugin.jar:/opt/bla= ckdown-jdk-1.4.1/jre/lib/rt.jar:/opt/blackdown-jdk-1.4.1/jre/lib/jce.jar:/o= pt/blackdown-jdk-1.4.1/jre/lib/ext/dnsns.jar:/opt/blackdown-jdk-1.4.1/jre/l= ib/ext/mysql-connector-java-3.0.8-stable-bin.jar:/opt/blackdown-jdk-1.4.1/j= re/lib/ext/sunjce_provider.jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/ldapsec= .jar:/opt/blackdown-jdk-1.4.1/jre/lib/ext/localedata.jar:/home/pelleb/code/= neuclear-xmlsig/target/test-classes:/home/pelleb/code/neuclear-xmlsig/targe= t/classes:/usr/share/dom4j/lib/dom4j-1.4.jar:/opt/crypto-120/jars/bcprov-jd= k14-120.jar:/home/pelleb/.maven/repository/servletapi/jars/servletapi-2.3.j= ar:/home/pelleb/.maven/repository/junit/jars/junit-3.8.1.jar:/home/pelleb/c= ode/neuclear-commons/target/test-classes:/home/pelleb/code/neuclear-commons= /target/classes:/opt/hsqldb/lib/hsqldb.jar:/opt/jotm-1.4.3/lib/jotm.jar:/op= t/jotm-1.4.3/lib/jta-spec1_0_1.jar:/opt/jotm-1.4.3/lib/carol.jar:/opt/jotm-= 1.4.3/lib/jotm_jrmp_stubs.jar:/opt/jotm-1.4.3/lib/jts1_0.jar:/opt/jotm-1.4.= 3/lib/objectweb-datasource.jar:/opt/jotm-1.4.3/lib/xapool.jar:/home/pelleb/= .maven/repository/jline/jars/jline-0.8.1.jar:/opt/mysql-connector-java-3.1.= 0-alpha/mysql-connector-java-3.1.0-alpha-bin.jar:/home/pelleb/.maven/reposi= tory/picocontainer/jars/picocontainer-1.0-beta-3.jar:/opt/jakarta-cactus-13= -1.5/lib/cactus-1.5.jar:/opt/jakarta-cactus-13-1.5/lib/commons-httpclient-2= .0-rc2.jar:/opt/jakarta-cactus-13-1.5/lib/httpunit-1.5.3.jar:/opt/jakarta-c= actus-13-1.5/lib/aspectjrt-1.1.1.jar:/opt/jakarta-cactus-13-1.5/lib/nekohtm= l-0.7.4.jar:/home/pelleb/code/waterken/jar/URL/safe/url.jar:/opt/idea/Intel= liJ-IDEA-4.0/lib/idea_rt.jar:/opt/idea/IntelliJ-IDEA-4.0/lib/idea_rt.jar -D= idea.launcher.port=3D7532 -Didea.launcher.library=3D/opt/idea/IntelliJ-IDEA= -4.0/bin/libbreakgen.so com.intellij.rt.execution.application.AppMain com.i= ntellij.rt.execution.junit2.JUnitStarter -ideVersion5 org.neuclear.xml.xmls= ec.SimpleXMLSigTest AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS AlwaysTheSamePassphraseAgent started. DO NOT USE FOR PRODUCTION SERVERS Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@163 didnt sign th= is signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignRSAKeyPair= (SimpleXMLSigTest.java:145) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@fffffe5e didnt si= gn this signature junit.framework.AssertionFailedError: Test if DSA Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsignDSAKeyPair= (SimpleXMLSigTest.java:178) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadRSASignature(SimpleXM= LSigTest.java:186) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) junit.framework.AssertionFailedError: Test if DSA Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testBadDSASignature(SimpleXM= LSigTest.java:197) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi= s signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testEnvelopedUsingSigner(Sim= pleXMLSigTest.java:209) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) Public Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8 didnt sign thi= s signature junit.framework.AssertionFailedError: Test if Signature is valid =09at org.neuclear.xml.xmlsec.SimpleXMLSigTest.testComplexEnvelopedUsingSig= ner(SimpleXMLSigTest.java:229) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at com.intellij.rt.execution.application.AppMain.main(Unknown Source) --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-11 23:46:16
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Thu, 11 Mar 2004 3:34 PM
This has now been added. I have also gotten rid of the CanonicalizerWithoutSignature class and added the EnvelopedSignature transform which is the correct way of handling it.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/XMLSIG-5
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XMLSIG-5
Summary: Add arbitrary Transforms to Reference Elements
Type: New Feature
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear XMLSig
Fix Fors:
0.12
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Thu, 11 Mar 2004 3:30 PM
Updated: Thu, 11 Mar 2004 3:34 PM
Description:
The Transforms are currently not being used. We need to be able to add arbitrary transforms while creating a reference object.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2004-03-11 23:42:15
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://jira.neuclear.org//browse/XMLSIG-5 Here is an overview of the issue: --------------------------------------------------------------------- Key: XMLSIG-5 Summary: Add arbitrary Transforms to Reference Elements Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear XMLSig Fix Fors: 0.12 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Thu, 11 Mar 2004 3:30 PM Updated: Thu, 11 Mar 2004 3:30 PM Description: The Transforms are currently not being used. We need to be able to add arbitrary transforms while creating a reference object. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.neuclear.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2004-03-11 23:39:22
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Thu, 11 Mar 2004 3:27 PM
getReferencedElement() returns the referenced element if there is one.
If there is a URI use getURI.
---------------------------------------------------------------------
View the issue:
http://jira.neuclear.org//browse/XMLSIG-2
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XMLSIG-2
Summary: Add getData() to Reference
Type: New Feature
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear XMLSig
Fix Fors:
0.12
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Fri, 5 Mar 2004 12:13 PM
Updated: Thu, 11 Mar 2004 3:27 PM
Description:
To verify exactly what was signed, we need to have a reference to the original data from Reference.
I am not sure how to do it yet, but will probably take some ideas from JSR105 and simply return the URI, which could be referenced via the XMLSignature class.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.neuclear.org//secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|