You can subscribe to this list here.
2003 |
Jan
|
Feb
(45) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Edwin W. <wo...@us...> - 2005-04-01 14:16:25
|
Update of /cvsroot/cryptix/jce/src/cryptix.jce.provider.elgamal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15210 Modified Files: ElGamalCipher.java Log Message: When an algorithm does not support AlgorithmParameters, Sun specifies that the engineGetParameters function should return null. This function is called by Sun when the unlimited strength jurisdiction policy files are not installed, resulting for the old file in a RuntimeException instead of a InvalidKeyException as expected. Index: ElGamalCipher.java =================================================================== RCS file: /cvsroot/cryptix/jce/src/cryptix.jce.provider.elgamal/ElGamalCipher.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ElGamalCipher.java 28 Mar 2005 14:26:11 -0000 1.11 --- ElGamalCipher.java 1 Apr 2005 14:16:09 -0000 1.12 *************** *** 118,122 **** protected final AlgorithmParameters engineGetParameters() { ! throw new RuntimeException("NYI"); } --- 118,122 ---- protected final AlgorithmParameters engineGetParameters() { ! return null; } |
From: Edwin W. <wo...@us...> - 2005-03-28 15:45:04
|
Update of /cvsroot/cryptix/jce/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1118/doc Modified Files: ChangeLog.txt Log Message: - Fix a bug in cryptix.jce.provider.cipher.Padding where an ArrayIndexOutOfBoundsException could be thrown on a doFinal call during decryption. Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/cryptix/jce/doc/ChangeLog.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ChangeLog.txt 28 Mar 2005 14:44:58 -0000 1.6 --- ChangeLog.txt 28 Mar 2005 15:44:53 -0000 1.7 *************** *** 6,9 **** --- 6,12 ---- - Fix a bug in the PKCS#5 padding to correctly throw a BadPaddingException when it should. (reported by Per Harald Myrvang) + - Fix a bug in cryptix.jce.provider.cipher.Padding where an + ArrayIndexOutOfBoundsException could be thrown on a doFinal call during + decryption. 2004 08 25 |
From: Edwin W. <wo...@us...> - 2005-03-28 15:45:04
|
Update of /cvsroot/cryptix/jce/src/cryptix.jce.provider.cipher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1118/src/cryptix.jce.provider.cipher Modified Files: Padding.java Log Message: - Fix a bug in cryptix.jce.provider.cipher.Padding where an ArrayIndexOutOfBoundsException could be thrown on a doFinal call during decryption. Index: Padding.java =================================================================== RCS file: /cvsroot/cryptix/jce/src/cryptix.jce.provider.cipher/Padding.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Padding.java 28 Mar 2005 14:41:46 -0000 1.19 --- Padding.java 28 Mar 2005 15:44:53 -0000 1.20 *************** *** 121,125 **** final int getOutputSize(int inputLen) { ! return mode.getOutputSize(inputLen + this.getPadSize(inputLen)); } --- 121,129 ---- final int getOutputSize(int inputLen) { ! if (isBuffered) ! return mode.getOutputSize(inputLen + this.getPadSize(inputLen)) ! + blSize; ! else ! return mode.getOutputSize(inputLen + this.getPadSize(inputLen)); } |
From: Edwin W. <wo...@us...> - 2005-03-28 14:45:07
|
Update of /cvsroot/cryptix/jce/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1680 Modified Files: ChangeLog.txt Log Message: Update (also testing the -commits list) Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/cryptix/jce/doc/ChangeLog.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ChangeLog.txt 28 Mar 2005 14:30:11 -0000 1.5 --- ChangeLog.txt 28 Mar 2005 14:44:58 -0000 1.6 *************** *** 2,5 **** --- 2,10 ---- Change Log + 2005 03 28 + + - Fix a bug in the PKCS#5 padding to correctly throw a BadPaddingException when + it should. (reported by Per Harald Myrvang) + 2004 08 25 |
From: <ed...@bo...> - 2003-08-23 23:08:30
|
edwin 03/08/23 19:08:27 Modified: openpgp CHANGELOG.TXT README.TXT build.xml Added: openpgp dist.bat Log: New release. Revision Changes Path 1.25 +1 -1 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- CHANGELOG.TXT 23 Aug 2003 22:17:49 -0000 1.24 +++ CHANGELOG.TXT 23 Aug 2003 23:08:26 -0000 1.25 @@ -1,4 +1,4 @@ -???????? snapshot +20030823 snapshot Incompatible changes - Changed the order of the arguments for the addPrivateKey method in KeyBundle to be more consistent with addPrivateSubKey in PGPKeyBundle. Any application 1.9 +25 -9 projects/openpgp/README.TXT Index: README.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/README.TXT,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- README.TXT 9 Feb 2003 21:23:08 -0000 1.8 +++ README.TXT 23 Aug 2003 23:08:26 -0000 1.9 @@ -68,20 +68,35 @@ numbers. -4. Documentation +4. Installing the policy files + + This section only applies if you are running JDK 1.4+ that comes with the + Sun JCE by default, or JDK 1.2/1.3 if you have installed Sun JCE 1.2 + manually. + + The default distribution of the JCE allows as Sun calls it 'strong, + but limited strength cryptography'. This basically means that you + cannot use RSA keys bigger than 2048 bits, and no symmetric ciphers + that use more than 128 bits. ElGamal is not allowed at all, thus + DH/DSS cannot be used for encryption. + + The solution is to install the Unlimited Strength Jurisdiction + Policy files, which can be downloaded from the following URL (note + that they are listed entirely at the bottom of the page): + + http://java.sun.com/j2se/1.4/download.html + + These files have to be installed in $JAVA_HOME$/jre/lib/security + + +5. Documentation In the released versions, documentation can be found in doc/ - There are several javadoc trees there: - - doc/message/ - documents the Cryptix Message API (see section D below) - - doc/pki/ - documents the Cryptix PKI API (see section C below) - - doc/highlevel/ - documents the High-level interface (contains both the - Message and PKI API's together with some OpenPGP - specific extensions). Example programs can be found in examples/ -5. Support +6. Support A mailing list is available for getting support: the cryptix-users list. Subscription instructions are available at: @@ -202,4 +217,5 @@ F. Contributing If you have anything to contribute, please use the cryptix-users list - (see section 5) or mail me privately: ed...@cr... + (see section 6) or mail me privately: ed...@cr... + \ No newline at end of file 1.28 +1 -1 projects/openpgp/build.xml Index: build.xml =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- build.xml 23 Aug 2003 11:15:47 -0000 1.27 +++ build.xml 23 Aug 2003 23:08:26 -0000 1.28 @@ -59,7 +59,7 @@ <!-- Distribution .......................................................... --> - <target name="dist" depends="clean, compile, test, jars, docs"> + <target name="dist" depends="compile, test, jars, docs"> <zip zipfile="${build.dist}/cryptix-openpgp-${filerelease}.zip"> <zipfileset dir="${basedir}" includes="LICENCE.TXT" /> <zipfileset dir="${basedir}" includes="README.TXT" /> 1.1 projects/openpgp/dist.bat Index: dist.bat =================================================================== call jdk13 call ant clean call jdk12 call antnojit compile call jdk13 call ant dist |
edwin 03/08/23 18:17:50 Modified: openpgp CHANGELOG.TXT openpgp/src/cryptix/openpgp/test/all TestOpenPGP.java openpgp/src/cryptix/openpgp/util PGPArmoury.java Added: openpgp/src/cryptix/openpgp/test/interop PGP5Interop.java openpgp/src/testdata PGP5_cls_DHDSS.asc PGP5_cls_RSA.asc PGP5_enc_DHDSS_sig_RSA.asc PGP5_enc_RSA_sig_DHDSS.asc PGP5_secring.skr PGP5_testkey_DHDSS.asc PGP5_testkey_RSA.asc Log: PGP5 interop testing: - Fixed support for cleartext signed messages that lack the Hash: header. Revision Changes Path 1.24 +1 -0 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- CHANGELOG.TXT 23 Aug 2003 11:37:55 -0000 1.23 +++ CHANGELOG.TXT 23 Aug 2003 22:17:49 -0000 1.24 @@ -31,6 +31,7 @@ - Fixed a nasty bug in the old checksum code for secret keys that would result in failure to decrypt longer RSA keys (I estimate this to happen for RSA keys over 1600 bits). +- Fixed support for cleartext signed messages that lack the Hash: header. 20030205 snapshot 1.16 +2 -1 projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java Index: TestOpenPGP.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TestOpenPGP.java 23 Aug 2003 10:35:57 -0000 1.15 +++ TestOpenPGP.java 23 Aug 2003 22:17:49 -0000 1.16 @@ -1,4 +1,4 @@ -/* $Id: TestOpenPGP.java,v 1.15 2003/08/23 10:35:57 edwin Exp $ +/* $Id: TestOpenPGP.java,v 1.16 2003/08/23 22:17:49 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -27,6 +27,7 @@ public TestSuite suite() { TestSuite all = new TestSuite("All OpenPGP tests"); + all.addTestSuite(cryptix.openpgp.test.interop.PGP5Interop.class); all.addTestSuite(cryptix.openpgp.test.interop.PGP8Interop.class); all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCompareTest.class); 1.1 projects/openpgp/src/cryptix/openpgp/test/interop/PGP5Interop.java Index: PGP5Interop.java =================================================================== /* $Id: PGP5Interop.java,v 1.1 2003/08/23 22:17:49 edwin Exp $ * * Copyright (C) 1999-2003 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General License along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.openpgp.test.interop; import cryptix.message.*; import cryptix.openpgp.*; import cryptix.pki.*; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.*; import java.util.*; public class PGP5Interop extends TestCase { private static final String FS = System.getProperty("file.separator"); private final File _testdir; public PGP5Interop(String name) { super(name); String td = System.getProperty("CRYPTIX_OPENPGP_TESTDIR"); if(td == null || "".equals(td) ) { _testdir = new File("." + FS + "testdata"); } else { _testdir = new File(td + FS + "testdata"); } } protected void setUp() { } protected void tearDown() { } public void testPGP5Interop() throws Exception { FileInputStream in; Collection msgs; KeyBundleMessage kbm; EncryptedMessage em; LiteralMessage lm; SignedMessage sm; Iterator it; KeyBundle prvDHDSS, pubDHDSS, prvRSAleg, pubRSAleg; MessageFactory mf = MessageFactory.getInstance("OpenPGP"); in = new FileInputStream(new File(_testdir, "PGP5_testkey_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); pubDHDSS = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP5_testkey_RSA.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); pubRSAleg = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP5_secring.skr")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvRSAleg = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); prvDHDSS = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP5_enc_DHDSS_sig_RSA.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvDHDSS, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubRSAleg)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "PGP5 Test", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP5_enc_RSA_sig_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvRSAleg, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubDHDSS)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "PGP5 Test", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP5_cls_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); sm = (SignedMessage)msgs.iterator().next(); assertTrue("Correctly signed", sm.verify(pubDHDSS)); lm = (LiteralMessage)sm.getContents(); assertEquals("Signed data", "PGP5 Test", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP5_cls_RSA.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); sm = (SignedMessage)msgs.iterator().next(); assertTrue("Correctly signed", sm.verify(pubRSAleg)); lm = (LiteralMessage)sm.getContents(); assertEquals("Signed data", "PGP5 Test\r\n", lm.getTextData()); } } 1.22 +8 -6 projects/openpgp/src/cryptix/openpgp/util/PGPArmoury.java Index: PGPArmoury.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/util/PGPArmoury.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- PGPArmoury.java 4 Feb 2003 13:23:30 -0000 1.21 +++ PGPArmoury.java 23 Aug 2003 22:17:49 -0000 1.22 @@ -1,4 +1,4 @@ -/* $Id: PGPArmoury.java,v 1.21 2003/02/04 13:23:30 edwin Exp $ +/* $Id: PGPArmoury.java,v 1.22 2003/08/23 22:17:49 edwin Exp $ * * Copyright (C) 1995-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -26,7 +26,7 @@ /** * Methods for armouring and dearmouring of messages and other objects. * - * @version $Revision: 1.21 $ + * @version $Revision: 1.22 $ * @author Jill Baker * @author Ian Brown * @author Gary Howland @@ -290,14 +290,16 @@ "-----BEGIN PGP SIGNED MESSAGE-----\r\n" )) != -1) { // Get clear text section - startPos += 38; + startPos += 36; int sigPos = armouredMessage.indexOf( "\r\n-----BEGIN PGP SIGNATURE-----\r\n", startPos ); // Now deal with headers - msgPos = armouredMessage.indexOf( "\r\n\r\n", startPos ); - propString = armouredMessage.substring( startPos, msgPos ); - stringToHeaders( propString, clearheaders ); + msgPos = armouredMessage.indexOf( "\r\n\r\n", startPos-2 ); + if (msgPos > startPos) { + propString = armouredMessage.substring( startPos, msgPos ); + stringToHeaders( propString, clearheaders ); + } String text = armouredMessage.substring( msgPos + 4, sigPos ); 1.1 projects/openpgp/src/testdata/PGP5_cls_DHDSS.asc Index: PGP5_cls_DHDSS.asc =================================================================== -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 PGP5 Test -----BEGIN PGP SIGNATURE----- Version: PGP 5.0 Charset: noconv iQA/AwUBP0fcJRNWsa3JXa5QEQLflACg8pMS12Hhl/Mxqg1msf5Z/OgTJlsAoLr/ gsTJuErTlrAhNGTMqp7gzmpw =Vs38 -----END PGP SIGNATURE----- 1.1 projects/openpgp/src/testdata/PGP5_cls_RSA.asc Index: PGP5_cls_RSA.asc =================================================================== -----BEGIN PGP SIGNED MESSAGE----- PGP5 Test -----BEGIN PGP SIGNATURE----- Version: PGP 5.0 Charset: noconv iQEVAwUBP0fcfMB94gnosg+tAQH/gAf/cCeNfl4D3uWYXZWQeQAbpIeSpAnRrGAe 0r013RLOn14Kmz7gstQU3s3px0w8EiYE4QKo/5VkB47opEg/IQOqzYOEdBKaTWY7 x8kTxxrfV9AnT7qlGH0EuoHCtKfdrS1j5ZSWV0S7YbFRDvH6ClEtRzSinAulVuo+ bppWztUuzBsDWVdolvUpWRPy23+9w91en5fc24Ucr3JBj3OOX7XDNBUTMK6yhj2A p0vAZDrRmnsMMpp0z0lVvHB3OmSqlKWvfQAvRiL+ZyWGlMBH4fRo2uzmWFNFGTFE iGQpN7HAnJ0mmmZNT50bjY3UJt1v1DNXHM+wnWGMDYhCIzfFRU2Edg== =9O+i -----END PGP SIGNATURE----- 1.1 projects/openpgp/src/testdata/PGP5_enc_DHDSS_sig_RSA.asc Index: PGP5_enc_DHDSS_sig_RSA.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP 5.0 MessageID: MKP1D1aGUp85rh+pO3FRVBlaVlp0Stx1 qANQR1DBwU4D6xND7T8c6hMQB/40m5gHJJQ+1iO2IZoogRMCJWf9B8xXGjjuijUm bsDmzLtBrQa6DlXwbB4yJovfOnEJ1raTgO39GRe4Bk3yeyqerrdfq6ZH15to7ErI SuaGmTv9k5B2GMEdtIUnwRKFMxNVx+Wgexfwa/VQ3k6yOFqRO832uoMmW2RQnaRL O4Xoqs41A/qqC3aebX2K296XiCLOUSjaL4qv2wY6gUjoW82fx7an76P7X7f/SNha 0S5+F1ROulX4+tTJ/1DILnZ0iI73Vrw3S8O8WgxYQ4jdWvytsTHbSHT/rX8EEypJ 92w/P7gqkB369+Q6m7XaM0GX+xgseVtStI875onSbwqdEMNnCADYoZHfoD6Pp4MC Hof4+bMV9ZTrB322aIgYX00ZDFVsMTbjsNWM+I2bpR3WxQeqYJY+pejRe1mPN0cg A/lTYmLLJXASzKY8ZDaLcFCS2yjOEStaS2JQEKhgkjnX7ZGZG9LdBPRrJyAVeAG4 JWdei24TqurLBTbZP56n6beElAac9BRQtE9DsTZcmqG5A/R0PePwRNhQgIHH3lvM 11rSboD+n+ygGJoQSlI+2C8oIjdhBXSnNYzJQrwqcJ8Y230Kt5Fnx+RNHHYxbCQB KhnbNLgI1DraY9tH+Gq6Zd7gnpJcBmFyrwoeKhVnwF9t4J+pUlPyzGqO6RxU0vMO 559dnD+UycCQIf64l0dNbV07Ay4gRIzZ/iQwNyHI1DhGtsy66R5HqF4vSynB4r1G 9GuqvdqZQsFG9Rv5dAVUAoijRDA34I7E0Xc33Oti8YdkO9deJk7nPEm/f9vWTxVy qEOOGDaPrIodA+LIlZ31my1sdH7YzRkscua+KmpnomMMOAIlR7tpTonBVuCanKJ8 rKKfAlVG3KUORW2PSY+ZKm8musqlCtl57xRlMftKPTP2sfbG4gd2o6UmUWC+iFYt SS2WxgxtCBDyVxTQ1SJr8FEE0+JepTIW81miYRaF6CycJYPxWzNiGhvOuP2e2pN/ +2jRe0fcgwo3jEj+AFQn2O2GpZ8AwcK3xlh0ezRR4M+kXt3ObtNZNT9PdtliR1ER O6j9FYLzzPmXAbEMdMoJ8DXW5O4RXk3U2X7nWbH/3GifPe4cEknBwFsgdh6N+sn5 jA9y2LMsePE8 =WOKP -----END PGP MESSAGE----- 1.1 projects/openpgp/src/testdata/PGP5_enc_RSA_sig_DHDSS.asc Index: PGP5_enc_RSA_sig_DHDSS.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP for Personal Privacy 5.0 MessageID: mnhUClrdB3uT/I+WxF2j1BAeO4VVL1mD hQEMA8B94gnosg+tAQf/QNdG1w4z8Uo9E//ZE2kYbf00JnsVOuQZ9BfqBQJoUV/v ZQimd37q8DQ5Y6RoDKP+BpnFwYUbJJCgoQ43PKGz+jBSnO1lvHAPnvMaZ9Kdrs5+ 4evWOjsVOKMk/qts7mKt2pZIF62ic1lAFoB6JXDQOvW0IvMCrcGYX83wcCoLlvxD +KgF9JOgwMBpQlbDN/y+22WWjECLsPwLyHmQFQnt2+JVcS6686EMzak+EXTT4rhW gC8VJWtcxswuhCsExyNkFpZyvhqMlhyPFOS9SAymmMbldPQonXs7b1GDU+KUC+ki +73RevkvGkamIxLUTI3orXpCc7EQxaXfjoQhDvgPQqRpCMwLeHp3AZ6cixqKPBCK HXuymtt9YnRmU/I8DVfqwdN8xkgUX3LZ/VoeSt4q5dusGVeU4CAi09uVBB+9UbYv UjqK7Ot5z/fF+W8wTlN3PInL0Jo+gKenJ3LV7FajHhT7f0HCALhwdJRB =cnfs -----END PGP MESSAGE----- 1.1 projects/openpgp/src/testdata/PGP5_testkey_DHDSS.asc Index: PGP5_testkey_DHDSS.asc =================================================================== -----BEGIN PGP PUBLIC KEY BLOCK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roOPGoYdaBc3N W0qJJ+WggbgkfzaUz8HIp49unif6D06SEIHmwhtenbv+PDBSlVMUnqJLvloxL3A3 AMhut6Y8Nm3ILx/L1ufdC2/0W7DJp6m3mBYEP3UyEHZ4cfLtgz755RKR5n3lClJX 2fBQ4Y7wf/lZqEntV9yPkPxMAJokFf4ekAo3tUFYeiJ1P2q9nQGzUGObGMimLW/d w163J95LXa9WiJXVv7Px5EkfR2nr6NfXRNPDrmBI7Fg4ooA+qWPeo1EltddcYyqb rpM6OMMidDxC/dLyDqHPr6QhVeCfsgkdlLmQE56DFwjBNGzogy7oGCz9iQA/AwUY P0fY+BNWsa3JXa5QEQIClQCfZ3p64XlGRwKLLwCtmVO5JJqm68UAn1kGy2TS3foD 187Rj1tCVJo3ZOOr =VAxD -----END PGP PUBLIC KEY BLOCK----- 1.1 projects/openpgp/src/testdata/PGP5_testkey_RSA.asc Index: PGP5_testkey_RSA.asc =================================================================== -----BEGIN PGP PUBLIC KEY BLOCK----- Version: PGP 5.0 mQENAz9H2SYAAAEIAKAdbGbiPN8zfDqqAFnNoers8DwQEnBSm3soTT4jNxUQCgk7 sVTxqkqcM16jP3eA3pVN93sYj1LecbJ8gJ2gj6VZ53/CP/dNfgxKOKX93oLlKnFu qyCy1EgTxs1CAZ/Huq9Hm29ZmumCfMWRlp0ey4kNfpgPsTGxbNAXK2CwJ5SDg/NV Eoa8s/r3xfa6L4IbFCVeGjaV+laWMawjArYK8Cp0Us6XQ9EAZhP0jDYRL+aBdYTj fQpNx6H3XJ2z2oTf9L+N74VRsxtb0DX90icPi0Tv3QJrjNI9YpQ6NZQwnEhVON4t V0kc56rN9UZwhuF35Ne8dfgH5j5GwH3iCeiyD60ABRG0E1BHUDUgdGVzdGtleSBS U0EgPD6JARUDBRA/R9kmwH3iCeiyD60BAfqkCACA+cC8KaaYTAiUrZkThy/vW5In MYJJlOaifDoqn8TQAK+JeOeUWZ+oUlXP/V+VvSmChOJptDfJ2XBhEDWHcz64ogE7 Lb951msuavJyEUX7mKOlKxMvXCskcdHmGYozTLLRqOe/0qUVBt10lnq407lD54wc +B10KgpCPksvEUhpZElSnlYB2SYM6kjJ+bSOtKVQHIGjsBUFlf9qgz4krPllr8Xx aq7J1hxekqaFSQlr0isn/pJcB6lUzoLYgvD8MMvl4+JiELr16zz3LpjGgR0bDfB0 b2GSryrcWZdCuCrO+9biR9nutjj1IphjdrNTCrG+H/6HF53wCSz5FG+zeF0A =aDPI -----END PGP PUBLIC KEY BLOCK----- |
From: <ed...@bo...> - 2003-08-23 11:51:58
|
edwin 03/08/23 07:19:04 Modified: openpgp/src/cryptix/openpgp/test/packet PGPCompressedDataPacketTest.java Log: Formatting. Revision Changes Path 1.6 +9 -6 projects/openpgp/src/cryptix/openpgp/test/packet/PGPCompressedDataPacketTest.java Index: PGPCompressedDataPacketTest.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/packet/PGPCompressedDataPacketTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PGPCompressedDataPacketTest.java 30 Jan 2003 13:16:32 -0000 1.5 +++ PGPCompressedDataPacketTest.java 23 Aug 2003 11:19:03 -0000 1.6 @@ -1,4 +1,4 @@ -/* $Id: PGPCompressedDataPacketTest.java,v 1.5 2003/01/30 13:16:32 edwin Exp $ +/* $Id: PGPCompressedDataPacketTest.java,v 1.6 2003/08/23 11:19:03 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. @@ -36,8 +36,8 @@ * PGPCompressedDataPacket extends cryptix.openpgp.packet.PGPContainerPacket <br> * * @author Erwin van der Koogh er...@cr... - Cryptix Foundation - * @date $Date: 2003/01/30 13:16:32 $ - * @version $Revision: 1.5 $ + * @date $Date: 2003/08/23 11:19:03 $ + * @version $Revision: 1.6 $ * * @see cryptix.openpgp.packet.PGPCompressedDataPacket */ @@ -122,7 +122,8 @@ p.setAlgorithmID(ints[i]); setUpPacketAndMemory(p); ByteArrayOutputStream buf = new ByteArrayOutputStream(); - PGPPacketDataOutputStream pout = new PGPPacketDataOutputStream(buf, COMPRESSED_DATA_PACKET_ID); + PGPPacketDataOutputStream pout = new PGPPacketDataOutputStream(buf, + COMPRESSED_DATA_PACKET_ID); p.encodeBody(pout); pout.close(); // This step is essential @@ -134,8 +135,10 @@ assertTrue(raw.length > 0); ByteArrayInputStream in = new ByteArrayInputStream(raw); - PGPPacket p2 = PGPPacketFactory.getDefaultInstance().readPacket(in, PGPAlgorithmFactory.getDefaultInstance()); - assertTrue("Factory returned wrong kind of packet", p2 instanceof PGPCompressedDataPacket); + PGPPacket p2 = PGPPacketFactory.getDefaultInstance().readPacket(in, + PGPAlgorithmFactory.getDefaultInstance()); + assertTrue("Factory returned wrong kind of packet", + p2 instanceof PGPCompressedDataPacket); assertTrue(memory.size() > 0); // the factory should have called decode for us... |
From: <ed...@bo...> - 2003-08-23 11:37:59
|
edwin 03/08/23 07:37:56 Modified: openpgp CHANGELOG.TXT openpgp/src/cryptix/openpgp/provider PGPDetachedSignatureMessageImpl.java PGPMessageFactory.java openpgp/src/cryptix/openpgp/test/interop PGP8Interop.java Added: openpgp/src/testdata PGP8_sig_DHDSS.pgp PGP8_sig_RSAleg.pgp PGP8_sig_RSAnew.pgp Log: More PGP8 interop testing: - Fixed support for stand alone signed messages that did not use a OnePassSignature packet. Revision Changes Path 1.23 +2 -0 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- CHANGELOG.TXT 23 Aug 2003 10:14:08 -0000 1.22 +++ CHANGELOG.TXT 23 Aug 2003 11:37:55 -0000 1.23 @@ -23,6 +23,8 @@ - Fixed a NullPointerException in PGPSignedMessageImpl for encrypted and signed messages that did not use a OnePassSignature packet (these messages are generated by PGP when encrypting to a Legacy RSA key). +- Fixed support for stand alone signed messages that did not use a + OnePassSignature packet. - Encryption to keys that only have one key (that is used for both signing and encryption) is now supported. - Added support for the new SHA-1 based checksum for encrypting secret keys. 1.2 +13 -1 projects/openpgp/src/cryptix/openpgp/provider/PGPDetachedSignatureMessageImpl.java Index: PGPDetachedSignatureMessageImpl.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPDetachedSignatureMessageImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PGPDetachedSignatureMessageImpl.java 27 Dec 2001 14:40:28 -0000 1.1 +++ PGPDetachedSignatureMessageImpl.java 23 Aug 2003 11:37:55 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id: PGPDetachedSignatureMessageImpl.java,v 1.1 2001/12/27 14:40:28 edwin Exp $ +/* $Id: PGPDetachedSignatureMessageImpl.java,v 1.2 2003/08/23 11:37:55 edwin Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. @@ -33,7 +33,7 @@ * Represents a detached signature. * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class PGPDetachedSignatureMessageImpl extends PGPDetachedSignatureMessage @@ -58,6 +58,18 @@ this.pkt = pkt; } + +// Own methods +// .......................................................................... + + /** + * Return the contained packet. + */ + public PGPSignaturePacket getPacket() + { + return pkt; + } + // Verify methods // .......................................................................... 1.4 +43 -9 projects/openpgp/src/cryptix/openpgp/provider/PGPMessageFactory.java Index: PGPMessageFactory.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPMessageFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPMessageFactory.java 4 Feb 2003 13:22:56 -0000 1.3 +++ PGPMessageFactory.java 23 Aug 2003 11:37:55 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPMessageFactory.java,v 1.3 2003/02/04 13:22:56 edwin Exp $ +/* $Id: PGPMessageFactory.java,v 1.4 2003/08/23 11:37:55 edwin Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. @@ -53,7 +53,7 @@ * Service provider interface for MessageFactory * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class PGPMessageFactory extends MessageFactorySpi { @@ -250,20 +250,54 @@ Enumeration en = ((PGPCompressedDataPacket)pkt).listPackets(); Object obj = en.nextElement(); - if (! (obj instanceof PGPLiteralDataPacket)) { - throw new MessageException("Invalid message format."); - } - PGPLiteralMessageImpl lm = new PGPLiteralMessageImpl( + if (obj instanceof PGPSignaturePacket) + { + Object obj2 = en.nextElement(); + + if (! (obj2 instanceof PGPLiteralDataPacket)) { + throw new MessageException("Invalid message format."); + } + + PGPSignedMessageImpl sm = new PGPSignedMessageImpl( + (PGPSignaturePacket)obj, new PGPLiteralMessageImpl( + (PGPLiteralDataPacket)obj2)); + + result.add(sm); + + } else { + + if (! (obj instanceof PGPLiteralDataPacket)) { + throw new MessageException("Invalid message format."); + } + + PGPLiteralMessageImpl lm = new PGPLiteralMessageImpl( (PGPLiteralDataPacket)obj); - result.add(lm); - + result.add(lm); + } + } else if (pkt instanceof PGPLiteralDataPacket) { PGPLiteralMessageImpl lm = new PGPLiteralMessageImpl( (PGPLiteralDataPacket)pkt); - result.add(lm); + + if ((result.size() > 0) && (result.elementAt(result.size()-1) + instanceof PGPDetachedSignatureMessageImpl)) + { + + PGPDetachedSignatureMessageImpl dsm = + (PGPDetachedSignatureMessageImpl) + result.remove(result.size() - 1); + PGPSignedMessageImpl sm = new PGPSignedMessageImpl( + dsm.getPacket(), lm); + result.add(sm); + + } else { + + result.add(lm); + + } } else if (pkt instanceof PGPSignaturePacket) { 1.2 +28 -1 projects/openpgp/src/cryptix/openpgp/test/interop/PGP8Interop.java Index: PGP8Interop.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/interop/PGP8Interop.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PGP8Interop.java 23 Aug 2003 10:35:58 -0000 1.1 +++ PGP8Interop.java 23 Aug 2003 11:37:55 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id: PGP8Interop.java,v 1.1 2003/08/23 10:35:58 edwin Exp $ +/* $Id: PGP8Interop.java,v 1.2 2003/08/23 11:37:55 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. @@ -61,6 +61,7 @@ Iterator it; KeyBundle prvDHDSS, pubDHDSS, prvRSAleg, pubRSAleg, prvRSAnew, pubRSAnew; MessageFactory mf = MessageFactory.getInstance("OpenPGP"); + in = new FileInputStream(new File(_testdir, "PGP8_testkey_DHDSS.asc")); msgs = mf.generateMessages(in); @@ -89,6 +90,7 @@ pubRSAnew = kbm.getKeyBundle(); in.close(); + in = new FileInputStream(new File(_testdir, "PGP8_enc_DHDSS_sig_RSAleg.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); @@ -115,6 +117,31 @@ assertTrue("Correctly signed", sm.verify(pubRSAnew)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); + + + in = new FileInputStream(new File(_testdir, "PGP8_sig_DHDSS.pgp")); + msgs = mf.generateMessages(in); + it = msgs.iterator(); + sm = (SignedMessage)msgs.iterator().next(); + assertTrue("Correctly signed", sm.verify(pubDHDSS)); + lm = (LiteralMessage)sm.getContents(); + assertEquals("Signed data", "Hello", lm.getTextData()); + + in = new FileInputStream(new File(_testdir, "PGP8_sig_RSAnew.pgp")); + msgs = mf.generateMessages(in); + it = msgs.iterator(); + sm = (SignedMessage)msgs.iterator().next(); + assertTrue("Correctly signed", sm.verify(pubRSAnew)); + lm = (LiteralMessage)sm.getContents(); + assertEquals("Signed data", "Hello", lm.getTextData()); + + in = new FileInputStream(new File(_testdir, "PGP8_sig_RSAleg.pgp")); + msgs = mf.generateMessages(in); + it = msgs.iterator(); + sm = (SignedMessage)msgs.iterator().next(); + assertTrue("Correctly signed", sm.verify(pubRSAleg)); + lm = (LiteralMessage)sm.getContents(); + assertEquals("Signed data", "Hello", lm.getTextData()); } |
From: <ed...@bo...> - 2003-08-23 11:31:56
|
edwin 03/08/23 07:17:45 Modified: openpgp/src/cryptix/openpgp/packet PGPCompressedDataPacket.java Log: Now (hopefully) really fix all zlib problems. Revision Changes Path 1.14 +7 -3 projects/openpgp/src/cryptix/openpgp/packet/PGPCompressedDataPacket.java Index: PGPCompressedDataPacket.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/packet/PGPCompressedDataPacket.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- PGPCompressedDataPacket.java 23 Aug 2003 06:36:05 -0000 1.13 +++ PGPCompressedDataPacket.java 23 Aug 2003 11:17:45 -0000 1.14 @@ -1,4 +1,4 @@ -/* $Id: PGPCompressedDataPacket.java,v 1.13 2003/08/23 06:36:05 edwin Exp $ +/* $Id: PGPCompressedDataPacket.java,v 1.14 2003/08/23 11:17:45 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. @@ -17,6 +17,7 @@ import cryptix.openpgp.io.PGPCompressorInputStream; import cryptix.openpgp.io.PGPCompressorOutputStream; +import cryptix.openpgp.io.PGPInputStreamAdapter; import cryptix.openpgp.io.PGPOutputStreamAdapter; import cryptix.openpgp.io.PGPPacketDataInputStream; import cryptix.openpgp.io.PGPPacketDataOutputStream; @@ -45,7 +46,7 @@ * @see cryptix.openpgp.packet.PGPPacketFactory * * @author Mathias Kolehmainen (ri...@ro...) - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ */ public class PGPCompressedDataPacket extends PGPContainerPacket { @@ -132,7 +133,10 @@ PGPCompressorInputStream expander; try { PGPCompressor cp = factory.getCompressionAlgorithm(alg); - expander = cp.getExpansionStream(new PGPZLibInputStreamAdapter(in)); + if (cp.needsDummy()) + expander = cp.getExpansionStream(new PGPZLibInputStreamAdapter(in)); + else + expander = cp.getExpansionStream(new PGPInputStreamAdapter(in)); } catch (NoSuchAlgorithmException nsae) { in.readByteArray(); throw new PGPDataFormatException("id not found - "+nsae); |
From: <ed...@bo...> - 2003-08-23 11:17:32
|
edwin 03/08/23 07:17:30 Modified: openpgp/src/cryptix/openpgp/algorithm PGPCompressor.java PGPDeflate.java PGPUncompressed.java Log: Now (hopefully) really fix all zlib problems. Revision Changes Path 1.9 +5 -2 projects/openpgp/src/cryptix/openpgp/algorithm/PGPCompressor.java Index: PGPCompressor.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/algorithm/PGPCompressor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PGPCompressor.java 9 Aug 2001 21:19:47 -0000 1.8 +++ PGPCompressor.java 23 Aug 2003 11:17:30 -0000 1.9 @@ -1,4 +1,4 @@ -/* $Id: PGPCompressor.java,v 1.8 2001/08/09 21:19:47 edwin Exp $ +/* $Id: PGPCompressor.java,v 1.9 2003/08/23 11:17:30 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -32,7 +32,7 @@ * @see cryptix.openpgp.algorithm.PGPAlgorithmFactory * * @author Mathias Kolehmainen (ri...@ro...) - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public interface PGPCompressor { @@ -55,4 +55,7 @@ PGPCompressorInputStream getExpansionStream(InputStream in); + + boolean needsDummy(); + } 1.2 +6 -2 projects/openpgp/src/cryptix/openpgp/algorithm/PGPDeflate.java Index: PGPDeflate.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/algorithm/PGPDeflate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PGPDeflate.java 26 Aug 2001 19:20:20 -0000 1.1 +++ PGPDeflate.java 23 Aug 2003 11:17:30 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id: PGPDeflate.java,v 1.1 2001/08/26 19:20:20 edwin Exp $ +/* $Id: PGPDeflate.java,v 1.2 2003/08/23 11:17:30 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -34,7 +34,7 @@ * * @author Mathias Kolehmainen (ri...@ro...) * @author Edwin Woudt (ed...@cr...) - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public abstract class PGPDeflate implements PGPCompressor { @@ -126,6 +126,10 @@ public PGPCompressorInputStream getExpansionStream(InputStream in) { return(new ZlibIn(new InflaterInputStream(in, createInflater()))); + } + + public boolean needsDummy() { + return nowrap; } 1.9 +7 -2 projects/openpgp/src/cryptix/openpgp/algorithm/PGPUncompressed.java Index: PGPUncompressed.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/algorithm/PGPUncompressed.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PGPUncompressed.java 22 Apr 2002 17:42:09 -0000 1.8 +++ PGPUncompressed.java 23 Aug 2003 11:17:30 -0000 1.9 @@ -1,4 +1,4 @@ -/* $Id: PGPUncompressed.java,v 1.8 2002/04/22 17:42:09 edwin Exp $ +/* $Id: PGPUncompressed.java,v 1.9 2003/08/23 11:17:30 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. @@ -24,7 +24,7 @@ * Implements the "no compression" algorithm. * * @author Mathias Kolehmainen (ri...@ro...) - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class PGPUncompressed implements PGPCompressor { @@ -84,4 +84,9 @@ } + public boolean needsDummy() { + return false; + } + + } |
From: <ed...@bo...> - 2003-08-23 11:15:50
|
edwin 03/08/23 07:15:47 Modified: openpgp build.xml Log: Fix typo. Revision Changes Path 1.27 +1 -1 projects/openpgp/build.xml Index: build.xml =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- build.xml 16 Feb 2003 11:02:03 -0000 1.26 +++ build.xml 23 Aug 2003 11:15:47 -0000 1.27 @@ -281,7 +281,7 @@ <target name="ex_enc" depends="ex_Encrypt" /> <target name="ex_Encrypt" depends="compile"> <java classpath = "${classpath}" - classname = "cryptix.openpgp.examples." + classname = "cryptix.openpgp.examples.Encrypt" fork = "true" failonerror = "true" /> |
From: <ed...@bo...> - 2003-08-23 10:36:01
|
edwin 03/08/23 06:35:58 Modified: openpgp/src/cryptix/openpgp/test/all TestOpenPGP.java Added: openpgp/src/cryptix/openpgp/test/interop PGP8Interop.java Removed: openpgp/src/cryptix/openpgp/test/interop PGP8ReadKeyAndDecryptTest.java Log: Rename the PGP8 tests to PGP8Interop.java. Re-enable all tests that got accidentally disabled. Revision Changes Path 1.15 +4 -4 projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java Index: TestOpenPGP.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- TestOpenPGP.java 23 Aug 2003 10:14:09 -0000 1.14 +++ TestOpenPGP.java 23 Aug 2003 10:35:57 -0000 1.15 @@ -1,4 +1,4 @@ -/* $Id: TestOpenPGP.java,v 1.14 2003/08/23 10:14:09 edwin Exp $ +/* $Id: TestOpenPGP.java,v 1.15 2003/08/23 10:35:57 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -27,8 +27,8 @@ public TestSuite suite() { TestSuite all = new TestSuite("All OpenPGP tests"); - all.addTestSuite(cryptix.openpgp.test.interop.PGP8ReadKeyAndDecryptTest.class); -/* all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); + all.addTestSuite(cryptix.openpgp.test.interop.PGP8Interop.class); + all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCompareTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCRCTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPMPITest.class); @@ -44,7 +44,7 @@ all.addTestSuite(cryptix.openpgp.test.provider.PGPUserIDPrincipalBuilderTest.class); all.addTestSuite(cryptix.openpgp.test.net.HkpTest.class); all.addTestSuite(cryptix.openpgp.test.net.PGPKeyServerImplTest.class); -*/ return all; + return all; } 1.1 projects/openpgp/src/cryptix/openpgp/test/interop/PGP8Interop.java Index: PGP8Interop.java =================================================================== /* $Id: PGP8Interop.java,v 1.1 2003/08/23 10:35:58 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General License along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.openpgp.test.interop; import cryptix.message.*; import cryptix.openpgp.*; import cryptix.pki.*; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.*; import java.util.*; public class PGP8Interop extends TestCase { private static final String FS = System.getProperty("file.separator"); private final File _testdir; public PGP8Interop(String name) { super(name); String td = System.getProperty("CRYPTIX_OPENPGP_TESTDIR"); if(td == null || "".equals(td) ) { _testdir = new File("." + FS + "testdata"); } else { _testdir = new File(td + FS + "testdata"); } } protected void setUp() { } protected void tearDown() { } public void testPGP8Interop() throws Exception { FileInputStream in; Collection msgs; KeyBundleMessage kbm; EncryptedMessage em; LiteralMessage lm; SignedMessage sm; Iterator it; KeyBundle prvDHDSS, pubDHDSS, prvRSAleg, pubRSAleg, prvRSAnew, pubRSAnew; MessageFactory mf = MessageFactory.getInstance("OpenPGP"); in = new FileInputStream(new File(_testdir, "PGP8_testkey_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvDHDSS = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubDHDSS = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_testkey_RSA_legacy.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvRSAleg = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubRSAleg = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_testkey_RSA_new.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvRSAnew = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubRSAnew = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_enc_DHDSS_sig_RSAleg.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvDHDSS, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubRSAleg)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP8_enc_RSAnew_sig_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvRSAnew, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubDHDSS)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP8_enc_RSAleg_sig_RSAnew.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvRSAleg, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubRSAnew)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); } } |
edwin 03/08/23 06:14:10 Modified: openpgp CHANGELOG.TXT openpgp/src/cryptix/openpgp/packet PGPKeyPacket.java openpgp/src/cryptix/openpgp/provider PGPEncryptedMessageImpl.java openpgp/src/cryptix/openpgp/test/all TestOpenPGP.java Added: openpgp/src/cryptix/openpgp/test/interop PGP8ReadKeyAndDecryptTest.java openpgp/src/testdata PGP8_enc_DHDSS_sig_RSAleg.asc PGP8_enc_RSAleg_sig_RSAnew.asc PGP8_enc_RSAnew_sig_DHDSS.asc PGP8_testkey_DHDSS.asc PGP8_testkey_RSA_legacy.asc PGP8_testkey_RSA_new.asc Log: PGP 8 interoperability testing resulted in quite a few bugfixes and new features implemented: - Added support for reading and decrypting Legacy RSA keys. - Fixed a NullPointerException in PGPSignedMessageImpl for encrypted and signed messages that did not use a OnePassSignature packet (these messages are generated by PGP when encrypting to a Legacy RSA key). - Encryption to keys that only have one key (that is used for both signing and encryption) is now supported. - Added support for the new SHA-1 based checksum for encrypting secret keys. - Fixed a nasty bug in the old checksum code for secret keys that would result in failure to decrypt longer RSA keys (I estimate this to happen for RSA keys over 1600 bits). Revision Changes Path 1.22 +11 -0 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- CHANGELOG.TXT 23 Aug 2003 06:36:04 -0000 1.21 +++ CHANGELOG.TXT 23 Aug 2003 10:14:08 -0000 1.22 @@ -19,6 +19,17 @@ - Included better error messages for when the Unlimited Strength Jurisdiction Policy Files are not installed. - Fixed the clone() method of PGPKeyBundleImpl. +- Added support for reading and decrypting Legacy RSA keys. +- Fixed a NullPointerException in PGPSignedMessageImpl for encrypted and signed + messages that did not use a OnePassSignature packet (these messages are + generated by PGP when encrypting to a Legacy RSA key). +- Encryption to keys that only have one key (that is used for both signing and + encryption) is now supported. +- Added support for the new SHA-1 based checksum for encrypting secret keys. +- Fixed a nasty bug in the old checksum code for secret keys that would result + in failure to decrypt longer RSA keys (I estimate this to happen for RSA keys + over 1600 bits). + 20030205 snapshot - API change: added cryptix.pki.ExtendedCertificate, which adds a few common 1.25 +78 -11 projects/openpgp/src/cryptix/openpgp/packet/PGPKeyPacket.java Index: PGPKeyPacket.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/packet/PGPKeyPacket.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- PGPKeyPacket.java 31 Jan 2003 00:54:26 -0000 1.24 +++ PGPKeyPacket.java 23 Aug 2003 10:14:09 -0000 1.25 @@ -1,4 +1,4 @@ -/* $Id: PGPKeyPacket.java,v 1.24 2003/01/31 00:54:26 edwin Exp $ +/* $Id: PGPKeyPacket.java,v 1.25 2003/08/23 10:14:09 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -52,7 +52,7 @@ * to support encrypted keys. * * @author Edwin Woudt (ed...@cr...) - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ */ public abstract class PGPKeyPacket extends PGPPacket implements KeySpec { @@ -424,7 +424,7 @@ { try { - + int s2kid, hashid; // construct streams @@ -481,26 +481,93 @@ // read all data byte[] data = new byte[in.available()]; in.readFully(data); + + + byte[] result; - - // the real thing - byte[] result = PGPCryptHelper.crypt(false, cp, iv, key, data); + if (version == 4) + { + // the real thing + result = PGPCryptHelper.crypt(false, cp, iv, key, data); + + if (! hashcheck) { + // check checksum + int sum=0; + for (int i=0; i<result.length-2; i++) + sum += (((int)result[i]) & 0xff); + sum &= 0xffff; + + int expected = ((((int)result[result.length-2]) & 0xff) << 8) + + (((int)result[result.length-1]) & 0xff); + + if (sum != expected) + throw new PGPWrongPassphraseException("Wrong passphrase"); + } else { + // check hash + try { + md = MessageDigest.getInstance("SHA-1"); + } catch (NoSuchAlgorithmException nsae) { + throw new InternalError("SHA-1 hash not found - "+nsae); + } + md.update(result, 0, result.length-20); + byte[] digest = md.digest(); + for (int i=0; i<20; i++) { + if (digest[i] != result[result.length-20+i]) { + throw new PGPWrongPassphraseException( + "Wrong passphrase"); + } + } + } + } + else if ((version == 2) || (version == 3)) + { + int pos = 0; + int mpilen = (((data[pos++] & 0xff) << 8) + + (data[pos++] & 0xff) + 7) >> 3; + + for (int i=0; i<4; i++) + { + try { + cp = factory.getCipherAlgorithm(alg, "CFB"); + } catch (NoSuchAlgorithmException nsae) { + throw new IllegalArgumentException( + "id not found - "+nsae); + } + + byte[] mpidata = new byte[mpilen]; + System.arraycopy(data, pos, mpidata, 0, mpilen); + byte[] mpiresult = + PGPCryptHelper.crypt(false, cp, iv, key, mpidata); + + System.arraycopy(data, pos+mpilen-blocksize, iv, 0, + blocksize); + System.arraycopy(mpiresult, 0, data, pos, mpilen); + + pos += mpilen; + mpilen = (((data[pos++] & 0xff) << 8) + + (data[pos++] & 0xff) + 7) >> 3; + } - if (! hashcheck) { + result = new byte[data.length]; + System.arraycopy(data, 0, result, 0, data.length); + // check checksum int sum=0; for (int i=0; i<result.length-2; i++) sum += (((int)result[i]) & 0xff); + sum &= 0xffff; int expected = ((((int)result[result.length-2]) & 0xff) << 8) + (((int)result[result.length-1]) & 0xff); - + if (sum != expected) throw new PGPWrongPassphraseException("Wrong passphrase"); - } else { - // check hash - throw new RuntimeException("SHA-1 checksum not supported yet"); } + else + { + throw new PGPDataFormatException("Invalid version"); + } + // Feed the decrypted data back into the reader try { 1.2 +23 -1 projects/openpgp/src/cryptix/openpgp/provider/PGPEncryptedMessageImpl.java Index: PGPEncryptedMessageImpl.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPEncryptedMessageImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PGPEncryptedMessageImpl.java 23 Aug 2001 22:27:22 -0000 1.1 +++ PGPEncryptedMessageImpl.java 23 Aug 2003 10:14:09 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id: PGPEncryptedMessageImpl.java,v 1.1 2001/08/23 22:27:22 edwin Exp $ +/* $Id: PGPEncryptedMessageImpl.java,v 1.2 2003/08/23 10:14:09 edwin Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. @@ -56,7 +56,7 @@ * Represents an encrypted message. * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class PGPEncryptedMessageImpl extends EncryptedMessage { @@ -245,6 +245,19 @@ } if (content instanceof PGPSignaturePacket) { + if (msg == null) { + if (pkts.hasMoreElements()) { + PGPPacket more = (PGPPacket)pkts.nextElement(); + if (more instanceof PGPLiteralDataPacket) { + msg = new PGPLiteralMessageImpl( + (PGPLiteralDataPacket)more); + } + } + } + if (msg == null) { + throw new MessageException( + "Could not find any data I understand. (Lone sig)"); + } msg = new PGPSignedMessageImpl((PGPSignaturePacket)content, (PGPLiteralMessageImpl)msg); } @@ -304,6 +317,15 @@ } } + + it = pgpbundle.getPublicKeys(); + PGPPublicKey pubmainkey = + (PGPPublicKey)it.next(); + PGPPrivateKey privmainkey = + (PGPPrivateKey)pgpbundle.getPrivateKey(pubmainkey, passphrase); + + if (privmainkey.getPacket().getAlgorithm() instanceof PGPEncryptor) + return decrypt(privmainkey); throw new NotEncryptedToParameterException(); } 1.14 +4 -3 projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java Index: TestOpenPGP.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- TestOpenPGP.java 23 Aug 2003 06:36:05 -0000 1.13 +++ TestOpenPGP.java 23 Aug 2003 10:14:09 -0000 1.14 @@ -1,4 +1,4 @@ -/* $Id: TestOpenPGP.java,v 1.13 2003/08/23 06:36:05 edwin Exp $ +/* $Id: TestOpenPGP.java,v 1.14 2003/08/23 10:14:09 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -27,7 +27,8 @@ public TestSuite suite() { TestSuite all = new TestSuite("All OpenPGP tests"); - all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); + all.addTestSuite(cryptix.openpgp.test.interop.PGP8ReadKeyAndDecryptTest.class); +/* all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCompareTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCRCTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPMPITest.class); @@ -43,7 +44,7 @@ all.addTestSuite(cryptix.openpgp.test.provider.PGPUserIDPrincipalBuilderTest.class); all.addTestSuite(cryptix.openpgp.test.net.HkpTest.class); all.addTestSuite(cryptix.openpgp.test.net.PGPKeyServerImplTest.class); - return all; +*/ return all; } 1.1 projects/openpgp/src/cryptix/openpgp/test/interop/PGP8ReadKeyAndDecryptTest.java Index: PGP8ReadKeyAndDecryptTest.java =================================================================== /* $Id: PGP8ReadKeyAndDecryptTest.java,v 1.1 2003/08/23 10:14:09 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General License along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.openpgp.test.interop; import cryptix.message.*; import cryptix.openpgp.*; import cryptix.pki.*; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.*; import java.util.*; public class PGP8ReadKeyAndDecryptTest extends TestCase { private static final String FS = System.getProperty("file.separator"); private final File _testdir; public PGP8ReadKeyAndDecryptTest(String name) { super(name); String td = System.getProperty("CRYPTIX_OPENPGP_TESTDIR"); if(td == null || "".equals(td) ) { _testdir = new File("." + FS + "testdata"); } else { _testdir = new File(td + FS + "testdata"); } } protected void setUp() { } protected void tearDown() { } public void testPGP8ReadKeysAndDecrypt() throws Exception { FileInputStream in; Collection msgs; KeyBundleMessage kbm; EncryptedMessage em; LiteralMessage lm; SignedMessage sm; Iterator it; KeyBundle prvDHDSS, pubDHDSS, prvRSAleg, pubRSAleg, prvRSAnew, pubRSAnew; MessageFactory mf = MessageFactory.getInstance("OpenPGP"); in = new FileInputStream(new File(_testdir, "PGP8_testkey_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvDHDSS = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubDHDSS = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_testkey_RSA_legacy.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvRSAleg = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubRSAleg = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_testkey_RSA_new.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); kbm = (KeyBundleMessage)it.next(); prvRSAnew = kbm.getKeyBundle(); kbm = (KeyBundleMessage)it.next(); pubRSAnew = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "PGP8_enc_DHDSS_sig_RSAleg.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvDHDSS, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubRSAleg)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP8_enc_RSAnew_sig_DHDSS.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvRSAnew, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubDHDSS)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); in = new FileInputStream(new File(_testdir, "PGP8_enc_RSAleg_sig_RSAnew.asc")); msgs = mf.generateMessages(in); it = msgs.iterator(); em = (EncryptedMessage)msgs.iterator().next(); sm = (SignedMessage)em.decrypt(prvRSAleg, "TestingPassphrase".toCharArray()); assertTrue("Correctly signed", sm.verify(pubRSAnew)); lm = (LiteralMessage)sm.getContents(); assertEquals("Decrypted data", "Hello", lm.getTextData()); } } 1.1 projects/openpgp/src/testdata/PGP8_enc_DHDSS_sig_RSAleg.asc Index: PGP8_enc_DHDSS_sig_RSAleg.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP 8.0.2 qANQR1DBwU4DSN5Riqsq3iYQCADGmfRhR79IOiWYi9ptYyhUBEIBDHYuDW5Lq6pT kvDRj9ByyyOmZdOFMm63Q+MHuR4QGdSNOQ2ndhhzmAptYEoz75XuBoqdYtop7Q+t 6dJYKVhFnYCZJx3vRF4LH86AseSKHhrMTzoQdcV92FNJKJMM3M1Cw0nG29xNoVGd D3fGiqWixB7NNEg+zVMCgUfhn4G8J7DuXgL4sGTawGB/WFBomBlmEQ/Fy6znepuE dtG380dm4SY8blXZ52izdAOM8RXjqZ+Dp17beqyZKzEHEX49+ooAYkTM0mkZhMKi twSBezn6j2lSMoC7nOGzLyAFcD3Dn1tS8BcpXGeJqf8zuX/hB/4k0NPHZb9K12PN 4U2MLvce/exDKdodbfLhg30uQP1qoKi64KPTYHAcWiDk6BINZYKnOjJqsB2pFtWZ qvRf4qJXH7KbjRUmVrD8Q/Ns4LegzSVPIXB2wjrmENONU/69sA/T+F9qej2kguu/ uI8f+ufGxA6theohB8+0hmyFNoCMYHLkRm9jiojHtKK9kz7bkMx9Sw9N35zi+vTY dmwBHhViLsAciphoQJEHsu70gs16+UvazZi94tMwdVkbjv0eJ1ByiFcsWI/ctZHI LJidj2LSubmFo4Fqn9oLrKeYlBIa6UZ4ay1Uu/Vhb5zWJIjlaOCQab3p3XCNyFf6 BD7xP0pl0sCmAeh75M+XRyM7QHQc5EPWth52cgR6otyZZr77kfNwORWdOJwuY9uW gwYoBC/xBO1tBpPp8jXuB1O2DUNJ2QaUpfGsZarTpG3jY1o21zMXRxNR4AtMRX7B oaxSwiQwEOQAQd5v6wkSWPL8pIvnqF4i135eNzOBrXf6dIs9L1jIOhAm9We+FpTY R0RN7Q1bUY5dtgZwmvsyzL3sMP2ozK4lAGbHv7AOLNrAhVjrwEh5qDdLTNp2Q7ne 7rjlwP2i3HGE0Ir7Sv9ElLlw9XH8/tXx6vn9uiGt5TQDwp/1uOhDSzoFdcwmPGrg 13RXQ2BnCIMUusVPIuww4rNdyf/nie/uNTha3wfuCItrV3XQ3+WUeKA0HrRO/OP2 uNUwTOkp9q5HCuyB1udYzDU5FsGQZUR7nIeM9VGNXtMu4MORnAkMKzx5Rj0BGzOG upsBjnxRQjtJNeBiOYNuFkeEEvQkVf2C9H+8AyR76Q== =4Ivp -----END PGP MESSAGE----- 1.1 projects/openpgp/src/testdata/PGP8_enc_RSAleg_sig_RSAnew.asc Index: PGP8_enc_RSAleg_sig_RSAnew.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP 8.0.2 hQEMA5lnADhWl3pvAQf7BbnrXa6zErdpRxCEkFanjA9F6kiCW9cJPFk0CCejZIDZ tlYIRRCKKRWa+Ip9HnXF0xPJA5bchxgOo9HsjHWap5pYtGpzzGfD0Fnzj9egaLMo LiB6J0fi0GM51A0QmjLYmqD5jVppvn12P1nBQqLpyzPYI+gUvmCQItwy+5eXTOMX WHeOxXDEv0q11sPme+vu3cAiXMJ7mnSdjy89gFU5ymJ0jdTFosroglxo2ifECtgf HFRQIMe1Q6ts8ZUvdhHxbzDsg/6sO23Pk301MYq6uaTRDEy925Z028axId0Nlp1B izBSa5Jd6fglOU/m0pfNq6ABDq7CBXY8qbJx2D9EjqUBNtgq0IVbdfLlQhM70JYZ Gg5FmDqaAA8cUFjq2b5nBlpxzHGKDqzM461Qh+kD3yXNbeaCoQO6omTKjMOhvzLy P5JzMVZ07p0adteIrI0+U9hf+kjzurvnLUrJpCWUi6q3IX6Wl8pI9ftwGKbDKIZl LufG8+e98nIrYpSOIlW7VcEwPEghqY2jvDRgXkkujoNh6nqDCVrjZEfrDeCaVB2U Xf/5L5wYRSkz5LLxIxJmQJEuFT0EY4b9hlDauEVJUw7ubKXfxGu6uHu5H1XYM0oK 1S47aqxdIWzdlf3m0Ni48xESRauKW17XMGi33PFbrErwzbRXwin8Ut6dMPtyUGtW IqbXNoQ6NtqexKT0+nVE6lyxuSf5oCq2nd9j0GpoTzHVUWlVSyGT/6g5pf9kgQHS x626+9ZrPaw= =7FPn -----END PGP MESSAGE----- 1.1 projects/openpgp/src/testdata/PGP8_enc_RSAnew_sig_DHDSS.asc Index: PGP8_enc_RSAnew_sig_DHDSS.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP 8.0.2 qANQR1DBwEwD0lCL6bhyeWMBCACCpPPlo0zoxkK/QOQrWWjvyqAracxfmkH8mv1z ZAEbGxNnF4QJ/jrmo6CMQHPrYIrrd4GYR7kRX/1N+Ls+ki6Pxa2yLrU5sBz3pI+7 u+jAk4nFqdbUAy/1+Ag8BWDAOY1tKG/MWQ51GNooeLy57quAwOd8Vvhc9YNZeQRp HXeSAc/IrWkE/TgGm1VOQIJx2/6WCi1OiFnBgTtqy30Ysk3FIfj/e+lqjcZbbTac hbsmsrsFb3bKcaJX+oh+iayVMnuLnDzjny0bsPMp5rITI32tTKKDnb8dlYshn+7f KrrxcxqAla6ThlRqJhPSy7c4db+jeJhO9pmW5Fie/jdTmaeW0ogBbHsFn+CZXRRi Umouo/KHcXvWawDZB1TtQmyJV+1qEv65as3AjMa/J/GhvQwML0oy9T48jXJK0dd6 ZWAPipRW/S3GTzLCt0lHzo7d+tW5UrcrK+/loYjbSLbEV8OtAqRbhx0OzMrTJcbe Ym90co0yM/Kamf09tEJinIS+56X3F2M8CIn20o1k =3BPK -----END PGP MESSAGE----- 1.1 projects/openpgp/src/testdata/PGP8_testkey_DHDSS.asc Index: PGP8_testkey_DHDSS.asc =================================================================== -----BEGIN PGP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t38EYPsjje8hXD+vqW3IuprTIuHrQSUEdQOCB0ZXN0 a2V5IERIRFNTiQBXBBARAgAXBQI/Rw/NBwsJCAcDAgoCGQEFGwMAAAAACgkQteqJ 2Ix1rqE7IACgpyPYyRXfu1wxEBKpxD2k7CweP4IAmgPZhZKR+oBvzRrSnij8953N f8o2uQINBD9HD84QCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoBp1aj FOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3bzpnhV5JZ zf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9GAFgr5fSI /VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67VYy4XTjT NP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AK UJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICCADpcM8gVOGCLUYSxTZU 9my465zZe2va+pZsnbSBFdo67ocHA1TiK0c7NocDJZDyJlXvN7ayfHptbOULn0xP dqzuPbJKUUhSHwMeXrvxdUu+fLOhcWEm6kNvYvn+e3f9m4r8jZ0SDwOF1T5P1ez9 USqBaiHSJZYDtDZ3o6gIebYbo03+GeMnDyiOS6pMPL8hbiLGVmZAgP2pzMcQYk9t K2AGu0mE3w+ac64xSMBEGxXMOgkfCnyt9qVtyjd4XwuyeEBqsRIWADZUZn79K7tu M/bhWnNgNbagh/0KW+QF76yXUp4CQt8nPu7BZ6UsvyJ+NutteWrW6aCbtRutoDRT oSoViQBLBBgRAgAMBQI/Rw/OBRsMAAAAAAoJELXqidiMda6hLDAAniHllqtQNIre eD0ZbkP5fMh27wyHAJYuNnkvX+XVYcIjRDjivKWUw+8s =1s+G -----END PGP PUBLIC KEY BLOCK----- 1.1 projects/openpgp/src/testdata/PGP8_testkey_RSA_legacy.asc Index: PGP8_testkey_RSA_legacy.asc =================================================================== -----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DPlxLeEkD1Vj5LtABM 7+VP =Fzqu -----END PGP PUBLIC KEY BLOCK----- 1.1 projects/openpgp/src/testdata/PGP8_testkey_RSA_new.asc Index: PGP8_testkey_RSA_new.asc =================================================================== -----BEGIN PGP PRIVATE KEY BLOCK----- Version: PGP 8.0.2 lQOoBD9HEBQBCAC+y88V4nYTFQzK4vlO8L+gesEHrc4Oujq/lZmKum8hSyyJT3Gw b6fw7qCEi2zz7yX6+7GffFT5xw4c9oYRi81ZfnvbG8a3o8kQfInBJz4Zp0L9iBei KOxjkIfAfEAVEYeScLYCCftsqyt5NMZyNCQ/hob8GDPAgxA1Bp5E8gErzu1nwdvM smVKf6Ur0xdyaHqBdoJMwePN7c5RWw9HnhhdvUcMNEFIPhRQZ5oDXg8C0jdkKnSp SijvAIThYfF02HNFfdDfXxrsGl06rU/1zCPQN4qCXhbssBPPGsln+OGi+389ZiVn ZWn8brHcmZVbfKOQs9aVUIDD1dNw85NbTfl3ABEBAAEJfWgHHpdpNgkCGo/IP+3R XCfbvau8dSZnywAdP2p0uqphyGK4CbAcdlnvET2UHItCT78mSCVX0oCYyq9jjaVT Ui/AuLsbs1q2PGtWu6a4lPI7rX2L8W0DieofWTbn6CYKjw0eQZt9VmJSJahwWepW 7Ra0HAs6R1RgaOpDd2O/SO2NtX1MSo9C+FJi0HliSfrFmX0ymKnYmqFliJv0/rHl mKXOLu3jyrVX6iMyL6JtqffS8Ug/QCBmIiuzi/XUjxPVrbAaU4Dnid9N9qA8Qfjp 11vost+ygvw1DwG2WFYz45mwqB4IounBmu1DeNZQairO8j6IIbmoTCYIwkDBJ33V 2HvPkTk88TnWsusgWhtsFGU1b1YoaryDmPmugC59ZOeYLp0evlwigBOPhOmOUgVc AD6BRQjP/Jn/AwN5QgPbOzBo4nvwyqVf6M+35KWxuLxR/7ukEJmImlWuwOZJJWoc l2quHL9UhSsgsvYnGbOJ6kLhaFB65Jnzf0Tr5Do0nv9FE++0Nkyt/yMmpR7bw4tg HpHwNRl9Pck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nWJr68JPyjCrEv3j0SNZU7ZPwXBpDYoT4buXBEHmLxA jLEfcjvVR5GeWEU= =hc/p -----END PGP PUBLIC KEY BLOCK----- |
From: <ed...@bo...> - 2003-08-23 06:36:10
|
edwin 03/08/23 02:36:05 Modified: openpgp CHANGELOG.TXT openpgp/src/cryptix/openpgp/packet PGPCompressedDataPacket.java openpgp/src/cryptix/openpgp/test/all TestOpenPGP.java Added: openpgp/src/cryptix/openpgp/io PGPZLibInputStreamAdapter.java openpgp/src/cryptix/openpgp/test/interop ZLibEOFTest.java openpgp/src/testdata zlib_eof.asc Log: - Fixed the infamous EOFException: Unexpected end of ZLIB input stream. Revision Changes Path 1.21 +2 -1 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- CHANGELOG.TXT 23 Aug 2003 02:22:11 -0000 1.20 +++ CHANGELOG.TXT 23 Aug 2003 06:36:04 -0000 1.21 @@ -7,7 +7,8 @@ public key and principal that are signed as well. This is more like what other Certificate implementations do, and it also allows one to construct a KeyBundle from the returned data again. -Bugsfixes/new features +Bugfixes/new features +- Fixed the infamous EOFException: Unexpected end of ZLIB input stream. - Snapshots are now compiled on JDK 1.2, so that they continue to work on that version of the JDK. Due to a Sun API change, a library compiled on JDK 1.3 or higher would not work on JDK 1.2. 1.1 projects/openpgp/src/cryptix/openpgp/io/PGPZLibInputStreamAdapter.java Index: PGPZLibInputStreamAdapter.java =================================================================== /* $Id: PGPZLibInputStreamAdapter.java,v 1.1 2003/08/23 06:36:05 edwin Exp $ * * Copyright (C) 1999-2003 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General License along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.openpgp.io; import cryptix.openpgp.PGPDataFormatException; import cryptix.openpgp.PGPFatalDataFormatException; import java.io.IOException; import java.io.InputStream; /** * Special version of PGPInputStreamAdapter that outputs an extra dummy byte. * * <p> * This solves a bug where java.util.zip.Inflate expects an extra dummy byte at * the end of the compressed stream and crashes with an EOFException if it is * not there. * </p> * * @see cryptix.openpgp.io.PGPOutputStreamAdapter * * @author Mathias Kolehmainen (ri...@ro...) * @author Edwin Woudt (ed...@wo...) * @version $Revision: 1.1 $ */ public class PGPZLibInputStreamAdapter extends InputStream { private PGPPacketDataInputStream in; /** * Construt the adapter which will use the given PGPPacketDataInputStream * as the underlying input stream to which all method calls are forwarded. * * @param in a PGPPacketDatInputStream to read from. */ public PGPZLibInputStreamAdapter(PGPPacketDataInputStream in) { this.in = in; } private boolean dummySent = false; /** * Calls readBuffer on the underlying stream passing in a newly * allocated byte array for temporary storage. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @exception IOException if an I/O error occurs, or if the underlying * stream throws a PGPDataFormatException or a * PGPFatalDataFormatException. */ public int read() throws IOException { byte[] buf = new byte[1]; try { int len = in.readBuffer(buf); if (len > 0) return byteToInt(buf[0]); if (dummySent) return -1; dummySent = true; return 0; } catch(PGPDataFormatException e) { throw(new IOException("Data format exception: " + e.getMessage())); } catch(PGPFatalDataFormatException e) { throw(new IOException("Fatal data format exception: " + e.getMessage())); } } /** * Calls the readBuffer method on the underlying stream. * * @param b the buffer into which the data is read. * @return the total number of bytes read into the buffer, or * <code>-1</code> is there is no more data because the end of * the stream has been reached. * @exception IOException if an I/O error occurs, or if the underlying * stream throws a PGPDataFormatException or a * PGPFatalDataFormatException. * @see java.io.InputStream#read(byte[], int, int) */ public int read(byte b[]) throws IOException { try { int r = in.readBuffer(b); if (r > 0) return r; if (dummySent) return -1; dummySent = true; return 1; } catch(PGPDataFormatException e) { throw(new IOException("Data format exception: " + e.getMessage())); } catch(PGPFatalDataFormatException e) { throw(new IOException("Fatal data format exception: " + e.getMessage())); } } /** * Call the readBuffer method on the underlying stream. * * @param b the buffer into which the data is read. * @param off the start offset in array <code>b</code> * at which the data is written. * @param len the maximum number of bytes to read. * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. * @exception IOException if an I/O error occurs, or if the underlying stream * throws a PGPDataFormatException or a PGPFatalDataFormatException. */ public int read(byte b[], int off, int len) throws IOException { try { int r = in.readBuffer(b, off, len); if (r > 0) return r; if (dummySent) return -1; dummySent = true; return 1; } catch(PGPDataFormatException e) { throw(new IOException("Data format exception: " + e.getMessage())); } catch(PGPFatalDataFormatException e) { throw(new IOException("Fatal data format exception: " + e.getMessage())); } } /** * This adapter always returns zero here. * * @return zero. * @exception IOException if an I/O error occurs. */ public int available() throws IOException { return 0; } /** * This adapter does not implement close, this method does nothing. * * @exception IOException if an I/O error occurs. */ public void close() throws IOException {} /** * Marking is not supported, this does nothing. */ public synchronized void mark(int readlimit) {} /** * Marking is not supported, this always throws an exception. * * @exception IOException is thrown whenever this is called. */ public synchronized void reset() throws IOException { throw new IOException("mark/reset not supported"); } /** * Marking is not supported, so this always returns false. * * * @return false */ public boolean markSupported() { return false; } // Private helper methods //........................................................................... /** * @param b an unsigned byte * @return the byte represented as an int (0 - 255) */ private static final int byteToInt(byte b) { int i = 0; if ((b & 0x80) != 0) { i |= 0x80; b &= 0x7F; } i |= b; return(i); } } 1.13 +4 -4 projects/openpgp/src/cryptix/openpgp/packet/PGPCompressedDataPacket.java Index: PGPCompressedDataPacket.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/packet/PGPCompressedDataPacket.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- PGPCompressedDataPacket.java 22 Apr 2002 17:46:12 -0000 1.12 +++ PGPCompressedDataPacket.java 23 Aug 2003 06:36:05 -0000 1.13 @@ -1,4 +1,4 @@ -/* $Id: PGPCompressedDataPacket.java,v 1.12 2002/04/22 17:46:12 edwin Exp $ +/* $Id: PGPCompressedDataPacket.java,v 1.13 2003/08/23 06:36:05 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. @@ -17,10 +17,10 @@ import cryptix.openpgp.io.PGPCompressorInputStream; import cryptix.openpgp.io.PGPCompressorOutputStream; -import cryptix.openpgp.io.PGPInputStreamAdapter; import cryptix.openpgp.io.PGPOutputStreamAdapter; import cryptix.openpgp.io.PGPPacketDataInputStream; import cryptix.openpgp.io.PGPPacketDataOutputStream; +import cryptix.openpgp.io.PGPZLibInputStreamAdapter; import cryptix.openpgp.algorithm.PGPAlgorithmFactory; import cryptix.openpgp.algorithm.PGPCompressor; @@ -45,7 +45,7 @@ * @see cryptix.openpgp.packet.PGPPacketFactory * * @author Mathias Kolehmainen (ri...@ro...) - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ */ public class PGPCompressedDataPacket extends PGPContainerPacket { @@ -132,7 +132,7 @@ PGPCompressorInputStream expander; try { PGPCompressor cp = factory.getCompressionAlgorithm(alg); - expander = cp.getExpansionStream(new PGPInputStreamAdapter(in)); + expander = cp.getExpansionStream(new PGPZLibInputStreamAdapter(in)); } catch (NoSuchAlgorithmException nsae) { in.readByteArray(); throw new PGPDataFormatException("id not found - "+nsae); 1.13 +2 -1 projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java Index: TestOpenPGP.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/test/all/TestOpenPGP.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- TestOpenPGP.java 22 Apr 2002 17:48:50 -0000 1.12 +++ TestOpenPGP.java 23 Aug 2003 06:36:05 -0000 1.13 @@ -1,4 +1,4 @@ -/* $Id: TestOpenPGP.java,v 1.12 2002/04/22 17:48:50 edwin Exp $ +/* $Id: TestOpenPGP.java,v 1.13 2003/08/23 06:36:05 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -27,6 +27,7 @@ public TestSuite suite() { TestSuite all = new TestSuite("All OpenPGP tests"); + all.addTestSuite(cryptix.openpgp.test.interop.ZLibEOFTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCompareTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPCRCTest.class); all.addTestSuite(cryptix.openpgp.test.util.PGPMPITest.class); 1.1 projects/openpgp/src/cryptix/openpgp/test/interop/ZLibEOFTest.java Index: ZLibEOFTest.java =================================================================== /* $Id: ZLibEOFTest.java,v 1.1 2003/08/23 06:36:05 edwin Exp $ * * Copyright (C) 1999-2002 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General License along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.openpgp.test.interop; import cryptix.message.*; import cryptix.openpgp.*; import cryptix.pki.*; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.*; import java.util.*; public class ZLibEOFTest extends TestCase { private static final String FS = System.getProperty("file.separator"); private final File _testdir; public ZLibEOFTest(String name) { super(name); String td = System.getProperty("CRYPTIX_OPENPGP_TESTDIR"); if(td == null || "".equals(td) ) { _testdir = new File("." + FS + "testdata"); } else { _testdir = new File(td + FS + "testdata"); } } protected void setUp() { } protected void tearDown() { } public void testZlibEOF() throws Exception { FileInputStream in; Collection msgs; MessageFactory mf = MessageFactory.getInstance("OpenPGP"); in = new FileInputStream(new File(_testdir, "bob-secret.pgp.asc")); msgs = mf.generateMessages(in); KeyBundleMessage kbm = (KeyBundleMessage)msgs.iterator().next(); KeyBundle bundle = kbm.getKeyBundle(); in.close(); in = new FileInputStream(new File(_testdir, "zlib_eof.asc")); msgs = mf.generateMessages(in); EncryptedMessage em = (EncryptedMessage)msgs.iterator().next(); in.close(); Message msg = em.decrypt(bundle, "TestingPassphrase".toCharArray()); String data = ((LiteralMessage)msg).getTextData(); assertEquals("Decrypted data: ", "Hello", data); } } 1.1 projects/openpgp/src/testdata/zlib_eof.asc Index: zlib_eof.asc =================================================================== -----BEGIN PGP MESSAGE----- Version: PGP 8.0.2 qANQR1DBwE4D0CKyoVrEnYIQBADgCqARKI1HqPUXLeQN/K6tzDUDOzTn+7Z36MPI o9XKbbUWQwOtVxJr7BC+DSj6l7DkyPrlAc14EB0CXQSfa0mLYc7BBNlSF7DJdnZn paJ0Cq0b0Yt02HPjkCneKLGC32ZlOjbgqJe9q3MkTH1wuLpMHsqbV+fI9x1jhaZ7 7jV3fwP/dRkRjEyJa78e9vfhZp9qQZYRM9KK/902eP7DQDT4mhT8i945EhmrY62F +nUAZwzbxKDOSywTfePty8pDXFA46PM7owE+hq6Q6gbHXrmkQ4K1xx3tbyPVmw++ lhYK2rLCHpf75nFh+VkP4uwd5B0KEf/ORjlXijgzbsnVbISaE7rSOAHIIrhH3bnQ 9z47RWedm+JcLDfJxabaHQPmWDksObXlQuFzzgaknL48gujcDf7/ebzdnaBnttoI =Uiwc -----END PGP MESSAGE----- |
From: <ed...@bo...> - 2003-08-23 06:18:46
|
edwin 03/08/23 02:18:44 Added: openpgp/src/testdata alice-public.pgp alice-secret.pgp bob-public.pgp.asc bob-secret.pgp.asc Log: Standard set of keys for tests. Revision Changes Path 1.1 projects/openpgp/src/testdata/bob-public.pgp.asc Index: bob-public.pgp.asc =================================================================== -----BEGIN PGP PUBLIC KEY BLOCK----- Version: Cryptix OpenPGP 0.20030822 mQGiBD9G9YERBAD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR +1k9jVj6v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb +DtX58aophUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwCgl2BQ jxUjC8yykrmCouuEC/BYHPUEAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9 B4JnUVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4r s6Z1kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+ z0kqBACpvFgvhwc8M5pIs6/SZrrrAODjSXxdNZ1V3oww6S6kEgcOEvpxLGo6moLx OIMq+bMpQGlJXm2mbJ1dVB7joje1E03D0jxe1F/GOFkthAeKnuMghPRy7HxAQjFS onNXOrQBVOqrvHsrKjG8MQBNEeOzw6GiU0BcHR2tYzF4ZpiEFLQfQm9iIEMuIE9t cGxleCA8Ym9iQGNvbXBsZXguY29tPohWBBMRAgAWBQI/RvWBBgsHCAkDAgMVAgME FgIBAAAKCRDSwVwBDMM1CXqvAKCKzwhux3zbofYV+7ACmQG72hKi8gCdFXvfZK0i ExQrtsBHUUu+CPZqH720HEJvYiBDLiBPbXBsZXggPGJvYkB3b3JrLmNvbT6IVgQT EQIAFgUCP0b1ggYLBwgJAwIDFQIDBBYCAQAACgkQ0sFcAQzDNQlvvgCeLfp4wu81 7sy6WjkT7Pl2FvRJsOgAoITM0xFp6WiHuCnFbG8mW94lo82HuQENBD9G9YIQBAD/ /////////8kP2qIhaMI0xMZii4DcHNEpAk4IimfMdAILvqY7E5siUUoIeY40BN3v lRmzzTpDGzArCm3yXxQ3T+E1bW1RwkXkhbV2Yl5+xvRMQummN+1rC/9ctvQGt+3u OGv7Womfpa6fJBF8Sx/mSShmUezmU4H//////////wACAgQAwGVPaMZ8YfoVXFq6 +WBG2b879/miys1pj37BYFshxvXfQ5NJog1L9C49lFXummBz2F9g/wZSLf+apMso lFR9Aru520VU/Vl6FdkjFfqMHwlr4BDjsWJ6E7nijofDsQlfd7JMHBinni++Hdcr xVgnjTWeAZQErjXKF07LJTREqfmIRgQYEQIABgUCP0b1ggAKCRDSwVwBDMM1CagW AJwNcFAyLzpwnMs9T9ZlHv6Neyo1zQCfZop0VxfMuEWv7wQsYV4KpQERzOc= =Xaa6 -----END PGP PUBLIC KEY BLOCK----- 1.1 projects/openpgp/src/testdata/bob-secret.pgp.asc Index: bob-secret.pgp.asc =================================================================== -----BEGIN PGP PRIVATE KEY BLOCK----- Version: Cryptix OpenPGP 0.20030822 lQHPBD9G9YERBAD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR +1k9jVj6v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb +DtX58aophUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwCgl2BQ jxUjC8yykrmCouuEC/BYHPUEAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9 B4JnUVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4r s6Z1kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+ z0kqBACpvFgvhwc8M5pIs6/SZrrrAODjSXxdNZ1V3oww6S6kEgcOEvpxLGo6moLx OIMq+bMpQGlJXm2mbJ1dVB7joje1E03D0jxe1F/GOFkthAeKnuMghPRy7HxAQjFS onNXOrQBVOqrvHsrKjG8MQBNEeOzw6GiU0BcHR2tYzF4ZpiEFP8DAwKo5kTYWpI1 wZZl1chf9HXlvwry4KUAZMsdeuiZYxJs7+pa6HdfzRmjzLQfQm9iIEMuIE9tcGxl eCA8Ym9iQGNvbXBsZXguY29tPohWBBMRAgAWBQI/RvWBBgsHCAkDAgMVAgMEFgIB AAAKCRDSwVwBDMM1CXqvAKCKzwhux3zbofYV+7ACmQG72hKi8gCdFXvfZK0iExQr tsBHUUu+CPZqH720HEJvYiBDLiBPbXBsZXggPGJvYkB3b3JrLmNvbT6IVgQTEQIA FgUCP0b1ggYLBwgJAwIDFQIDBBYCAQAACgkQ0sFcAQzDNQlvvgCeLfp4wu817sy6 WjkT7Pl2FvRJsOgAoITM0xFp6WiHuCnFbG8mW94lo82HnQGmBD9G9YIQBAD///// /////8kP2qIhaMI0xMZii4DcHNEpAk4IimfMdAILvqY7E5siUUoIeY40BN3vlRmz zTpDGzArCm3yXxQ3T+E1bW1RwkXkhbV2Yl5+xvRMQummN+1rC/9ctvQGt+3uOGv7 Womfpa6fJBF8Sx/mSShmUezmU4H//////////wACAgQAwGVPaMZ8YfoVXFq6+WBG 2b879/miys1pj37BYFshxvXfQ5NJog1L9C49lFXummBz2F9g/wZSLf+apMsolFR9 Aru520VU/Vl6FdkjFfqMHwlr4BDjsWJ6E7nijofDsQlfd7JMHBinni++HdcrxVgn jTWeAZQErjXKF07LJTREqfn/AwMC8Mw/O//NBdWWXa9VvhLgGjkC6sYX46B+WWKq 62ASGjWLYLRjVzSdq+8XA6XXRxqTWlmvBDJ54ps+OcTs86NfVEA4LZ7CHPioiROp bzeUlB7alSM86KGVt7HPia8HAqDIxsmTHV1sr8gpQzuSdIOPY+KzTQB/4kuWOSvR 866lelTeWsYcXAvBJ4c9WH4702W10gIHjwyIRgQYEQIABgUCP0b1ggAKCRDSwVwB DMM1CagWAJwNcFAyLzpwnMs9T9ZlHv6Neyo1zQCfZop0VxfMuEWv7wQsYV4KpQER zOc= =KG2s -----END PGP PRIVATE KEY BLOCK----- |
From: <ed...@bo...> - 2003-08-23 06:16:59
|
edwin 03/08/23 02:16:58 projects/openpgp/src/cryptix/openpgp/test/interop - New directory |
From: <ed...@bo...> - 2003-08-23 06:16:41
|
edwin 03/08/23 02:16:39 Modified: openpgp/src/cryptix/openpgp/provider PGPSignedMessageImpl.java Log: Improve diags. Revision Changes Path 1.4 +6 -2 projects/openpgp/src/cryptix/openpgp/provider/PGPSignedMessageImpl.java Index: PGPSignedMessageImpl.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPSignedMessageImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPSignedMessageImpl.java 27 Dec 2001 14:50:47 -0000 1.3 +++ PGPSignedMessageImpl.java 23 Aug 2003 06:16:38 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPSignedMessageImpl.java,v 1.3 2001/12/27 14:50:47 edwin Exp $ +/* $Id: PGPSignedMessageImpl.java,v 1.4 2003/08/23 06:16:38 edwin Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. @@ -48,7 +48,7 @@ * Represents a signed message. * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class PGPSignedMessageImpl extends PGPSignedMessage { @@ -71,6 +71,10 @@ PGPLiteralMessageImpl contents) { super("OpenPGP"); + if (pkt == null) + throw new IllegalArgumentException("pkt == null"); + if (contents == null) + throw new IllegalArgumentException("contents == null"); this.pkt = pkt; this.contents = contents; } |
From: <ed...@bo...> - 2003-08-23 06:12:47
|
edwin 03/08/23 02:12:43 Modified: openpgp/src/cryptix/openpgp/packet PGPEncryptedDataPacket.java Log: Improve diags. Revision Changes Path 1.4 +3 -2 projects/openpgp/src/cryptix/openpgp/packet/PGPEncryptedDataPacket.java Index: PGPEncryptedDataPacket.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/packet/PGPEncryptedDataPacket.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPEncryptedDataPacket.java 23 Aug 2003 01:47:49 -0000 1.3 +++ PGPEncryptedDataPacket.java 23 Aug 2003 06:12:42 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPEncryptedDataPacket.java,v 1.3 2003/08/23 01:47:49 edwin Exp $ +/* $Id: PGPEncryptedDataPacket.java,v 1.4 2003/08/23 06:12:42 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -51,7 +51,7 @@ * protection.</p> * * @author Edwin Woudt (ed...@cr...) - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public abstract class PGPEncryptedDataPacket extends PGPContainerPacket { @@ -290,6 +290,7 @@ bais.close(); } catch (IOException ioe) { + ioe.printStackTrace(); throw new RuntimeException( "IOException on ByteArrayInputStream, should not happen. "+ioe); } |
From: <ed...@bo...> - 2003-08-23 03:02:13
|
edwin 03/08/22 23:02:08 Modified: openpgp/src/cryptix/openpgp/provider PGPKeyRingKeyStore.java Log: Catchup to the changed order of addPrivateKey parameters in KeyBundle. Revision Changes Path 1.4 +3 -3 projects/openpgp/src/cryptix/openpgp/provider/PGPKeyRingKeyStore.java Index: PGPKeyRingKeyStore.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPKeyRingKeyStore.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPKeyRingKeyStore.java 29 Aug 2001 15:40:40 -0000 1.3 +++ PGPKeyRingKeyStore.java 23 Aug 2003 03:02:08 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPKeyRingKeyStore.java,v 1.3 2001/08/29 15:40:40 edwin Exp $ +/* $Id: PGPKeyRingKeyStore.java,v 1.4 2003/08/23 03:02:08 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -50,7 +50,7 @@ * * @author Edwin Woudt <ed...@cr...> * @author Ingo Luetkebohle - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class PGPKeyRingKeyStore extends ExtendedKeyStoreSpi { @@ -160,7 +160,7 @@ for (int i=0; i<chain.length; i++) { bundle.addCertificate(chain[i]); } - bundle.addPrivateKey(chain[0].getPublicKey(), (PGPPrivateKey)key, + bundle.addPrivateKey((PGPPrivateKey)key, chain[0].getPublicKey(), password, new SecureRandom()); KeyID id = PGPKeyIDFactory.convert(key); |
From: <ed...@bo...> - 2003-08-23 02:22:17
|
edwin 03/08/22 22:22:11 Modified: openpgp CHANGELOG.TXT openpgp/src/cryptix/openpgp PGPCertificate.java PGPKeyBundle.java openpgp/src/cryptix/openpgp/examples GenerateAndWriteKey.java openpgp/src/cryptix/openpgp/provider PGPCertificateImpl.java PGPKeyBundleImpl.java openpgp/src/cryptix/pki KeyBundle.java Log: PGPCertificate/PGPCertificateImpl - added a getPacket() method KeyBundle/PGPKeyBundle/PGPKeyBundleImpl - added methods to add private (sub) keys without passwords - added methods to add public keys and principals directly, without adding a full Certificate - changed to order of the parameters for addPrivateKey to be consistent with addPrivateSubKey Revision Changes Path 1.20 +16 -5 projects/openpgp/CHANGELOG.TXT Index: CHANGELOG.TXT =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/CHANGELOG.TXT,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- CHANGELOG.TXT 16 Feb 2003 11:08:23 -0000 1.19 +++ CHANGELOG.TXT 23 Aug 2003 02:22:11 -0000 1.20 @@ -1,12 +1,23 @@ ???????? snapshot -- Snapshots are now compiled on JDK 1.2, so that they continue to work on that - version of the JDK. Due to a Sun API change, a library compiled on JDK 1.3 or - higher would not work on JDK 1.2. -- Change the getEncoded() method of a PGP certificate to encode the +Incompatible changes +- Changed the order of the arguments for the addPrivateKey method in KeyBundle + to be more consistent with addPrivateSubKey in PGPKeyBundle. Any application + that generates keys will probably have to be changed as a result of this. +- Changed the getEncoded() method of a PGP Certificate to encode the public key and principal that are signed as well. This is more like what other Certificate implementations do, and it also allows one to construct a KeyBundle from the returned data again. -- Fix the clone() method of PGPKeyBundleImpl. +Bugsfixes/new features +- Snapshots are now compiled on JDK 1.2, so that they continue to work on that + version of the JDK. Due to a Sun API change, a library compiled on JDK 1.3 or + higher would not work on JDK 1.2. +- Added methods to KeyBundle and PGPKeyBundle to allow storage of private keys + without encrypting them. +- Added methods to KeyBundle to add public (sub) keys and principals (userid's) + without adding full certificates, as this is allowed/needed in some cases. +- Included better error messages for when the Unlimited Strength Jurisdiction + Policy Files are not installed. +- Fixed the clone() method of PGPKeyBundleImpl. 20030205 snapshot - API change: added cryptix.pki.ExtendedCertificate, which adds a few common 1.3 +13 -2 projects/openpgp/src/cryptix/openpgp/PGPCertificate.java Index: PGPCertificate.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/PGPCertificate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PGPCertificate.java 3 Feb 2003 15:04:00 -0000 1.2 +++ PGPCertificate.java 23 Aug 2003 02:22:11 -0000 1.3 @@ -1,4 +1,4 @@ -/* $Id: PGPCertificate.java,v 1.2 2003/02/03 15:04:00 edwin Exp $ +/* $Id: PGPCertificate.java,v 1.3 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2003 The Cryptix Foundation Limited. * All rights reserved. @@ -12,6 +12,8 @@ package cryptix.openpgp; +import cryptix.openpgp.packet.PGPSignaturePacket; + import cryptix.pki.ExtendedCertificate; import cryptix.pki.KeyID; @@ -26,7 +28,7 @@ * * @author Edwin Woudt <ed...@cr...> * @author Ingo Luetkebohle - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public abstract class PGPCertificate extends ExtendedCertificate { @@ -46,6 +48,15 @@ // Added abstract methods // .......................................................................... + + + /** + * Return the contained signature packet. + * + * <p>Note: packets are part of the low-level API. Normally you don't need + * to use this method as other options are available.</p> + */ + public abstract PGPSignaturePacket getPacket(); /** 1.4 +10 -2 projects/openpgp/src/cryptix/openpgp/PGPKeyBundle.java Index: PGPKeyBundle.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/PGPKeyBundle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPKeyBundle.java 7 Aug 2001 03:16:33 -0000 1.3 +++ PGPKeyBundle.java 23 Aug 2003 02:22:11 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPKeyBundle.java,v 1.3 2001/08/07 03:16:33 edwin Exp $ +/* $Id: PGPKeyBundle.java,v 1.4 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -28,7 +28,7 @@ * * @author Edwin Woudt <ed...@cr...> * @author Ingo Luetkebohle - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public abstract class PGPKeyBundle extends KeyBundle { @@ -81,6 +81,14 @@ PublicKey pubsubkey, char[] passphrase, SecureRandom sr) + throws KeyBundleException; + + + /** + * Adds a private subkey to the keybundle, without encrypting it. + */ + public abstract boolean addPrivateSubKey (PrivateKey privsubkey, + PublicKey pubsubkey) throws KeyBundleException; 1.2 +4 -4 projects/openpgp/src/cryptix/openpgp/examples/GenerateAndWriteKey.java Index: GenerateAndWriteKey.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/examples/GenerateAndWriteKey.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- GenerateAndWriteKey.java 7 Aug 2001 05:22:37 -0000 1.1 +++ GenerateAndWriteKey.java 23 Aug 2003 02:22:11 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id: GenerateAndWriteKey.java,v 1.1 2001/08/07 05:22:37 edwin Exp $ +/* $Id: GenerateAndWriteKey.java,v 1.2 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -44,7 +44,7 @@ * Detailed example for generating two PGP keys and writing them to disk. * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class GenerateAndWriteKey { @@ -241,7 +241,7 @@ //********************************************************************** try { - simplePrivateKey.addPrivateKey(pubkey, privkey, + simplePrivateKey.addPrivateKey(privkey, pubkey, "TestingPassphrase".toCharArray(), sr); } catch (KeyBundleException kbe) { @@ -285,7 +285,7 @@ Certificate cert = certbuilder.build(pubkey, userid, privkey, sr); complexPublicKey.addCertificate(cert); complexPrivateKey.addCertificate(cert); - complexPrivateKey.addPrivateKey(pubkey, privkey, + complexPrivateKey.addPrivateKey(privkey, pubkey, "TestingPassphrase".toCharArray(), sr); } catch (Exception e) { 1.5 +14 -2 projects/openpgp/src/cryptix/openpgp/provider/PGPCertificateImpl.java Index: PGPCertificateImpl.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPCertificateImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PGPCertificateImpl.java 16 Feb 2003 11:07:19 -0000 1.4 +++ PGPCertificateImpl.java 23 Aug 2003 02:22:11 -0000 1.5 @@ -1,4 +1,4 @@ -/* $Id: PGPCertificateImpl.java,v 1.4 2003/02/16 11:07:19 edwin Exp $ +/* $Id: PGPCertificateImpl.java,v 1.5 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -70,7 +70,7 @@ * An OpenPGP Certificate. * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public class PGPCertificateImpl extends PGPCertificate { @@ -342,6 +342,18 @@ // Methods from cryptix.openpgp.PGPCertificate // .......................................................................... + + + /** + * Return the contained signature packet. + * + * <p>Note: packets are part of the low-level API. Normally you don't need + * to use this method as other options are available.</p> + */ + public PGPSignaturePacket getPacket() + { + return pkt; + } /** 1.4 +118 -30 projects/openpgp/src/cryptix/openpgp/provider/PGPKeyBundleImpl.java Index: PGPKeyBundleImpl.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPKeyBundleImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPKeyBundleImpl.java 14 Feb 2003 12:37:32 -0000 1.3 +++ PGPKeyBundleImpl.java 23 Aug 2003 02:22:11 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPKeyBundleImpl.java,v 1.3 2003/02/14 12:37:32 edwin Exp $ +/* $Id: PGPKeyBundleImpl.java,v 1.4 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -68,7 +68,7 @@ * * @author Edwin Woudt <ed...@cr...> * @author Ingo Luetkebohle - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class PGPKeyBundleImpl extends PGPKeyBundle { @@ -144,12 +144,12 @@ if (privpkt != null) { if (privSubkeys.size() != subkeys.size()) { - throw new RuntimeException( + throw new KeyBundleException( "Not all private subkeys present."); } } else { if (privSubkeys.size() != 0) { - throw new RuntimeException( + throw new KeyBundleException( "There are private subkeys present, but no private "+ "main key."); } @@ -172,7 +172,7 @@ baos.write(subject.getEncoded()); it2 = ((Vector)principalsToCertificates.get(subject)).iterator(); while (it2.hasNext()) { - baos.write(((PGPCertificate)it2.next()).getEncoded()); + ((PGPCertificate)it2.next()).getPacket().encode(baos); } } @@ -193,8 +193,6 @@ } catch (IOException ioe) { throw new KeyBundleException(""+ioe); - } catch (CertificateEncodingException cee) { - throw new KeyBundleException(""+cee); } } @@ -272,12 +270,76 @@ /** + * Adds a principal. + * + * <p>Note: there is no need to call this method explicitly when + * addCertificate is used.</p> + */ + public boolean addPrincipal (Principal princ) + throws KeyBundleException + { + if (!(princ instanceof PGPPrincipal)) { + throw new KeyBundleException("Invalid principal type"); + } + + if (! principals.contains(princ)) { + principals.add(princ); + return true; + } + + return false; + } + + + /** + * Adds a public key. + * + * <p>Note: there is no need to call this method explicitly when + * addCertificate is used.</p> + */ + public boolean addPublicKey (PublicKey pubkey) + throws KeyBundleException + { + if (!(pubkey instanceof PGPPublicKey)) { + throw new KeyBundleException("Invalid public key type"); + } + + if (mainkey == null) { + mainkey = (PGPPublicKey)pubkey; + return true; + } else { + throw new KeyBundleException( + "KeyBundle can only contain one main key."); + } + } + + + /** * Adds a private key, encrypting it with a passphrase. */ - public boolean addPrivateKey (PublicKey pubkey, PrivateKey privkey, + public boolean addPrivateKey (PrivateKey privkey, PublicKey pubkey, char[] passphrase, SecureRandom sr) throws KeyBundleException { + addPrivateKey(privkey, pubkey); + + int s2kid = 3; // Iterated & Salted ### FIXME + int cipherid = 3; // CAST5 ### FIXME + int hashid = 2; // SHA-1 ### FIXME + privpkt.encrypt(passphrase, s2kid, cipherid, hashid, sr, + PGPAlgorithmFactory.getDefaultInstance()); + privpkt.forgetSecretData(); + + return true; + } + + + /** + * Adds a private key, without encrypting it. + */ + public boolean addPrivateKey (PrivateKey privkey, PublicKey pubkey) + throws KeyBundleException + { if (! (privkey instanceof PGPPrivateKey)) { throw new KeyBundleException("Invalid private key type"); } @@ -314,13 +376,6 @@ PGPSecretKeyPacket pkt = (PGPSecretKeyPacket)pgpprivkey.getPacket(); privpkt = (PGPSecretKeyPacket)pkt.clone(); - int s2kid = 3; // Iterated & Salted ### FIXME - int cipherid = 3; // CAST5 ### FIXME - int hashid = 2; // SHA-1 ### FIXME - privpkt.encrypt(passphrase, s2kid, cipherid, hashid, sr, - PGPAlgorithmFactory.getDefaultInstance()); - privpkt.forgetSecretData(); - return true; } @@ -682,6 +737,53 @@ char[] passphrase, SecureRandom sr) throws KeyBundleException { + PGPSecretSubKeyPacket pkt = + addPrivateSubKeyHelper(privsubkey, pubsubkey); + + if (privSubkeys.containsKey(pubsubkey)) { + return false; + } + + PGPSecretSubKeyPacket clone = (PGPSecretSubKeyPacket)pkt.clone(); + + int s2kid = 3; // Iterated & Salted ### FIXME + int cipherid = 3; // CAST5 ### FIXME + int hashid = 2; // SHA-1 ### FIXME + clone.encrypt(passphrase, s2kid, cipherid, hashid, sr, + PGPAlgorithmFactory.getDefaultInstance()); + clone.forgetSecretData(); + + privSubkeys.put(pubsubkey, clone); + + return true; + } + + + /** + * Adds a private subkey to the keybundle, without encrypting it. + */ + public boolean addPrivateSubKey (PrivateKey privsubkey, + PublicKey pubsubkey) + throws KeyBundleException + { + PGPSecretSubKeyPacket pkt = + addPrivateSubKeyHelper(privsubkey, pubsubkey); + + if (privSubkeys.containsKey(pubsubkey)) { + return false; + } + + PGPSecretSubKeyPacket clone = (PGPSecretSubKeyPacket)pkt.clone(); + privSubkeys.put(pubsubkey, clone); + + return true; + } + + + private PGPSecretSubKeyPacket addPrivateSubKeyHelper(PrivateKey privsubkey, + PublicKey pubsubkey) + throws KeyBundleException + { if (! (privsubkey instanceof PGPPrivateKey)) { throw new KeyBundleException("Invalid private key type"); } @@ -693,10 +795,6 @@ throw new KeyBundleException("Public key not found"); } - if (privSubkeys.containsKey(pubsubkey)) { - return false; - } - PGPKeyPacket one = ((PGPPrivateKey)privsubkey).getPacket().clonePublic(); PGPKeyPacket two = ((PGPPublicKey)pubsubkey).getPacket(); @@ -712,18 +810,8 @@ PGPSecretSubKeyPacket pkt = (PGPSecretSubKeyPacket)pgpprivkey.getPacket(); - PGPSecretSubKeyPacket clone = (PGPSecretSubKeyPacket)pkt.clone(); - int s2kid = 3; // Iterated & Salted ### FIXME - int cipherid = 3; // CAST5 ### FIXME - int hashid = 2; // SHA-1 ### FIXME - clone.encrypt(passphrase, s2kid, cipherid, hashid, sr, - PGPAlgorithmFactory.getDefaultInstance()); - clone.forgetSecretData(); - - privSubkeys.put(pubsubkey, clone); - - return true; + return pkt; } 1.3 +31 -4 projects/openpgp/src/cryptix/pki/KeyBundle.java Index: KeyBundle.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/pki/KeyBundle.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- KeyBundle.java 4 Aug 2001 21:47:22 -0000 1.2 +++ KeyBundle.java 23 Aug 2003 02:22:11 -0000 1.3 @@ -1,4 +1,4 @@ -/* $Id: KeyBundle.java,v 1.2 2001/08/04 21:47:22 edwin Exp $ +/* $Id: KeyBundle.java,v 1.3 2003/08/23 02:22:11 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -45,7 +45,7 @@ * * @author Edwin Woudt <ed...@cr...> * @author Ingo Luetkebohle - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public abstract class KeyBundle { @@ -182,15 +182,42 @@ * the public key and the principal, so that the implementation of the * keybundle can add these automatically when needed.</p> */ - public abstract boolean addCertificate (Certificate cert) + public abstract boolean addCertificate(Certificate cert) throws KeyBundleException; /** + * Adds a principal. + * + * <p>Note: there is no need to call this method explicitly when + * addCertificate is used.</p> + */ + public abstract boolean addPrincipal (Principal princ) + throws KeyBundleException; + + + /** + * Adds a public key. + * + * <p>Note: there is no need to call this method explicitly when + * addCertificate is used.</p> + */ + public abstract boolean addPublicKey (PublicKey pubkey) + throws KeyBundleException; + + + /** * Adds a private key, encrypting it with a passphrase. */ - public abstract boolean addPrivateKey (PublicKey pubkey, PrivateKey privkey, + public abstract boolean addPrivateKey (PrivateKey privkey, PublicKey pubkey, char[] passphrase, SecureRandom sr) + throws KeyBundleException; + + + /** + * Adds a private key, without encrypting it. + */ + public abstract boolean addPrivateKey (PrivateKey privkey, PublicKey pubkey) throws KeyBundleException; |
From: <ed...@bo...> - 2003-08-23 02:17:38
|
edwin 03/08/22 22:17:36 Modified: openpgp/lib cryptix-jce-api.jar cryptix-jce-provider.jar Log: The latest and greatest. |
From: <ed...@bo...> - 2003-08-23 01:50:50
|
edwin 03/08/22 21:50:43 Modified: openpgp/src/cryptix/openpgp/provider PGPEncryptedMessageBuilder.java Log: Better params checking. Revision Changes Path 1.4 +11 -2 projects/openpgp/src/cryptix/openpgp/provider/PGPEncryptedMessageBuilder.java Index: PGPEncryptedMessageBuilder.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/provider/PGPEncryptedMessageBuilder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PGPEncryptedMessageBuilder.java 31 Jan 2003 00:55:14 -0000 1.3 +++ PGPEncryptedMessageBuilder.java 23 Aug 2003 01:50:43 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: PGPEncryptedMessageBuilder.java,v 1.3 2003/01/31 00:55:14 edwin Exp $ +/* $Id: PGPEncryptedMessageBuilder.java,v 1.4 2003/08/23 01:50:43 edwin Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. @@ -56,7 +56,7 @@ * Service provider interface for EncryptedMessageBuilder * * @author Edwin Woudt <ed...@cr...> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class PGPEncryptedMessageBuilder extends EncryptedMessageBuilderSpi { @@ -76,6 +76,15 @@ public void engineInit(Message contents, SecureRandom sr) throws IllegalStateException, MessageException { + if (! ((contents instanceof PGPLiteralMessageImpl) || + (contents instanceof PGPSignedMessageImpl))) + { + throw new MessageException("Can only encrypt OpenPGP literal or "+ + "signed messages"); + } + if (this.contents != null) { + throw new IllegalStateException("Already initialized"); + } this.contents = contents; this.sr = sr; } |
From: <ed...@bo...> - 2003-08-23 01:47:51
|
edwin 03/08/22 21:47:49 Modified: openpgp/src/cryptix/openpgp/packet PGPEncryptedDataPacket.java Log: More debug. Revision Changes Path 1.3 +15 -2 projects/openpgp/src/cryptix/openpgp/packet/PGPEncryptedDataPacket.java Index: PGPEncryptedDataPacket.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/packet/PGPEncryptedDataPacket.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PGPEncryptedDataPacket.java 26 Aug 2001 17:26:55 -0000 1.2 +++ PGPEncryptedDataPacket.java 23 Aug 2003 01:47:49 -0000 1.3 @@ -1,4 +1,4 @@ -/* $Id: PGPEncryptedDataPacket.java,v 1.2 2001/08/26 17:26:55 edwin Exp $ +/* $Id: PGPEncryptedDataPacket.java,v 1.3 2003/08/23 01:47:49 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -51,7 +51,7 @@ * protection.</p> * * @author Edwin Woudt (ed...@cr...) - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public abstract class PGPEncryptedDataPacket extends PGPContainerPacket { @@ -142,9 +142,11 @@ try { cp.init(Cipher.DECRYPT_MODE, keyspec, ivspec); } catch (InvalidKeyException ike) { + ike.printStackTrace(); throw new InternalError("InvalidKeyException on "+ "decrypting a key - "+ike); } catch (InvalidAlgorithmParameterException iape) { + iape.printStackTrace(); throw new InternalError( "InvalidAlgorithmParameterException "+ "on decrypting a key - "+iape); @@ -155,6 +157,7 @@ try { prefix = cp.doFinal(prefixcrypt); } catch (BadPaddingException bpe) { + bpe.printStackTrace(); throw new InternalError("Hmm... got a BadPaddingException "+ "while we are not even using padding."); } catch (IllegalBlockSizeException ibse) { @@ -201,6 +204,7 @@ cp = factory.getCipherAlgorithm(correctid, "OpenpgpCFB"); } } catch (NoSuchAlgorithmException nsae) { + nsae.printStackTrace(); throw new InternalError("PANIC"); } @@ -217,9 +221,11 @@ try { cp.init(Cipher.DECRYPT_MODE, keyspec, ivspec); } catch (InvalidKeyException ike) { + ike.printStackTrace(); throw new InternalError("InvalidKeyException on "+ "decrypting a key - "+ike); } catch (InvalidAlgorithmParameterException iape) { + iape.printStackTrace(); throw new InternalError( "InvalidAlgorithmParameterException "+ "on decrypting a key - "+iape); @@ -239,8 +245,10 @@ System.arraycopy(result, ps, decrypted, 0, decrypted.length); } catch (IllegalBlockSizeException ibse) { + ibse.printStackTrace(); throw new InternalError("Should not happen on CFB mode. "+ibse); } catch (BadPaddingException bpe) { + bpe.printStackTrace(); throw new InternalError("Should not happen on CFB mode. "+bpe); } @@ -320,6 +328,7 @@ cp = factory.getCipherAlgorithm(cipherid, "OpenpgpCFB"); } } catch (NoSuchAlgorithmException nsae) { + nsae.printStackTrace(); throw new InternalError("PANIC"); } @@ -336,9 +345,11 @@ try { cp.init(Cipher.ENCRYPT_MODE, keyspec, ivspec); } catch (InvalidKeyException ike) { + ike.printStackTrace(); throw new InternalError("InvalidKeyException on "+ "encrypting a key - "+ike); } catch (InvalidAlgorithmParameterException iape) { + iape.printStackTrace(); throw new InternalError( "InvalidAlgorithmParameterException "+ "on encrypting a key - "+iape); @@ -395,8 +406,10 @@ encrypted = cp.doFinal(alldata); } catch (IllegalBlockSizeException ibse) { + ibse.printStackTrace(); throw new InternalError("Should not happen on CFB mode. "+ibse); } catch (BadPaddingException bpe) { + bpe.printStackTrace(); throw new InternalError("Should not happen on CFB mode. "+bpe); } |
From: <ed...@bo...> - 2003-08-23 01:41:12
|
edwin 03/08/22 21:41:02 Modified: openpgp/src/cryptix/openpgp/algorithm PGPElGamal.java PGPRSA.java Log: More helpful error messages in case we get bitten by the Jurisdiction Policy Files. Revision Changes Path 1.27 +14 -1 projects/openpgp/src/cryptix/openpgp/algorithm/PGPElGamal.java Index: PGPElGamal.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/algorithm/PGPElGamal.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- PGPElGamal.java 31 Jan 2003 00:52:24 -0000 1.26 +++ PGPElGamal.java 23 Aug 2003 01:41:02 -0000 1.27 @@ -1,4 +1,4 @@ -/* $Id: PGPElGamal.java,v 1.26 2003/01/31 00:52:24 edwin Exp $ +/* $Id: PGPElGamal.java,v 1.27 2003/08/23 01:41:02 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -527,6 +527,12 @@ a = new BigInteger(1, one ); b = new BigInteger(1, two ); + } catch(SecurityException se) { + // Braindamaged SUN restrictions + se.printStackTrace(System.err); + throw new RuntimeException("Not allowed to use ElGamal. " + + "Perhaps you need to download the Unlimited Strength " + + "Jurisdiction Policy Files from the Sun website? " + se); } catch(InvalidKeyException ivk) { // We construct the keys ourselves, so this shouldn't happen. throw new InternalError("Key was invalid:"); @@ -581,6 +587,13 @@ System.arraycopy(two, 0, ct, one.length, two.length); return cipher.doFinal( ct ); + + } catch(SecurityException se) { + // Braindamaged SUN restrictions + se.printStackTrace(System.err); + throw new RuntimeException("Not allowed to use ElGamal. " + + "Perhaps you need to download the Unlimited Strength " + + "Jurisdiction Policy Files from the Sun website? " + se); } catch(IllegalArgumentException iae) { // PGPMPI.toFixedLenByteArray throws this one when m is negative // (won't happen) or when m is larger than cipherBlockSize (this 1.22 +15 -1 projects/openpgp/src/cryptix/openpgp/algorithm/PGPRSA.java Index: PGPRSA.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/openpgp/src/cryptix/openpgp/algorithm/PGPRSA.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- PGPRSA.java 31 Jan 2003 00:52:24 -0000 1.21 +++ PGPRSA.java 23 Aug 2003 01:41:02 -0000 1.22 @@ -1,4 +1,4 @@ -/* $Id: PGPRSA.java,v 1.21 2003/01/31 00:52:24 edwin Exp $ +/* $Id: PGPRSA.java,v 1.22 2003/08/23 01:41:02 edwin Exp $ * * Copyright (C) 1999-2001 The Cryptix Foundation Limited. * All rights reserved. @@ -508,6 +508,13 @@ byte[] encrypted = cipher.doFinal(data); m = new BigInteger(1, encrypted ); + + } catch(SecurityException se) { + // Braindamaged SUN restrictions + se.printStackTrace(System.err); + throw new RuntimeException("Not allowed to use RSA. " + + "Perhaps you need to download the Unlimited Strength " + + "Jurisdiction Policy Files from the Sun website? " + se); } catch(InvalidKeyException ivk) { // We construct the keys ourselves, so this shouldn't happen. throw new InternalError("Key was invalid:"); @@ -555,6 +562,13 @@ byte[] ct = PGPMPI.toFixedLenByteArray(this.m, cipherBlockSize); return cipher.doFinal( ct ); + + } catch(SecurityException se) { + // Braindamaged SUN restrictions + se.printStackTrace(System.err); + throw new RuntimeException("Not allowed to use RSA. " + + "Perhaps you need to download the Unlimited Strength " + + "Jurisdiction Policy Files from the Sun website? " + se); } catch(IllegalArgumentException iae) { // PGPMPI.toFixedLenByteArray throws this one when m is negative // (won't happen) or when m is larger than cipherBlockSize (this |
From: <gel...@bo...> - 2003-08-13 08:30:09
|
gelderen 03/08/13 03:53:37 Modified: jce/src/cryptix.jce.provider.rsa RSAKeyFactory.java Log: - Re-order two instanceof tests so that subclass instanceness is tested before superclass instanceness is. Revision Changes Path 1.3 +9 -9 projects/jce/src/cryptix.jce.provider.rsa/RSAKeyFactory.java Index: RSAKeyFactory.java =================================================================== RCS file: /home/cryptix-cvs/cvsroot/projects/jce/src/cryptix.jce.provider.rsa/RSAKeyFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RSAKeyFactory.java 25 Aug 2000 01:21:10 -0000 1.2 +++ RSAKeyFactory.java 13 Aug 2003 07:53:37 -0000 1.3 @@ -1,4 +1,4 @@ -/* $Id: RSAKeyFactory.java,v 1.2 2000/08/25 01:21:10 gelderen Exp $ +/* $Id: RSAKeyFactory.java,v 1.3 2003/08/13 07:53:37 gelderen Exp $ * * Copyright (C) 1995-1999 The Cryptix Foundation Limited. * All rights reserved. @@ -29,7 +29,7 @@ /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @author Jeroen C. van Gelderen (gel...@cr...) */ public final class RSAKeyFactory extends KeyFactorySpi { @@ -47,13 +47,7 @@ protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { - if (keySpec instanceof RSAPrivateKeySpec) { - RSAPrivateKeySpec s = (RSAPrivateKeySpec)keySpec; - return new RSAPrivateKeyCryptix( - s.getModulus(), - s.getPrivateExponent() ); - - } else if (keySpec instanceof RSAPrivateCrtKeySpec) { + if (keySpec instanceof RSAPrivateCrtKeySpec) { RSAPrivateCrtKeySpec s = (RSAPrivateCrtKeySpec)keySpec; return new RSAPrivateCrtKeyCryptix( s.getModulus(), @@ -64,6 +58,12 @@ s.getPrimeExponentP(), s.getPrimeExponentQ(), s.getCrtCoefficient() ); + + } else if (keySpec instanceof RSAPrivateKeySpec) { + RSAPrivateKeySpec s = (RSAPrivateKeySpec)keySpec; + return new RSAPrivateKeyCryptix( + s.getModulus(), + s.getPrivateExponent() ); } else if (keySpec instanceof X509EncodedKeySpec) { return decodePrivateKey((X509EncodedKeySpec)keySpec); |