Tobias Frauenschläger
e32e926f4e
evp: fix EVP_PKEY2PKCS8 returning NULL for private-key-only EC keys
...
When an EC_KEY is created via EC_KEY_new + EC_KEY_set_group +
EC_KEY_set_private_key (no public point set), SetECKeyInternal
incorrectly marks the internal ecc_key as ECC_PRIVATEKEY (instead of
ECC_PRIVATEKEY_ONLY) because pub_key is always non-NULL — EC_KEY_new
always allocates it as an empty, zero-initialised EC_POINT.
ECC_populate_EVP_PKEY only calls wc_ecc_make_pub for ECC_PRIVATEKEY_ONLY
keys, so the zero public-key point was serialised into the DER stored in
pkey->pkey.ptr. After commit 929dd9913 made wc_ecc_import_x963_ex always
pass untrusted=1, the re-decode inside wolfSSL_EVP_PKEY2PKCS8 →
wolfSSL_d2i_PrivateKey_EVP correctly rejected that zero point with an
on-curve failure, causing EVP_PKEY2PKCS8 to return NULL.
Fix: in ECC_populate_EVP_PKEY, also call wc_ecc_make_pub when the key
type is ECC_PRIVATEKEY but pubkey.x is zero (meaning the public key was
never actually populated). This reconstructs the public key from the
private scalar so that the encoded DER contains a valid on-curve point.
2026-04-06 21:18:32 +02:00
..
2026-04-02 22:52:48 -05:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-09 19:06:34 +10:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-20 11:56:25 +10:00
2026-03-20 11:56:25 +10:00
2026-03-26 16:11:19 -06:00
2026-02-18 09:52:21 -07:00
2026-04-02 11:55:41 +02:00
2026-02-18 09:52:21 -07:00
2026-04-01 15:28:35 -05:00
2024-11-05 00:19:07 -06:00
2026-04-02 22:54:10 -05:00
2026-02-27 14:35:03 -08:00
2026-04-02 11:55:41 +02:00
2026-04-02 11:55:41 +02:00
2026-02-18 09:52:21 -07:00
2026-03-27 12:09:53 -06:00
2026-03-09 19:06:34 +10:00
2026-02-18 09:52:21 -07:00
2026-04-01 14:12:02 -05:00
2026-02-24 13:59:12 -06:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-16 17:09:13 -07:00
2026-03-16 17:09:13 -07:00
2026-04-01 14:12:02 -05:00
2026-03-16 17:09:13 -07:00
2026-03-26 15:41:47 -05:00
2026-04-02 00:15:12 -05:00
2026-03-06 07:33:52 -06:00
2026-04-06 21:18:32 +02:00
2026-03-16 15:15:11 -07:00
2026-03-26 14:56:00 -04:00
2026-03-26 14:56:00 -04:00
2026-02-27 23:40:37 -06:00
2026-03-09 10:58:36 -05:00
2026-04-06 21:18:32 +02:00
2026-03-30 15:02:13 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-20 11:56:25 +10:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-04-01 14:12:02 -05:00
2026-03-23 14:04:06 -05:00
2026-03-16 17:09:13 -07:00
2026-03-24 08:47:01 -07:00
2026-03-23 15:27:47 -07:00
2026-04-01 16:32:15 -05:00
2026-02-18 09:52:21 -07:00
2026-03-22 13:22:27 -05:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-16 17:09:13 -07:00
2026-03-11 10:21:16 +01:00
2026-04-01 14:12:02 -05:00
2026-04-02 00:25:13 -05:00
2026-04-02 22:54:10 -05:00
2026-03-09 19:06:34 +10:00
2026-02-18 09:52:21 -07:00
2026-03-24 10:49:58 +10:00
2026-03-24 12:07:04 -05:00
2026-03-16 17:09:13 -07:00
2026-02-18 09:52:21 -07:00
2026-03-05 10:52:20 -07:00
2026-03-17 17:45:09 -05:00
2026-04-01 14:12:02 -05:00
2026-02-24 18:51:58 -08:00
2026-03-09 19:06:34 +10:00
2026-03-16 17:09:13 -07:00
2026-02-18 09:52:21 -07:00
2026-03-05 15:22:10 -06:00
2026-03-20 11:56:25 +10:00
2026-03-16 17:09:13 -07:00
2026-04-01 14:12:02 -05:00
2026-04-01 15:28:35 -05:00
2026-04-01 14:12:02 -05:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-02 15:06:35 +02:00
2026-04-01 14:12:02 -05:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-20 11:56:25 +10:00
2026-03-20 11:56:25 +10:00
2026-04-02 15:06:35 +02:00
2026-02-18 09:52:21 -07:00
2026-04-01 14:12:02 -05:00
2026-04-01 15:28:35 -05:00
2026-02-18 09:52:21 -07:00
2026-04-01 14:12:02 -05:00
2026-03-11 16:58:48 -04:00
2026-03-27 08:49:43 -04:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-20 14:53:05 -05:00
2026-03-26 14:56:00 -04:00
2026-03-12 15:18:56 -06:00
2026-04-01 14:12:02 -05:00
2026-03-31 09:43:58 -07:00
2026-03-16 21:24:08 +10:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-03-24 10:49:58 +10:00