Skip to content

Conversation

@aidangarske
Copy link
Contributor

@aidangarske aidangarske commented Dec 15, 2025

Description

Implements auto-derivation of EC public keys from private keys when importing private-only keys, matching OpenSSL master behavior (PR #29054, merged Dec 15, 2025). Failure caught here with master ossl build. Needed for #337

Changes

  • Implementation (src/wp_ecc_kmgmt.c): Auto-derive public key from private key when:
    • OpenSSL version > 3.6.0 (master or future releases)
    • Private key is present but public key is missing
    • Curve is set
  • Tests (test/test_ecc.c):
    • Updated test_ec_import_priv() to verify auto-derivation behavior based on OpenSSL version
    • Updated test_ec_auto_derive_pubkey() to only run when OpenSSL > 3.6.0
    • Added new unit test test_ec_auto_derive_pubkey() to specifically verify auto-derivation functionality
    • Wrapped test_ec_auto_derive_pub() in version guard to avoid unused function warnings

Compatibility

  • OpenSSL ≤ 3.6.0: No auto-derivation (backward compatible)
  • OpenSSL > 3.6.0 (master/future): Auto-derivation enabled to match OpenSSL behavior
  • verified behavior doesn't change with all master CI and all openssl-3.6.0 CI

Copy link
Contributor

@padelsbach padelsbach left a comment

Choose a reason for hiding this comment

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

Looks great, thanks

@ColtonWilley ColtonWilley merged commit b67af78 into wolfSSL:master Dec 16, 2025
370 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