From 920b1667d475ae32a6f642e5d6de6ad8e96cbbff Mon Sep 17 00:00:00 2001 From: Doug Kelly Date: Tue, 10 Nov 2015 12:13:58 -0800 Subject: [PATCH] Correct issue with Bouncy Castle code signing If the Bouncy Castle Crypto libraries are unsigned, issues result with the Eclipse build, since they rely on the copy that exists in the libraries copied by the download_file.py script. As a workaround, use a genrule in ConvertKey to unsign the JARs manually. Change-Id: I44d6ad5b05a18258e8bf5400c42f1cbd159e59b2 --- contrib/convertkey/BUCK | 34 ++++++++++++++++++++++++++++++++-- lib/bouncycastle/BUCK | 2 -- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/contrib/convertkey/BUCK b/contrib/convertkey/BUCK index 752f82adf0..40ad9c45ac 100644 --- a/contrib/convertkey/BUCK +++ b/contrib/convertkey/BUCK @@ -1,12 +1,42 @@ include_defs('//lib/maven.defs') +genrule( + name = 'bcprov__unsign', + cmd = ' && '.join([ + 'unzip -qd $TMP $(location //lib/bouncycastle:bcprov)', + 'cd $TMP', + 'zip -Drq $OUT . -x META-INF/\*.RSA META-INF/\*.DSA META-INF/\*.SF META-INF/\*.LIST', + ]), + out = 'bcprov-unsigned.jar', +) + +prebuilt_jar( + name = 'bcprov', + binary_jar = ':bcprov__unsign', +) + +genrule( + name = 'bcpkix__unsign', + cmd = ' && '.join([ + 'unzip -qd $TMP $(location //lib/bouncycastle:bcpkix)', + 'cd $TMP', + 'zip -Drq $OUT . -x META-INF/\*.RSA META-INF/\*.DSA META-INF/\*.SF META-INF/\*.LIST', + ]), + out = 'bcpkix-unsigned.jar', +) + +prebuilt_jar( + name = 'bcpkix', + binary_jar = ':bcpkix__unsign', +) + java_library( name = 'convertkey__lib', srcs = glob(['src/main/java/**/*.java']), deps = [ + ':bcprov', + ':bcpkix', '//lib:jsch', - '//lib/bouncycastle:bcprov', - '//lib/bouncycastle:bcpkix', '//lib/log:nop', '//lib/mina:sshd', ], diff --git a/lib/bouncycastle/BUCK b/lib/bouncycastle/BUCK index 21e6120803..0ce5817425 100644 --- a/lib/bouncycastle/BUCK +++ b/lib/bouncycastle/BUCK @@ -8,7 +8,6 @@ maven_jar( name = 'bcprov', id = 'org.bouncycastle:bcprov-jdk15on:' + VERSION, sha1 = '88a941faf9819d371e3174b5ed56a3f3f7d73269', - unsign = True, license = 'DO_NOT_DISTRIBUTE', #'bouncycastle' ) @@ -24,7 +23,6 @@ maven_jar( name = 'bcpkix', id = 'org.bouncycastle:bcpkix-jdk15on:' + VERSION, sha1 = 'b8ffac2bbc6626f86909589c8cc63637cc936504', - unsign = True, license = 'DO_NOT_DISTRIBUTE', #'bouncycastle' deps = [':bcprov'], )