summaryrefslogtreecommitdiff
blob: cc5055cbd770aa9740cd25197f7ea1dc4fbd4a15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- com/aelitis/azureus/core/clientmessageservice/secure/impl/SecureMessageServiceClientHelper.java.orig	2008-07-06 22:54:36.000000000 +0200
+++ com/aelitis/azureus/core/clientmessageservice/secure/impl/SecureMessageServiceClientHelper.java	2008-07-06 22:56:29.000000000 +0200
@@ -36,7 +36,6 @@
 import org.bouncycastle.crypto.encodings.PKCS1Encoding;
 import org.bouncycastle.crypto.engines.RSAEngine;
 import org.bouncycastle.crypto.params.ParametersWithRandom;
-import org.bouncycastle.jce.provider.RSAUtil;
 import org.gudy.azureus2.core3.util.Debug;
 import org.gudy.azureus2.plugins.utils.StaticUtilities;
 
@@ -82,30 +81,12 @@
 				
 			byte[] secret_bytes = session_key.getEncoded();
 			
-			try{
 				Cipher	rsa_cipher = Cipher.getInstance( "RSA" );
 		    
 				rsa_cipher.init( Cipher.ENCRYPT_MODE, public_key );
 		    
 				encryped_session_key = rsa_cipher.doFinal( secret_bytes );
 				
-			}catch( Throwable e ){
-				
-					// fallback to the BC implementation for jdk1.4.2 as JCE RSA not available
-				
-				RSAEngine	eng = new RSAEngine();
-				
-				PKCS1Encoding	padded_eng = new PKCS1Encoding( eng );
-				
-	            CipherParameters param = RSAUtil.generatePublicKeyParameter(public_key);
-	            
-	            param = new ParametersWithRandom(param, new SecureRandom());
-	            
-	            padded_eng.init( true, param );
-				
-				encryped_session_key = padded_eng.processBlock(secret_bytes, 0, secret_bytes.length);
-			}
-
 		}catch( Throwable e ){
 			
 			e.printStackTrace();