Content-Length: 252629 | pFad | http://github.com/ActorExpose/apkverifier/commit/3ecfb3e028ee4e3e6a05f5590376ce8c476eae8f

DF Add TestSignaturesIgnoredForMaxSDK test · ActorExpose/apkverifier@3ecfb3e · GitHub
Skip to content

Commit

Permalink
Add TestSignaturesIgnoredForMaxSDK test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Oct 11, 2019
1 parent 069af32 commit 3ecfb3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion apkverifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Example() {
}
}

// From https://android.googlesource.com/platform/tools/apksig
// From https://android.googlesource.com/platform/tools/apksig 5941d7112b28d5dada825aad757781f0b3ecf23b
var (
DSA_KEY_NAMES = []string{"1024", "2048", "3072"}
DSA_KEY_NAMES_1024_AND_SMALLER = []string{"1024"}
Expand Down Expand Up @@ -168,6 +168,14 @@ func TestV3StrippedRejected(t *testing.T) {
assertVerificationFailure(t, "v3-stripped.apk", "was stripped, downgrade attack")
}

func TestSignaturesIgnoredForMaxSDK(t *testing.T) {
// The V2 signature scheme was introduced in N, and V3 was introduced in P. This test
// verifies a max SDK of pre-P ignores the V3 signature and a max SDK of pre-N ignores both
// the V2 and V3 signatures.
assertVerifiedSdk(t, "v1v2v3-with-rsa-2048-lineage-3-signers.apk", -1, 26)
assertVerifiedSdk(t, "v1v2v3-with-rsa-2048-lineage-3-signers.apk", -1, 23)
}

func TestV2OneSignerOneSignatureAccepted(t *testing.T) {
// APK signed with v2 scheme only, one signer, one signature
assertVerifiedForEachSdk(t, "v2-only-with-dsa-sha256-%s.apk", DSA_KEY_NAMES, 25, math.MaxInt32)
Expand Down
2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eux

if ! [ -d "apksig_for_tests" ]; then
git clone --depth=1 -b oreo-mr1-iot-release https://android.googlesource.com/platform/tools/apksig apksig_for_tests
git clone --depth=1 -b android-o-mr1-iot-release-1.0.14 https://android.googlesource.com/platform/tools/apksig apksig_for_tests
else
echo "Using cached apksig_for_test directory"
fi
Expand Down

0 comments on commit 3ecfb3e

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ActorExpose/apkverifier/commit/3ecfb3e028ee4e3e6a05f5590376ce8c476eae8f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy