Repository navigation
Conversation
|
If I remember correctly, it was because of perfomance reasons, probably DNSSec related |
|
I definitely advocated not to derive the public key automatically on-demand from the private key during operations that required the public part, as that could be weaponized to trigger a scalar multiplication remotely to exploit the non-const-time bignum (and sometime EC, depending on the backend implementation). This PR derives it in on |
|
So should I simply remove offending tests? Or try to make sure they do not use _fromdata() and preserve some of them? something else? |
Scalar multiplication is also the operation one performs for EC operations in the first place. If that's leaky, what hope do you have to of using the key under this threat model in the first place? (I have not checked whether it's always constant-time or not in OpenSSL, but I don't see how deriving the public key has any impact here.) |
|
@simo5 I think yes, try to make sure that they don't use _fromdata and preserve as much as possible |
Update ossl_ec_key_fromdata to compute the public key if it is not provided in the input parameters but the private key is. This allows for the creation of a complete EC_KEY object from only private key data. Signed-off-by: Simo Sorce <simo@redhat.com>
|
@openssl/committers need a second pair of eyes here |
Why would specifically DNSSEC deployments be averse to deriving the public key from the private key? In BIND, both parts of the key are pregenerated, and stored in custom internal formats (32 byte raw exponent and 64-byte uncompressed public point): The signer can choose to import both parts of the key or just the private key, though the The scenario that comes to mind is some system that hosts a very large number of zones, preloading all their private keys into memory on startup, loading only the private components. I am not convinced that's a compelling use-case. |
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
Update ossl_ec_key_fromdata to compute the public key if it is not provided in the input parameters but the private key is. This allows for the creation of a complete EC_KEY object from only private key data. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from #29054)
Update ossl_ec_key_fromdata to compute the public key if it is not provided in the input parameters but the private key is. This allows for the creation of a complete EC_KEY object from only private key data. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from openssl#29054)
The EC public key auto-derivation feature (deriving public key from private key during fromdata()) was merged to OpenSSL master on Dec 15, 2025 via PR #29054. This feature will be in OpenSSL 4.0.0, not 3.6.x as previously assumed. The original version check `> 0x30600000L` incorrectly triggered for OpenSSL 3.6.x which does not have this feature, causing test_ec_import to fail because wolfProvider was auto-deriving public keys while OpenSSL 3.6.x was not. Changes: - Update version check from `> 0x30600000L` to `>= 0x40000000L` - Update comments to reference the actual OpenSSL PR - Clean up test code structure See: openssl/openssl#29054 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The EC public key auto-derivation feature (deriving public key from private key during fromdata()) was merged to OpenSSL master on Dec 15, 2025 via PR #29054. This feature will be in OpenSSL 4.0.0, not 3.6.x as previously assumed. The original version check `> 0x30600000L` incorrectly triggered for OpenSSL 3.6.x which does not have this feature, causing test_ec_import to fail because wolfProvider was auto-deriving public keys while OpenSSL 3.6.x was not. Changes: - Update version check from `> 0x30600000L` to `>= 0x40000000L` - Update comments to reference the actual OpenSSL PR - Clean up test code structure See: openssl/openssl#29054 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Most of the key management implementations seem to generate public key material from private keys when the public key is not provided on import, however this is not available for classic EC keys.
This PR: latchset/kryoptic#357 tests (and depends on) this functionality for Edwards and Montgomery Curves as well as Mldsa, Mlkem and Slhdsa.
Checklist