|
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);
}
|