Lines 36-42
Link Here
|
36 |
import org.bouncycastle.crypto.encodings.PKCS1Encoding; |
36 |
import org.bouncycastle.crypto.encodings.PKCS1Encoding; |
37 |
import org.bouncycastle.crypto.engines.RSAEngine; |
37 |
import org.bouncycastle.crypto.engines.RSAEngine; |
38 |
import org.bouncycastle.crypto.params.ParametersWithRandom; |
38 |
import org.bouncycastle.crypto.params.ParametersWithRandom; |
39 |
import org.bouncycastle.jce.provider.RSAUtil; |
39 |
//import org.bouncycastle.jce.provider.RSAUtil; |
40 |
import org.gudy.azureus2.core3.util.Debug; |
40 |
import org.gudy.azureus2.core3.util.Debug; |
41 |
import org.gudy.azureus2.plugins.utils.StaticUtilities; |
41 |
import org.gudy.azureus2.plugins.utils.StaticUtilities; |
42 |
|
42 |
|
Lines 82-93
Link Here
|
82 |
|
82 |
|
83 |
byte[] secret_bytes = session_key.getEncoded(); |
83 |
byte[] secret_bytes = session_key.getEncoded(); |
84 |
|
84 |
|
85 |
try{ |
85 |
//try{ |
86 |
Cipher rsa_cipher = Cipher.getInstance( "RSA" ); |
86 |
Cipher rsa_cipher = Cipher.getInstance( "RSA" ); |
87 |
|
87 |
|
88 |
rsa_cipher.init( Cipher.ENCRYPT_MODE, public_key ); |
88 |
rsa_cipher.init( Cipher.ENCRYPT_MODE, public_key ); |
89 |
|
89 |
|
90 |
encryped_session_key = rsa_cipher.doFinal( secret_bytes ); |
90 |
encryped_session_key = rsa_cipher.doFinal( secret_bytes ); |
|
|
91 |
|
92 |
/* Gentoo: Depend on JDK >=1.5 so we don't need this code. This does not work |
93 |
* with our packaged bcprov |
91 |
|
94 |
|
92 |
}catch( Throwable e ){ |
95 |
}catch( Throwable e ){ |
93 |
|
96 |
|
Lines 105-110
Link Here
|
105 |
|
108 |
|
106 |
encryped_session_key = padded_eng.processBlock(secret_bytes, 0, secret_bytes.length); |
109 |
encryped_session_key = padded_eng.processBlock(secret_bytes, 0, secret_bytes.length); |
107 |
} |
110 |
} |
|
|
111 |
*/ |
108 |
|
112 |
|
109 |
}catch( Throwable e ){ |
113 |
}catch( Throwable e ){ |
110 |
|
114 |
|