From d5843163b48dd9bcc67e00c146d6cf8cbb414115 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 18 Mar 2018 05:26:38 -0400 Subject: [PATCH] send everything but the root certificate --- .../java/co/copperhead/attestation/AttestationProtocol.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/co/copperhead/attestation/AttestationProtocol.java b/app/src/main/java/co/copperhead/attestation/AttestationProtocol.java index 6e4ad68b..ee20f0e6 100644 --- a/app/src/main/java/co/copperhead/attestation/AttestationProtocol.java +++ b/app/src/main/java/co/copperhead/attestation/AttestationProtocol.java @@ -121,8 +121,6 @@ class AttestationProtocol { // // Attestation message: // - // PROTOCOL_VERSION == 1 implies certificateCount == 2 - // // The Auditor will eventually start trying to be backwards compatible with older Auditee app // versions but not the other way around. // @@ -132,7 +130,7 @@ class AttestationProtocol { // signed message { // byte version = min(maxVersion, PROTOCOL_VERSION) // short compressedChainLength - // byte[] compressedChain { [short encodedCertificateLength, byte[] encodedCertificate] x certificateCount } + // byte[] compressedChain { [short encodedCertificateLength, byte[] encodedCertificate] } // byte[] fingerprint (length: FINGERPRINT_LENGTH) // byte osEnforcedFlags // } @@ -851,7 +849,7 @@ static AttestationResult generateSerialized(final Context context, final byte[] serializer.put((byte) Math.min(PROTOCOL_VERSION, maxVersion)); final ByteBuffer chainSerializer = ByteBuffer.allocate(MAX_ENCODED_CHAIN_LENGTH); - final int certificateCount = attestationCertificates.length - 2; + final int certificateCount = attestationCertificates.length - 1; for (int i = 0; i < certificateCount; i++) { final byte[] encoded = attestationCertificates[i].getEncoded(); if (encoded.length > Short.MAX_VALUE) {