commit 066bcb1045e31a8734035e48b37e55dcd235ecfe Author: Michal Srb msrb@redhat.com Date: Fri Mar 21 10:53:51 2014 +0100
Initial import
.gitignore | 1 + 0001-Update-bouncycastle-to-1.50.patch | 61 ++++++++++++++++++++++++++++++++ jenkins-instance-identity.spec | 59 ++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 122 insertions(+), 0 deletions(-) --- diff --git a/.gitignore b/.gitignore index e69de29..f9950c2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/instance-identity-1.3.tar.gz diff --git a/0001-Update-bouncycastle-to-1.50.patch b/0001-Update-bouncycastle-to-1.50.patch new file mode 100644 index 0000000..00208d9 --- /dev/null +++ b/0001-Update-bouncycastle-to-1.50.patch @@ -0,0 +1,61 @@ +From ae05b90bb0e6aa55b68685de37f2405906558adf Mon Sep 17 00:00:00 2001 +From: Michal Srb msrb@redhat.com +Date: Tue, 25 Feb 2014 11:02:00 +0100 +Subject: [PATCH] Update bouncycastle to 1.50 + +--- + pom.xml | 2 +- + .../main/modules/instance_identity/InstanceIdentity.java | 10 +++------- + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 9aabe6f..0cc9e47 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -40,7 +40,7 @@ + <dependency> + <groupId>org.bouncycastle</groupId> + <artifactId>bcpkix-jdk15on</artifactId> +- <version>1.47</version> ++ <version>1.50</version> + </dependency> + </dependencies> + </project> +diff --git a/src/main/java/org/jenkinsci/main/modules/instance_identity/InstanceIdentity.java b/src/main/java/org/jenkinsci/main/modules/instance_identity/InstanceIdentity.java +index 4feedad..9632f30 100644 +--- a/src/main/java/org/jenkinsci/main/modules/instance_identity/InstanceIdentity.java ++++ b/src/main/java/org/jenkinsci/main/modules/instance_identity/InstanceIdentity.java +@@ -3,7 +3,7 @@ package org.jenkinsci.main.modules.instance_identity; + import hudson.FilePath; + import hudson.model.Hudson; + import hudson.model.PageDecorator; +-import org.bouncycastle.openssl.PEMReader; ++import org.bouncycastle.openssl.PEMParser; + import org.bouncycastle.openssl.PEMWriter; + + import java.io.File; +@@ -40,11 +40,7 @@ public class InstanceIdentity { + if (keyFile.exists()) { + FileReader in = new FileReader(keyFile); + try { +- // a hack to work around a problem in PEMReader (or JCE, depending on how you look at it.) +- // I can't just pass in null as a provider --- JCE doesn't default to the default provider, +- // but it chokes that I passed in null. Urgh. +- final String provider = KeyPairGenerator.getInstance("RSA").getProvider().getName(); +- keys = (KeyPair)new PEMReader(in,null,provider).readObject(); ++ keys = (KeyPair)new PEMParser(in).readObject(); + } finally { + in.close(); + } +@@ -53,7 +49,7 @@ public class InstanceIdentity { + gen.initialize(2048,new SecureRandom()); // going beyond 2048 requires crypto extension + keys = gen.generateKeyPair(); + +- PEMWriter w = new PEMWriter(new FileWriter(keyFile),"SunJCE"); ++ PEMWriter w = new PEMWriter(new FileWriter(keyFile)); + try { + w.writeObject(keys); + } finally { +-- +1.8.5.3 + diff --git a/jenkins-instance-identity.spec b/jenkins-instance-identity.spec new file mode 100644 index 0000000..54624a9 --- /dev/null +++ b/jenkins-instance-identity.spec @@ -0,0 +1,59 @@ +%global mod_name instance-identity-module +%global short_name instance-identity + +Name: jenkins-instance-identity +Version: 1.3 +Release: 1%{?dist} +Summary: Jenkins identity instance + +License: MIT +URL: https://github.com/jenkinsci/instance-identity-module +Source0: https://github.com/jenkinsci/%%7Bmod_name%7D/archive/%%7Bshort_name%7D-%%7Bv... + +Patch0: 0001-Update-bouncycastle-to-1.50.patch + +BuildRequires: maven-local +BuildRequires: mvn(org.bouncycastle:bcmail-jdk15on) +BuildRequires: mvn(org.bouncycastle:bcprov-jdk15on) +BuildRequires: mvn(org.jenkins-ci.plugins:plugin:pom:) +BuildRequires: mvn(org.jenkins-ci.tools:maven-hpi-plugin) + +BuildArch: noarch + +%description +Maintains an RSA key pair that can serve as a foundation of authentication when +communicating with Jenkins + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n %{mod_name}-%{short_name}-%{version} + +%patch0 -p1 + +# TODO: remove when #1022551 is resolved +%pom_remove_dep org.bouncycastle:bcpkix-jdk15on +%pom_add_dep org.bouncycastle:bcprov-jdk15on +%pom_add_dep org.bouncycastle:bcmail-jdk15on + +%build +# tests are disabled because "package org.jvnet.hudson.test does not exist" +%mvn_build -f + +%install +%mvn_install + +%files -f .mfiles +%dir %{_javadir}/%{name} +%doc LICENSE.txt +%files javadoc -f .mfiles-javadoc +%doc LICENSE.txt + +%changelog +* Fri Nov 08 2013 Michal Srb msrb@redhat.com - 1.3-1 +- Initial packaging + diff --git a/sources b/sources index e69de29..c42e0de 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +98b3eba5b41e84545c12e232c4a4878a instance-identity-1.3.tar.gz
java-sig-commits@lists.fedoraproject.org