Repository navigation
Commit 554dd55
crypto: isolate provider EC PKCS8 encoding
OpenSSL's provider ec_pki_priv_to_der() temporarily changes EC_KEY
encoding flags on the input key. Concurrent PKCS8 exports can emit
inconsistent DER or affect a concurrent SEC1 export. The old Node key
mutex never covered this path.
Encode provider EC and SM2 keys through EVP_PKEY_dup(), preserving
encoding flags, point conversion form, parameters, and provider.
Legacy OpenSSL and BoringSSL already encode using local flags.
Restore concurrent KeyObject PKCS8 DER assertions and cover PEM and
SEC1 exports, including ECPrivateKey inputs without a public point.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: #66413
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 9267ac8 commit 554dd55
2 files changed
Lines changed: 29 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4401 | 4401 | | |
4402 | 4402 | | |
4403 | 4403 | | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
4404 | 4419 | | |
4405 | 4420 | | |
4406 | 4421 | | |
4407 | 4422 | | |
4408 | | - | |
| 4423 | + | |
4409 | 4424 | | |
4410 | 4425 | | |
4411 | 4426 | | |
| |||
4415 | 4430 | | |
4416 | 4431 | | |
4417 | 4432 | | |
4418 | | - | |
| 4433 | + | |
4419 | 4434 | | |
4420 | 4435 | | |
4421 | 4436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
| 199 | + | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
| |||
0 commit comments