Skip to content

Comments

Add Command-Line Integration Tests for AES, RSA, RSA-PSS, HASH, and ECC Operations#95

Merged
ColtonWilley merged 7 commits intowolfSSL:masterfrom
aidangarske:cmd_tests1
Apr 22, 2025
Merged

Add Command-Line Integration Tests for AES, RSA, RSA-PSS, HASH, and ECC Operations#95
ColtonWilley merged 7 commits intowolfSSL:masterfrom
aidangarske:cmd_tests1

Conversation

@aidangarske
Copy link
Member

@aidangarske aidangarske commented Mar 25, 2025

Description

This PR adds a comprehensive suite of command-line integration tests to verify interoperability between wolfProvider and OpenSSL's default provider. The tests cover key generation, signing/verification, encryption/decryption, and hashing operations using AES, RSA, RSA-PSS, HASH, and ECC.

New Test Coverage

RSA Tests (rsa-cmd-test.sh)

  • Tests both standard RSA and RSA-PSS key generation
  • Key sizes: 2048, 3072, and 4096 bits
  • Tests key generation with default provider
  • Tests public key extraction
  • Tests sign/verify operations with both providers:
    • Sign with default, verify with wolf
    • Sign with wolf, verify with default
    • Full cross-provider interoperability testing

ECC Tests (ecc-cmd-test.sh)

  • Tests ECDSA key generation and operations
  • Supported curves: prime192v1, secp224r1, prime256v1, secp384r1, and secp521r1
  • Tests key generation with default provider
  • Tests public key extraction
  • Tests sign/verify operations:
    • Sign with default, verify with wolf
    • Sign with wolf, verify with default
    • Cross-provider verification
  • Tests ECDH key agreement between providers

AES Tests (aes-cmd-test.sh)

  • Tests AES-128, AES-192, and AES-256
  • Supported modes: ECB, CBC, CTR, CFB
  • Tests encryption/decryption interoperability:
    • Encrypt with default, decrypt with wolf
    • Encrypt with wolf, decrypt with default
  • Random key and IV generation for each test

Hash Tests (hash-cmd-test.sh)

  • Tests SHA-1, SHA-224, SHA-256, SHA-384, SHA-512
  • Compares hash outputs between providers
  • Verifies consistent results across providers

Testing

  • Added test scripts to simple.yml CI workflow
  • Added 'WOLFPROV_FORCE_FAIL=1` check to simple.yml
  • If tests hit [FAIL] will exit with 1 and immediately exit

All tests can be run using:

./scripts/cmd_test/do-cmd-tests.sh

Each test script can also be run individually:

./scripts/cmd_test/rsa-cmd-test.sh
./scripts/cmd_test/aes-cmd-test.sh
./scripts/cmd_test/hash-cmd-test.sh
./scripts/cmd_test/ecc-cmd-test.sh

Initial PR -> #88

@aidangarske aidangarske self-assigned this Mar 25, 2025
@aidangarske aidangarske requested a review from Copilot March 27, 2025 20:36

This comment was marked as resolved.

@aidangarske aidangarske marked this pull request as ready for review April 2, 2025 22:58
ColtonWilley
ColtonWilley previously approved these changes Apr 16, 2025
@ColtonWilley ColtonWilley merged commit eff28c0 into wolfSSL:master Apr 22, 2025
45 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