Bug 27853 - RSA decryption doesn't seem to work (using JCE)
Summary: RSA decryption doesn't seem to work (using JCE)
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: crypto (show other bugs)
Version: 0.92
: P3 normal
Target Milestone: ---
Assignee: Casey Marshall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-01 06:55 UTC by Vivek Lakshmanan
Modified: 2006-06-09 23:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Simple test case that encrypts/decrypts fine in BC but not in GNU-CRYPTO (799 bytes, text/plain)
2006-06-01 07:04 UTC, Vivek Lakshmanan
Details
fix RSACipherImpl (424 bytes, text/plain)
2006-06-03 03:24 UTC, Raif S. Naffah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vivek Lakshmanan 2006-06-01 06:55:55 UTC
The attached file provides a simple test case that works fine (the encoded text is retreived without a problem) on bouncycastle, however, when run on classpath crypto, does not decrypt properly.
Comment 1 Vivek Lakshmanan 2006-06-01 07:04:36 UTC
Created attachment 11563 [details]
Simple test case that encrypts/decrypts fine in BC but not in GNU-CRYPTO

Please note: This test case currently relies on KeyPairGenerator support which has been added in: http://developer.classpath.org/pipermail/classpath-patches/2006-June/002479.html

Or you can replace the code related to 'keyPG' with the commented out sections.
Comment 2 Raif S. Naffah 2006-06-03 03:24:02 UTC
Created attachment 11584 [details]
fix RSACipherImpl

At Vivek's request i had a look at this bug and created a new Mauve test (TestOfPR27853 under gnu.testlet.gnu.javax.crypto.jce) that confirms the bug and its (attached) fix.
Comment 3 Vivek Lakshmanan 2006-06-09 23:42:12 UTC
The fix sent by Raif fixed the problem. Could his fix (classpath-20060603.patch) please be commited to CVS?
Thanks,
Vivek
Comment 4 cvs-commit@developer.classpath.org 2006-06-11 07:22:18 UTC
Subject: Bug 27853

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Raif S. Naffah <raif>	06/06/11 07:20:41

Modified files:
	gnu/javax/crypto: RSACipherImpl.java 
	.              : ChangeLog 

Log message:
	2006-06-11  Raif S. Naffah  <raif@swiftdsl.com.au>
	
		PR Classpath/27853
		* gnu/javax/crypto/RSACipherImpl.java (engineDoFinal): Was short by 1 byte.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/crypto/RSACipherImpl.java?cvsroot=classpath&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7765&r2=1.7766

Patches:

Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.7765
retrieving revision 1.7766
diff -u -b -r1.7765 -r1.7766
--- ChangeLog	11 Jun 2006 03:09:02 -0000	1.7765
+++ ChangeLog	11 Jun 2006 07:20:41 -0000	1.7766
@@ -1,3 +1,8 @@
+2006-06-11  Raif S. Naffah  <raif@swiftdsl.com.au>
+
+	PR Classpath/27853
+	* gnu/javax/crypto/RSACipherImpl.java (engineDoFinal): Was short by 1 byte.
+
 2006-06-11  Sven de Marothy  <sven@physto.se>
 
 	* java/awt/font/TextLayout.java