From 6cf2668ec7cd00982717c65fbb5f26051c03c27f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 8 Sep 2024 02:47:21 -0400 Subject: [PATCH] drop support for earlier protocol versions Protocol version 5 was introduced with app version 73 so that becomes the new minimum app version. --- .../auditor/AttestationProtocol.java | 8 ++++---- app/src/main/res/raw/deflate_dictionary_3.bin | Bin 10877 -> 0 bytes 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 app/src/main/res/raw/deflate_dictionary_3.bin diff --git a/app/src/main/java/app/attestation/auditor/AttestationProtocol.java b/app/src/main/java/app/attestation/auditor/AttestationProtocol.java index e9b3bd283..20672e5be 100644 --- a/app/src/main/java/app/attestation/auditor/AttestationProtocol.java +++ b/app/src/main/java/app/attestation/auditor/AttestationProtocol.java @@ -191,7 +191,7 @@ class AttestationProtocol { // downgrade protection for the OS version/patch (bootloader/TEE enforced) and app version (OS // enforced) by keeping them updated. private static final byte PROTOCOL_VERSION = 5; - private static final byte PROTOCOL_VERSION_MINIMUM = 4; + private static final byte PROTOCOL_VERSION_MINIMUM = 5; // can become longer in the future, but this is the minimum length static final byte CHALLENGE_MESSAGE_LENGTH = 1 + CHALLENGE_LENGTH * 2; private static final int MAX_ENCODED_CHAIN_LENGTH = 5000; @@ -233,7 +233,7 @@ class AttestationProtocol { private static final byte AUDITOR_APP_VARIANT_PLAY = 1; private static final byte AUDITOR_APP_VARIANT_DEBUG = 2; - private static final int AUDITOR_APP_MINIMUM_VERSION = 47; + private static final int AUDITOR_APP_MINIMUM_VERSION = 73; private static final int OS_VERSION_MINIMUM = 120000; private static final int OS_PATCH_LEVEL_MINIMUM = 202110; private static final int VENDOR_PATCH_LEVEL_MINIMUM = 20211005; @@ -1246,7 +1246,7 @@ static VerificationResult verifySerialized(final Context context, final byte[] a deserializer.get(compressedChain); final Certificate[] certificates; - final int dictionary = version < 5 ? R.raw.deflate_dictionary_3 : R.raw.deflate_dictionary_4; + final int dictionary = R.raw.deflate_dictionary_4; certificates = decodeChain(readRawResource(context, dictionary), compressedChain); final byte[] fingerprint = new byte[FINGERPRINT_LENGTH]; @@ -1501,7 +1501,7 @@ static AttestationResult generateSerialized(final Context context, final byte[] serializer.put(version); final byte[] compressed; - final int dictionary = version < 5 ? R.raw.deflate_dictionary_3 : R.raw.deflate_dictionary_4; + final int dictionary = R.raw.deflate_dictionary_4; compressed = encodeChain(readRawResource(context, dictionary), attestationCertificates); if (compressed.length > Short.MAX_VALUE) { diff --git a/app/src/main/res/raw/deflate_dictionary_3.bin b/app/src/main/res/raw/deflate_dictionary_3.bin deleted file mode 100644 index 5febb7ec2b620e674863163e4696fc080c973670..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10877 zcmeHN2UJt*mQEw|-bDlz5JBK1q@ncQ1O!AnB%w-gQbl@^qJp3TB1IGs1Qifa2q;DB z1*IxQst8Cgf(jG7&Wzr5-*w*1x@*l_&t&D~?341J|9s!x|NizqKo}$*2!kNApb#(w z0tN##a4L}~^-dWW6aq*g=*TwoG>nc8YN(=uI0_uuvnW{ku>cV%g+pTi8=NiDmOvm% z+7fIfr3f}y6c%TLA_50E>9GKSAV0r8OgZUMxbIAW55WuY?EM*(l}*9b#?#HwhF{Cp z-^<(0({^tMFacQMlwZ#T0{(VNP%tG_5d>r2-gNC0u2g;eR7de~KYrD_d^s`ZB^A0` zpHcDPu|P%XdYx^%v=`iyT?OSgk6N|e33&XOZ{F!X%V)Kq$BOI7+%T{b5C)b57|7%E zGJ?UoF!E$6L&(QO;WVOfFbv%14*@g7!oWP_W1JAM4GkFl`xXZG!n?RT+rmJAF)31p z3IYd*^q^DbNs%h*FjYVqaRAs4k$NAkoVU@^oY82=3h z*iw`h_p)xp+ezeRZt}{tdrYQ>>c<|?DvM|m8jb;>x3j4b@UM74bI7e3Z@{E*UkC+=6e&wK$Zzu6fF_Jz@dHmQTH;=h@T$(G&gmoP*4mEQy>$zl%Dc6u zp>I!mMxH4R7zE?5d^23RK2X^zfm5e|3B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