Update to upstream version 1.7
This commit is contained in:
parent
97d6393a28
commit
5156fc05b6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
plexus-cipher-1.5.tar.gz
|
plexus-cipher-1.5.tar.gz
|
||||||
/LICENSE-2.0.txt
|
/LICENSE-2.0.txt
|
||||||
|
/plexus-cipher-1.7.tar.gz
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
From f9975b549fcb2453b1127ceccfd1f8061e35a618 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
|
||||||
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
|
|
||||||
|
|
@ -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 @@
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
- <artifactId>plexus-maven-plugin</artifactId>
|
|
||||||
- <version>1.3.5</version>
|
|
||||||
+ <artifactId>plexus-component-metadata</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
- <goal>descriptor</goal>
|
|
||||||
+ <goal>generate-metadata</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
@ -1,6 +1,6 @@
|
|||||||
Name: plexus-cipher
|
Name: plexus-cipher
|
||||||
Version: 1.5
|
Version: 1.7
|
||||||
Release: 14%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Plexus Cipher: encryption/decryption Component
|
Summary: Plexus Cipher: encryption/decryption Component
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -9,13 +9,9 @@ License: ASL 2.0
|
|||||||
URL: https://github.com/sonatype/plexus-cipher
|
URL: https://github.com/sonatype/plexus-cipher
|
||||||
# git clone https://github.com/sonatype/plexus-cipher.git
|
# git clone https://github.com/sonatype/plexus-cipher.git
|
||||||
# cd plexus-cipher/
|
# cd plexus-cipher/
|
||||||
# there is no tag 1.5 in git repository
|
# note this is version 1.7 + our patches which were incorporated by upstream maintainer
|
||||||
# git archive --format tar 6df2b65 | gzip -9 > plexus-cipher-1.5.tar.gz
|
# git archive --format tar --prefix=plexus-cipher-1.7/ 0cff29e6b2e | gzip -9 > plexus-cipher-1.7.tar.gz
|
||||||
Source0: %{name}-%{version}.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
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -37,6 +33,8 @@ BuildRequires: plexus-containers-component-metadata
|
|||||||
BuildRequires: junit
|
BuildRequires: junit
|
||||||
BuildRequires: maven-shared-reporting-impl
|
BuildRequires: maven-shared-reporting-impl
|
||||||
BuildRequires: plexus-digest
|
BuildRequires: plexus-digest
|
||||||
|
BuildRequires: sisu-maven-plugin
|
||||||
|
BuildRequires: sisu-inject-bean
|
||||||
|
|
||||||
Requires: jpackage-utils
|
Requires: jpackage-utils
|
||||||
Requires: java
|
Requires: java
|
||||||
@ -57,10 +55,8 @@ API documentation for %{name}.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
%patch0 -p1
|
# replace %{version}-SNAPSHOT with %{version}
|
||||||
%patch1 -p1
|
%pom_xpath_replace pom:project/pom:version "<version>%{version}</version>"
|
||||||
|
|
||||||
cp %{SOURCE1} .
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mvn-rpmbuild -Dmaven.test.failure.ignore=true \
|
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
|
%add_maven_depmap JPP.plexus-%{name}.pom plexus/%{name}.jar
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc LICENSE-2.0.txt NOTICE.txt
|
%doc LICENSE.txt NOTICE.txt
|
||||||
%{_javadir}/plexus/*
|
%{_javadir}/plexus/*
|
||||||
%{_mavenpomdir}/*
|
%{_mavenpomdir}/*
|
||||||
%{_mavendepmapfragdir}/*
|
%{_mavendepmapfragdir}/*
|
||||||
|
|
||||||
%files javadoc
|
%files javadoc
|
||||||
%doc LICENSE-2.0.txt NOTICE.txt
|
%doc LICENSE.txt NOTICE.txt
|
||||||
%{_javadocdir}/plexus/%{name}
|
%{_javadocdir}/plexus/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 13 2013 Michal Srb <msrb@redhat.com> - 1.7-1
|
||||||
|
- Update to upstream version 1.7
|
||||||
|
|
||||||
* Fri Feb 08 2013 Michal Srb <msrb@redhat.com> - 1.5-14
|
* Fri Feb 08 2013 Michal Srb <msrb@redhat.com> - 1.5-14
|
||||||
- Remove unnecessary dependency on plexus-containers (#908586)
|
- Remove unnecessary dependency on plexus-containers (#908586)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user