[azureus/f19] - Remove bundled BouncyCastle (Bz 820117)

David Juran djuran at fedoraproject.org
Mon Mar 3 19:29:07 UTC 2014


commit ab4f0d52501bf8fdd69e0fdb2e3ad8479d942703
Author: David Juran <djuran at redhat.com>
Date:   Mon Mar 3 20:20:31 2014 +0100

    - Remove bundled BouncyCastle (Bz 820117)
    
    Conflicts:
    	azureus.spec

 azureus-5.3.0.0-no-bundled-bouncycastle |   91 +++++++++++++++++++++++++++++++
 azureus.spec                            |   17 +++---
 2 files changed, 100 insertions(+), 8 deletions(-)
---
diff --git a/azureus-5.3.0.0-no-bundled-bouncycastle b/azureus-5.3.0.0-no-bundled-bouncycastle
new file mode 100644
index 0000000..4d9ac86
--- /dev/null
+++ b/azureus-5.3.0.0-no-bundled-bouncycastle
@@ -0,0 +1,91 @@
+diff -up azureus-5.3.0.0/com/aelitis/azureus/core/security/impl/CryptoSTSEngineImpl.java.no-bundled-bouncecastle azureus-5.3.0.0/com/aelitis/azureus/core/security/impl/CryptoSTSEngineImpl.java
+--- azureus-5.3.0.0/com/aelitis/azureus/core/security/impl/CryptoSTSEngineImpl.java.no-bundled-bouncecastle	2013-05-08 22:11:40.000000000 +0200
++++ azureus-5.3.0.0/com/aelitis/azureus/core/security/impl/CryptoSTSEngineImpl.java	2014-03-03 20:08:46.000000000 +0100
+@@ -30,10 +30,12 @@ import java.security.KeyPair;
+ import java.security.PrivateKey;
+ import java.security.PublicKey;
+ import java.security.SecureRandom;
++import java.security.Security;
+ import java.security.Signature;
+ 
++import javax.crypto.KeyAgreement;
++
+ import org.bouncycastle.jce.provider.BouncyCastleProvider;
+-import org.bouncycastle.jce.provider.JCEECDHKeyAgreement;
+ 
+ import com.aelitis.azureus.core.security.CryptoECCUtils;
+ import com.aelitis.azureus.core.security.CryptoManagerException;
+@@ -57,7 +59,7 @@ CryptoSTSEngineImpl
+ 	private PublicKey 	remotePubKey;
+ 	private byte[] 		sharedSecret;
+ 	
+-	private InternalDH	ecDH;
++        private KeyAgreement	ecDH;
+ 	
+ 	/**
+ 	 * 
+@@ -76,9 +78,9 @@ CryptoSTSEngineImpl
+ 		ephemeralKeyPair = CryptoECCUtils.createKeys();
+ 		
+ 		try{
+-			ecDH = new InternalDH();
+-			
+-			//ecDH = KeyAgreement.getInstance("ECDH", BouncyCastleProvider.PROVIDER_NAME);
++		        Security.addProvider(new BouncyCastleProvider());
++
++			ecDH = KeyAgreement.getInstance("ECDH", BouncyCastleProvider.PROVIDER_NAME);
+ 			
+ 			ecDH.init(ephemeralKeyPair.getPrivate());
+ 			
+@@ -402,38 +404,4 @@ CryptoSTSEngineImpl
+ 			throw( new CryptoManagerException( "Failed to put byte[]", e ));
+ 		}
+ 	}
+-	
+-	class 
+-	InternalDH 
+-		extends JCEECDHKeyAgreement.DH
+-	{
+-			// we use this class to obtain compatability with BC
+-		
+-		public void
+-		init(
+-			Key		key )
+-
+-			throws InvalidKeyException, InvalidAlgorithmParameterException
+-		{
+-			engineInit( key, null );
+-		}
+-
+-		public Key
+-		doPhase(
+-			Key		key,
+-			boolean	lastPhase )
+-
+-			throws InvalidKeyException, IllegalStateException
+-		{
+-			return( engineDoPhase( key, lastPhase ));
+-		}
+-
+-		public byte[] 
+-		generateSecret() 
+-		
+-			throws IllegalStateException
+-		{
+-			return( engineGenerateSecret());
+-		}
+-	}
+-}
+\ No newline at end of file
++}
+diff -up azureus-5.3.0.0/org/gudy/azureus2/core3/security/impl/SESecurityManagerBC.java.no-bundled-bouncecastle azureus-5.3.0.0/org/gudy/azureus2/core3/security/impl/SESecurityManagerBC.java
+--- azureus-5.3.0.0/org/gudy/azureus2/core3/security/impl/SESecurityManagerBC.java.no-bundled-bouncecastle	2013-08-13 17:32:46.000000000 +0200
++++ azureus-5.3.0.0/org/gudy/azureus2/core3/security/impl/SESecurityManagerBC.java	2014-03-03 09:28:20.000000000 +0100
+@@ -39,6 +39,7 @@ import java.util.Calendar;
+ import org.bouncycastle.jce.*;
+ import org.bouncycastle.jce.provider.BouncyCastleProvider;
+ import org.bouncycastle.asn1.x509.X509Name;
++import org.bouncycastle.x509.X509V3CertificateGenerator;
+ import org.gudy.azureus2.core3.util.Constants;
+ import org.gudy.azureus2.core3.util.Debug;
+ import org.gudy.azureus2.core3.util.RandomUtils;
diff --git a/azureus.spec b/azureus.spec
index 3a4aa5b..2b40271 100644
--- a/azureus.spec
+++ b/azureus.spec
@@ -2,7 +2,7 @@
 
 Name:		azureus
 Version:	5.0.0.0
-Release:	4%{?dist}
+Release:	5%{?dist}
 Summary:	A BitTorrent Client
 Group:		Applications/Internet
 License:	GPLv2+
@@ -34,7 +34,8 @@ Patch9:	azureus-4.8.1.2-no-bundled-apache-commons.patch
 
 Patch10: azureus-5.2.0.0-startupScript.patch
 
-Patch11:	azureus-5.2-no-bundled-json.patch
+Patch11: azureus-5.2-no-bundled-json.patch
+Patch12: azureus-5.3.0.0-no-bundled-bouncycastle
 
 BuildRequires:	ant, jpackage-utils >= 1.5, xml-commons-apis
 BuildRequires:	apache-commons-cli, log4j
@@ -92,6 +93,7 @@ rm org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java
 %patch10 -p1 -b .startupScript
 
 %patch11 -p1 -b .no-bundled-json
+%patch12 -p1 -b .no-bundled-bouncecastle
 
 #hacks to org.eclipse.swt.widgets.Tree2 don't compile.
 rm -fR org/eclipse
@@ -102,11 +104,7 @@ chmod 644 *.txt
 
 #remove bundled libs
 rm -fR org/apache
-
-# requires org.bouncycastle.jce.provider 
-# http://www.cs.berkeley.edu/~jonah/bc/org/bouncycastle/jce/provider/JCEECDHKeyAgreement.html
-# Bouncy Castle Cryptography Library 1.37
-#rm -fR org/bouncycastle
+rm -fR org/bouncycastle
 rm -fR org/json
 # http://www.programmers-friend.org/download/ not found in fedora repos 
 #rm -fR org/pf
@@ -174,7 +172,10 @@ fi
 %{_datadir}/azureus
 
 %changelog
-* Mon Feb 10 2014 Sérgio Basto <sergio at serjux.com> - 5.0.0.0-4
+* Mon Mar 03 2014 David Juran <djuran at redhat.com> - 5.0.0.0-5
+- Remove bundled BouncyCastle (Bz 820117)
+
+* Sun Feb 09 2014 Sérgio Basto <sergio at serjux.com> - 5.2.0.0-4
 - Unbundle json (Bz 820117)
 
 * Mon Feb 10 2014 David Juran <djuran at redhat.com> - 5.0.0.0-3


More information about the scm-commits mailing list