Commit c0e99f7
ae.net.ssl.schannel: Clean up failed credential setup
Allow the identity-import validation probe to acquire accessible CNG-backed
certificate keys with CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG. This is an
acquisition flag only; server PFX imports retain their machine-keyset scope
without adding a CNG-preference import flag.
When key validation fails after selecting an imported certificate with a
private key, delete its provider-specific persisted container before freeing
the certificate context. This preserves the existing persist-then-delete
lifecycle even when setup fails before ownership transfers to certContext.
Synchronous adapter initialization now releases acquired SSPI credential and
context handles if it throws while still allowing the exception to escape
createAdapter. Release SChannel output buffers with scope-exit cleanup so an
exception from next.send cannot leak a handshake or close-notify buffer.
The Linux ae_unittest suite passed. The full Windows SChannel suite passed
through a key-authenticated SSH logon, including the PFX echo and curl tests.
A disposable forced-CNG run also asserted CERT_NCRYPT_KEY_SPEC and passed
all SChannel tests.1 parent 7477a82 commit c0e99f7
1 file changed
Lines changed: 23 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
333 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
337 | 343 | | |
338 | 344 | | |
339 | | - | |
| 345 | + | |
| 346 | + | |
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
| |||
538 | 545 | | |
539 | 546 | | |
540 | 547 | | |
| 548 | + | |
| 549 | + | |
541 | 550 | | |
| 551 | + | |
542 | 552 | | |
543 | 553 | | |
544 | 554 | | |
| |||
1062 | 1072 | | |
1063 | 1073 | | |
1064 | 1074 | | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1065 | 1078 | | |
1066 | | - | |
1067 | 1079 | | |
1068 | | - | |
1069 | | - | |
1070 | 1080 | | |
1071 | 1081 | | |
1072 | 1082 | | |
| |||
1095 | 1105 | | |
1096 | 1106 | | |
1097 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1098 | 1116 | | |
1099 | | - | |
1100 | 1117 | | |
1101 | | - | |
1102 | 1118 | | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | 1119 | | |
1109 | 1120 | | |
1110 | 1121 | | |
| |||
0 commit comments