From 5156fc05b63857ece75a7480aee0fd9f94f76816 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Wed, 20 Mar 2013 09:44:49 +0100 Subject: [PATCH] Update to upstream version 1.7 --- .gitignore | 1 + ...Improve-randomness-of-PBECipher-salt.patch | 89 ------------------- ...pher-migration-to-component-metadata.patch | 18 ---- plexus-cipher.spec | 27 +++--- sources | 3 +- 5 files changed, 15 insertions(+), 123 deletions(-) delete mode 100644 0001-Improve-randomness-of-PBECipher-salt.patch delete mode 100644 plexus-cipher-migration-to-component-metadata.patch diff --git a/.gitignore b/.gitignore index 17a5b7e..06e5a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ plexus-cipher-1.5.tar.gz /LICENSE-2.0.txt +/plexus-cipher-1.7.tar.gz diff --git a/0001-Improve-randomness-of-PBECipher-salt.patch b/0001-Improve-randomness-of-PBECipher-salt.patch deleted file mode 100644 index b08bd2a..0000000 --- a/0001-Improve-randomness-of-PBECipher-salt.patch +++ /dev/null @@ -1,89 +0,0 @@ -From f9975b549fcb2453b1127ceccfd1f8061e35a618 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Tue, 27 Nov 2012 15:32:10 +0100 -Subject: [PATCH] Improve randomness of PBECipher salt - -See: https://bugzilla.redhat.com/show_bug.cgi?id=880279 ---- - .../plexus/components/cipher/PBECipher.java | 43 +++------------------- - 1 file changed, 5 insertions(+), 38 deletions(-) - -diff --git a/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java b/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java -index ce6b173..c69e753 100644 ---- a/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java -+++ b/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java -@@ -63,9 +63,8 @@ public class PBECipher - - protected MessageDigest _digester; - -- protected SecureRandom _secureRandom; -- -- protected boolean _onLinux = false; -+ private static final SecureRandom _secureRandom = new SecureRandom(); -+ - //--------------------------------------------------------------- - public PBECipher() - throws PlexusCipherException -@@ -73,21 +72,6 @@ public class PBECipher - try - { - _digester = MessageDigest.getInstance( DIGEST_ALG ); -- -- if( System.getProperty( "os.name", "blah" ).toLowerCase().indexOf( "linux" ) != -1 ) -- { -- _onLinux = true; -- } -- -- if( _onLinux ) -- { -- System.setProperty( "securerandom.source", "file:/dev/./urandom"); -- } -- else -- { -- _secureRandom = new SecureRandom(); -- } -- - } - catch ( NoSuchAlgorithmException e ) - { -@@ -96,21 +80,10 @@ public class PBECipher - } - //--------------------------------------------------------------- - private byte[] getSalt( final int sz ) -- throws NoSuchAlgorithmException, NoSuchProviderException - { -- byte [] res = null; -- -- if( _secureRandom != null ) -- { -- _secureRandom.setSeed( System.currentTimeMillis() ); -- res = _secureRandom.generateSeed( sz ); -- } -- else -- { -- res = new byte[ sz ]; -- Random r = new Random( System.currentTimeMillis() ); -- r.nextBytes( res ); -- } -+ byte[] res = new byte[ sz ]; -+ -+ _secureRandom.nextBytes( res ); - - return res; - } -@@ -124,12 +97,6 @@ public class PBECipher - - byte[] salt = getSalt( SALT_SIZE ); - -- // spin it :) -- if( _secureRandom != null ) -- { -- new SecureRandom().nextBytes( salt ); -- } -- - Cipher cipher = createCipher( password.getBytes( STRING_ENCODING ), salt, Cipher.ENCRYPT_MODE ); - - byte [] encryptedBytes = cipher.doFinal( clearBytes ); --- -1.7.11.7 - diff --git a/plexus-cipher-migration-to-component-metadata.patch b/plexus-cipher-migration-to-component-metadata.patch deleted file mode 100644 index ecedade..0000000 --- a/plexus-cipher-migration-to-component-metadata.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Naur plexus-cipher-1.5.orig/pom.xml plexus-cipher-1.5/pom.xml ---- plexus-cipher-1.5.orig/pom.xml 2009-09-14 13:50:04.000000000 +0200 -+++ plexus-cipher-1.5/pom.xml 2011-07-26 18:05:06.195978918 +0200 -@@ -25,12 +25,11 @@ - - - org.codehaus.plexus -- plexus-maven-plugin -- 1.3.5 -+ plexus-component-metadata - - - -- descriptor -+ generate-metadata - - - diff --git a/plexus-cipher.spec b/plexus-cipher.spec index 80a88e8..884e891 100644 --- a/plexus-cipher.spec +++ b/plexus-cipher.spec @@ -1,6 +1,6 @@ Name: plexus-cipher -Version: 1.5 -Release: 14%{?dist} +Version: 1.7 +Release: 1%{?dist} Summary: Plexus Cipher: encryption/decryption Component Group: Development/Libraries @@ -9,13 +9,9 @@ License: ASL 2.0 URL: https://github.com/sonatype/plexus-cipher # git clone https://github.com/sonatype/plexus-cipher.git # cd plexus-cipher/ -# there is no tag 1.5 in git repository -# git archive --format tar 6df2b65 | gzip -9 > plexus-cipher-1.5.tar.gz +# note this is version 1.7 + our patches which were incorporated by upstream maintainer +# git archive --format tar --prefix=plexus-cipher-1.7/ 0cff29e6b2e | gzip -9 > plexus-cipher-1.7.tar.gz Source0: %{name}-%{version}.tar.gz -Source1: http://apache.org/licenses/LICENSE-2.0.txt - -Patch0: %{name}-migration-to-component-metadata.patch -Patch1: 0001-Improve-randomness-of-PBECipher-salt.patch BuildArch: noarch @@ -37,6 +33,8 @@ BuildRequires: plexus-containers-component-metadata BuildRequires: junit BuildRequires: maven-shared-reporting-impl BuildRequires: plexus-digest +BuildRequires: sisu-maven-plugin +BuildRequires: sisu-inject-bean Requires: jpackage-utils Requires: java @@ -57,10 +55,8 @@ API documentation for %{name}. %prep %setup -q -%patch0 -p1 -%patch1 -p1 - -cp %{SOURCE1} . +# replace %{version}-SNAPSHOT with %{version} +%pom_xpath_replace pom:project/pom:version "%{version}" %build mvn-rpmbuild -Dmaven.test.failure.ignore=true \ @@ -80,16 +76,19 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/plexus/%{name}/ %add_maven_depmap JPP.plexus-%{name}.pom plexus/%{name}.jar %files -%doc LICENSE-2.0.txt NOTICE.txt +%doc LICENSE.txt NOTICE.txt %{_javadir}/plexus/* %{_mavenpomdir}/* %{_mavendepmapfragdir}/* %files javadoc -%doc LICENSE-2.0.txt NOTICE.txt +%doc LICENSE.txt NOTICE.txt %{_javadocdir}/plexus/%{name} %changelog +* Wed Mar 13 2013 Michal Srb - 1.7-1 +- Update to upstream version 1.7 + * Fri Feb 08 2013 Michal Srb - 1.5-14 - Remove unnecessary dependency on plexus-containers (#908586) diff --git a/sources b/sources index d120e6c..0b04675 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -4c61273327f3b8cb02a5ae9ea1e491dc plexus-cipher-1.5.tar.gz -3b83ef96387f14655fc854ddc3c6bd57 LICENSE-2.0.txt +052bfc5cab808a1fe012a8f7d840f6b0 plexus-cipher-1.7.tar.gz