commit 87aa3494a57e0a545e6e0fd661071d0a0bbd51fc Author: Michal Srb msrb@redhat.com Date: Mon Mar 31 15:28:44 2014 +0200
Fix ClassCastException in bouncycastle patch
0001-Update-bouncycastle-to-1.50.patch | 25 +++++++++++++++---------- jenkins-instance-identity.spec | 5 ++++- 2 files changed, 19 insertions(+), 11 deletions(-) --- diff --git a/0001-Update-bouncycastle-to-1.50.patch b/0001-Update-bouncycastle-to-1.50.patch index 00208d9..44a6291 100644 --- a/0001-Update-bouncycastle-to-1.50.patch +++ b/0001-Update-bouncycastle-to-1.50.patch @@ -1,12 +1,12 @@ -From ae05b90bb0e6aa55b68685de37f2405906558adf Mon Sep 17 00:00:00 2001 +From b778048a262d7bccbb3521c19c627b0d0b944fa5 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(-) + pom.xml | 2 +- + .../main/modules/instance_identity/InstanceIdentity.java | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml index 9aabe6f..0cc9e47 100644 @@ -22,19 +22,23 @@ index 9aabe6f..0cc9e47 100644 </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 +index 4feedad..b3e534c 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; +@@ -3,8 +3,11 @@ 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.PEMKeyPair; +import org.bouncycastle.openssl.PEMParser; import org.bouncycastle.openssl.PEMWriter; ++import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
import java.io.File; -@@ -40,11 +40,7 @@ public class InstanceIdentity { + import java.io.FileReader; +@@ -40,11 +43,8 @@ public class InstanceIdentity { if (keyFile.exists()) { FileReader in = new FileReader(keyFile); try { @@ -43,11 +47,12 @@ index 4feedad..9632f30 100644 - // 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(); ++ PEMKeyPair kp = (PEMKeyPair) new PEMParser(in).readObject(); ++ keys = new JcaPEMKeyConverter().getKeyPair(kp); } finally { in.close(); } -@@ -53,7 +49,7 @@ public class InstanceIdentity { +@@ -53,7 +53,7 @@ public class InstanceIdentity { gen.initialize(2048,new SecureRandom()); // going beyond 2048 requires crypto extension keys = gen.generateKeyPair();
@@ -57,5 +62,5 @@ index 4feedad..9632f30 100644 w.writeObject(keys); } finally { -- -1.8.5.3 +1.9.0
diff --git a/jenkins-instance-identity.spec b/jenkins-instance-identity.spec index 54624a9..38f1ea5 100644 --- a/jenkins-instance-identity.spec +++ b/jenkins-instance-identity.spec @@ -3,7 +3,7 @@
Name: jenkins-instance-identity Version: 1.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Jenkins identity instance
License: MIT @@ -54,6 +54,9 @@ This package contains the API documentation for %{name}. %doc LICENSE.txt
%changelog +* Mon Mar 31 2014 Michal Srb msrb@redhat.com - 1.3-2 +- Fix ClassCastException in bouncycastle patch + * Fri Nov 08 2013 Michal Srb msrb@redhat.com - 1.3-1 - Initial packaging