Commit 286570b
committed
crypto: remove key export and metadata locks
Raw and JWK getters return independently owned bytes or BIGNUMs. RSA
metadata snapshots public parameters and PSS restrictions. EC fallback
paths reconstruct or duplicate the source key. EC PKCS8 export changes
encoding flags only on its own clone.
Early OpenSSL 3 key downgrading mutated shared provider fields. Current
OpenSSL publishes separate legacy and provider conversion caches under
internal read/write locks. Ordinary DER/PEM export, equality, signing,
and key derivation already access the same keys without these locks.
Remove export and metadata acquisitions, including their coverage of V8
allocation and encoding, and remove the now-unused shared mutex storage.
Retain shared immutable key ownership. The concurrent reuse test checks
that EC PKCS8 export leaves the original flags intact.
Refs: #36825
Refs: https://docs.openssl.org/3.5/man7/openssl-threads/
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex1 parent 3f46289 commit 286570b
4 files changed
Lines changed: 7 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | 482 | | |
484 | 483 | | |
485 | 484 | | |
| |||
624 | 623 | | |
625 | 624 | | |
626 | 625 | | |
627 | | - | |
628 | 626 | | |
629 | 627 | | |
630 | 628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
| |||
416 | 415 | | |
417 | 416 | | |
418 | 417 | | |
419 | | - | |
420 | 418 | | |
421 | 419 | | |
422 | 420 | | |
| |||
471 | 469 | | |
472 | 470 | | |
473 | 471 | | |
474 | | - | |
475 | 472 | | |
476 | 473 | | |
477 | 474 | | |
| |||
497 | 494 | | |
498 | 495 | | |
499 | 496 | | |
500 | | - | |
501 | 497 | | |
502 | 498 | | |
503 | 499 | | |
| |||
1056 | 1052 | | |
1057 | 1053 | | |
1058 | 1054 | | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
| 1055 | + | |
1062 | 1056 | | |
1063 | 1057 | | |
1064 | 1058 | | |
| |||
1075 | 1069 | | |
1076 | 1070 | | |
1077 | 1071 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | 1072 | | |
1084 | 1073 | | |
1085 | 1074 | | |
| |||
1474 | 1463 | | |
1475 | 1464 | | |
1476 | 1465 | | |
1477 | | - | |
1478 | 1466 | | |
1479 | 1467 | | |
1480 | 1468 | | |
| |||
1502 | 1490 | | |
1503 | 1491 | | |
1504 | 1492 | | |
1505 | | - | |
1506 | 1493 | | |
1507 | 1494 | | |
1508 | 1495 | | |
| |||
1530 | 1517 | | |
1531 | 1518 | | |
1532 | 1519 | | |
1533 | | - | |
1534 | 1520 | | |
1535 | 1521 | | |
1536 | 1522 | | |
| |||
1569 | 1555 | | |
1570 | 1556 | | |
1571 | 1557 | | |
1572 | | - | |
1573 | 1558 | | |
1574 | 1559 | | |
1575 | 1560 | | |
| |||
1592 | 1577 | | |
1593 | 1578 | | |
1594 | 1579 | | |
1595 | | - | |
1596 | 1580 | | |
1597 | 1581 | | |
1598 | 1582 | | |
| |||
1611 | 1595 | | |
1612 | 1596 | | |
1613 | 1597 | | |
1614 | | - | |
1615 | 1598 | | |
1616 | 1599 | | |
1617 | 1600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
100 | | - | |
| 98 | + | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
104 | | - | |
| 102 | + | |
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
| |||
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
118 | | - | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
| |||
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 131 | + | |
| 132 | + | |
138 | 133 | | |
139 | 134 | | |
140 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
| |||
526 | 525 | | |
527 | 526 | | |
528 | 527 | | |
529 | | - | |
530 | 528 | | |
531 | 529 | | |
532 | 530 | | |
| |||
0 commit comments