Skip to content

Android test fixes and add Android FIPS Ready workflow#209

Merged
rlm2002 merged 10 commits intowolfSSL:masterfrom
cconlon:v1.10-android
Apr 2, 2026
Merged

Android test fixes and add Android FIPS Ready workflow#209
rlm2002 merged 10 commits intowolfSSL:masterfrom
cconlon:v1.10-android

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Apr 1, 2026

Summary

Fixes and improvements for running wolfCrypt JNI/JCE on Android with wolfSSL FIPS Ready, plus security hardening and dependency updates.

  • JCE KeyGenerator FIPS fix: sanitizeSecureRandom() now replaces a non-wolfJCE SecureRandom (e.g. AndroidOpenSSL) with a wolfJCE HashDRBG instead of throwing, fixing KeyGenerator.init(keysize) calls where the JDK auto-provides a platform default. Both engineInit(SecureRandom) and engineInit(int, SecureRandom) paths are now sanitized.
  • KeyPairGeneratorTest FIPS curve fix: Filter unsupported ECC curves in WolfCryptKeyPairGeneratorTest via trial key generation in @BeforeClass, skip ECC setup entirely when not compiled in, and assert at least one curve is usable when ECC is enabled
  • ChaCha/Des3 test reporting: Move availability check from @BeforeClass Assume to @Rule so tests are individually reported as skipped on Android instead of silently dropped from the instrumented test count
  • RSA test FIPS retry: Add retry on transient PRIME_GEN_E in RsaTest.testMakeKey for FIPS builds where the prime generation loop has a finite retry count
  • Android BKS support: Add convert-to-bks.sh script and update IDE/Android/README.md with instructions for converting JKS KeyStores to BKS format
  • FIPS Ready CI workflow: New android_gradle_fipsready.yml that downloads the latest wolfSSL FIPS Ready archive, uses a two-pass build to capture and set the in-core integrity hash, generates BKS files, and runs the full instrumented test suite
  • Security: pin Bouncy Castle downloads (F-1803): Pin BC version in CryptoBenchmark.sh and verify SHA-256 hashes on download instead of fetching unpinned latest from Maven Central
  • Security: replace jcenter() (F-1804): Replace deprecated jcenter() with mavenCentral() in Android Gradle config, migrate from Android Support Library to AndroidX
  • Flaky test fix: Relax KEK cache timing assertion in WolfSSLKeyStoreTest to avoid failures on loaded CI runners

@cconlon cconlon self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 22:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves Android (instrumented) test stability and adds CI support for running wolfCrypt JNI/JCE on Android with wolfSSL FIPS Ready.

Changes:

  • Add FIPS-mode RSA key generation retry logic and refine ECC curve enablement checks in tests.
  • Improve Android test reporting by switching ChaCha/3DES availability checks from @BeforeClass assumptions to per-test @Rule skipping.
  • Add BKS keystore conversion tooling/docs and introduce a new GitHub Actions workflow to build/test Android against the latest FIPS Ready archive.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/java/com/wolfssl/wolfcrypt/test/RsaTest.java Adds RSA keygen retry helper for transient FIPS prime-gen failures.
src/test/java/com/wolfssl/wolfcrypt/test/Des3Test.java Adjusts class-level setup to print class name while availability is handled via a Rule.
src/test/java/com/wolfssl/wolfcrypt/test/ChachaTest.java Moves ChaCha availability logic into a Rule so skips are reported per-test.
src/test/java/com/wolfssl/provider/jce/test/WolfCryptKeyPairGeneratorTest.java Filters unsupported EC curves by trial key generation; expands expected error matching.
src/main/java/com/wolfssl/provider/jce/WolfCryptKeyGenerator.java Changes FIPS SecureRandom sanitization to replace non-wolfJCE RNGs with HashDRBG.
IDE/Android/README.md Documents converting JKS keystores to BKS for Android tests and updates setup steps.
examples/certs/convert-to-bks.sh Adds a helper script to convert test JKS keystores into BKS format.
.gitignore Ignores an additional Android Studio .idea file.
.github/workflows/android_gradle_fipsready.yml Adds a CI workflow to download FIPS Ready, do 2-pass build for integrity hash, generate BKS, and run instrumented tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 1, 2026 23:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 16:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cconlon cconlon assigned rlm2002 and unassigned cconlon Apr 2, 2026
@rlm2002 rlm2002 assigned cconlon and unassigned rlm2002 Apr 2, 2026
@rlm2002 rlm2002 merged commit bf703b9 into wolfSSL:master Apr 2, 2026
80 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants