From 085ea6d0a1ba295fa26fd6d06d5b9eac69cf5c47 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Thu, 4 Jul 2019 03:20:09 -0300 Subject: [PATCH] SignBoot: use verity keys not testkey to correctly follow AOSP --- .../java/com/topjohnwu/signing/SignBoot.java | 4 +-- signing/src/main/resources/keys/verity.pk8 | Bin 0 -> 1219 bytes .../src/main/resources/keys/verity.x509.pem | 24 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 signing/src/main/resources/keys/verity.pk8 create mode 100644 signing/src/main/resources/keys/verity.x509.pem diff --git a/signing/src/main/java/com/topjohnwu/signing/SignBoot.java b/signing/src/main/java/com/topjohnwu/signing/SignBoot.java index e75357e8b..5e8086bbb 100644 --- a/signing/src/main/java/com/topjohnwu/signing/SignBoot.java +++ b/signing/src/main/java/com/topjohnwu/signing/SignBoot.java @@ -87,12 +87,12 @@ public class SignBoot { in.unread(hdr); BootSignature bootsig = new BootSignature(target, signableSize); if (cert == null) { - cert = SignBoot.class.getResourceAsStream("/keys/testkey.x509.pem"); + cert = SignBoot.class.getResourceAsStream("/keys/verity.x509.pem"); } X509Certificate certificate = CryptoUtils.readCertificate(cert); bootsig.setCertificate(certificate); if (key == null) { - key = SignBoot.class.getResourceAsStream("/keys/testkey.pk8"); + key = SignBoot.class.getResourceAsStream("/keys/verity.pk8"); } PrivateKey privateKey = CryptoUtils.readPrivateKey(key); byte[] sig = bootsig.sign(privateKey, in, signableSize); diff --git a/signing/src/main/resources/keys/verity.pk8 b/signing/src/main/resources/keys/verity.pk8 new file mode 100644 index 0000000000000000000000000000000000000000..bebf216cb6004b5c6665d044916c8a5a70f4a12b GIT binary patch literal 1219 zcmV;!1U&mNf&{+;0RS)!1_>&LNQUrsW5^Br2+u}0)hbn0O;#@O)pJU zk$QWxJKN`JXXMf3GhwFmf~sQc5HpLXW)JJ2phAh6v*Nf;L&5#EipG7q6%@NiP&1C5 zD~cQ|6A`V+<{KQH7JjIH&CU#y7dlJ!fThd)S6dMGLvI}2yUh2>PnPSuoiq2=?Pl6T zaL&?6?)ogsYESo1ja=sH7nu(=P}@Mw5wjV{O;vLyTI9w$NIFyP2-!D#E6lG@#i0RX z&!nR5RDWv#zEjRN4M*Lg&C;CDa3e;-HwifHrX@fGXP418BSkBj2eQ2ou6i9`juh0o zBU4X}(EAjGp~z`!sh3nbKon($r*4=YPm_BShO<@1mVAVlm$ zD9=yWK|e}|G5TSFSQRFzdH*xY zgIPN*BNBwfol-TXX5#p5)M)dPl7jmJQ2Gv(*Ym!j$FB{5swvIpd-Slm)`GxcHM>N< z=qwC5ks5erFMHPzIEXs4156qVPhcaHx|jz4_eld#x|4N6g;ISU`V^mclfpv-O5-}s zCDaLL1Up}63MrecTJ4u}ku{vxgXcqjtWUEC09s5Q2)zY>lWfc=XuX&M^1V3`QYB$9*s{u3$!abr0$fUJ z-12GL=T3KRPhSrASRWxC4Q0urGV;N^XA z(~i%%tC+CGVzR;ACxiZOzztALDPz}*l?T220d|ALu*L%VKTw`qR9YCy6s^XC;N|^x zul{=N zxMq-2@ZMecjS-do1NIF#cZ?k}jaJ5br_xSWG zb~V#f9(rZtO=Is~*?;GDu(P&EhR3l3vD*_CUl`&1rfw4z)+vb2OAfb9b>HpD2)1|X zHff6lW9d0QbM@FopS{X-j{?^ndXUUrpQG5+qVDrwoszQpxbtr<-zTL5q~cNgVs+&@ z2C)KxfdHOmL!fWm!wfP<2Mlq=g8;nS3Mq#2s_*R^>nR|;8&bwy?9T|Fo6wYa_|xdV zOUsZ*;cW!aem(yO0-@)ToG{KSNO$)g^D87t%DobVP%fxxWmfP hk4vOBJnVsAiAcI)+4Ln>*X%OBo25xJ{%5YX31a)eQE>nO literal 0 HcmV?d00001 diff --git a/signing/src/main/resources/keys/verity.x509.pem b/signing/src/main/resources/keys/verity.x509.pem new file mode 100644 index 000000000..86399c3c1 --- /dev/null +++ b/signing/src/main/resources/keys/verity.x509.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIF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