Repository navigation
[encryption] fix MGF1 digest for Keystore-backed keys #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
capcom6
wants to merge
2
commits into
master
Choose a base branch
from
encryption/mgf1-digest-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Instrumented Tests | ||
|
|
||
| on: | ||
| pull_request: { types: [opened, synchronize, ready_for_review] } | ||
| push: { branches: [master] } | ||
|
|
||
| jobs: | ||
| # Device-paired E2E lives behind Android Keystore, whose RSA-OAEP behaviour is | ||
| # API-level dependent, so a JVM unit test cannot cover it - build-apk.yml only runs | ||
| # `./gradlew test`. These levels are the ones that matter: 25 and 30 exercise the | ||
| # Keystore1 provider, and 35 is the first level on which Keystore2 enforces the | ||
| # MGF1 digest against the key's authorised set. The pre-M KeyPairGeneratorSpec | ||
| # branch (API 21-22) is not covered here. Dropping any of these levels silently | ||
| # re-opens the MGF1 regression that shipped broken in v1.77.0. | ||
| encryption: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| api-level: [25, 30, 35] | ||
| name: Instrumented tests (API ${{ matrix.api-level }}) | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup JAVA 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: "temurin" | ||
| java-version: 17 | ||
|
|
||
| - name: Cache Gradle and wrapper | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
|
|
||
| - name: Setup Google Services | ||
| run: echo ${{ secrets.GOOGLE_SERVICES_JSON }} | base64 --decode > ./app/google-services.json | ||
|
|
||
| - name: Grant KVM | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \ | ||
| | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| # Run via `am instrument` rather than `connectedDebugAndroidTest`: the Unified | ||
| # Test Platform launcher bundled with AGP 8.1.2 throws a protobuf | ||
| # IllegalAccessError while parsing the device's AppProcessesProto on API 35, | ||
| # aborting the run with "0 tests" / INSTRUMENTATION_FAILED. Direct | ||
| # instrumentation is unaffected. | ||
| - name: Run instrumented tests | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: ${{ matrix.api-level }} | ||
| arch: x86_64 | ||
| disable-animations: true | ||
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
| script: | | ||
| ./gradlew :app:assembleDebug :app:assembleDebugAndroidTest | ||
| adb install -r app/build/outputs/apk/debug/app-debug.apk | ||
| adb install -r app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk | ||
| adb shell am instrument -w me.capcom.smsgateway.test/androidx.test.runner.AndroidJUnitRunner | tee instrumented-output.txt | ||
| if ! grep -qE "OK \([1-9][0-9]* tests?\)" instrumented-output.txt || grep -q "FAILURES!!!" instrumented-output.txt; then adb logcat -d > logcat.txt; exit 1; fi | ||
|
|
||
| - name: Upload test report | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: instrumented-test-report-api-${{ matrix.api-level }} | ||
| path: | | ||
| instrumented-output.txt | ||
| logcat.txt | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.