Commit cec4a94
committed
Add debug instrumentation and hoist migration logic to run before object loading
- Add DEBUG_WOLFPKCS11 prints at wp11_Token_Load entry and after storage open
- Add debug print before migration block showing ret and key fields
- Add debug print in NOT_AVAILABLE_E path
- Add debug print after object loading showing final ret value
- CRITICAL FIX: Hoist migration logic to run BEFORE object loading loop
so it works even if object loading fails due to corruption
- Migration now runs right after storage close and before object load
- This ensures state and tokenFlags are set correctly even when
corrupted objects cause wp11_Object_Load to fail
The previous implementation only ran migration inside 'if (ret == 0)'
after object loading, which meant it never ran when object loading
failed. This caused token fields to remain zero, leading to
CKR_USER_PIN_NOT_INITIALIZED errors at C_Login time.1 parent da7dbee commit cec4a94
1 file changed
+30
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5194 | 5194 | | |
5195 | 5195 | | |
5196 | 5196 | | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
5197 | 5201 | | |
5198 | 5202 | | |
5199 | 5203 | | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
5200 | 5209 | | |
5201 | 5210 | | |
5202 | 5211 | | |
| |||
5304 | 5313 | | |
5305 | 5314 | | |
5306 | 5315 | | |
5307 | | - | |
5308 | | - | |
5309 | | - | |
5310 | | - | |
5311 | | - | |
5312 | | - | |
5313 | | - | |
| 5316 | + | |
| 5317 | + | |
| 5318 | + | |
5314 | 5319 | | |
5315 | 5320 | | |
5316 | 5321 | | |
| |||
5322 | 5327 | | |
5323 | 5328 | | |
5324 | 5329 | | |
5325 | | - | |
5326 | | - | |
5327 | | - | |
| 5330 | + | |
| 5331 | + | |
5328 | 5332 | | |
5329 | 5333 | | |
5330 | 5334 | | |
| |||
5369 | 5373 | | |
5370 | 5374 | | |
5371 | 5375 | | |
5372 | | - | |
| 5376 | + | |
5373 | 5377 | | |
5374 | 5378 | | |
5375 | 5379 | | |
| |||
5395 | 5399 | | |
5396 | 5400 | | |
5397 | 5401 | | |
| 5402 | + | |
| 5403 | + | |
| 5404 | + | |
| 5405 | + | |
| 5406 | + | |
| 5407 | + | |
| 5408 | + | |
| 5409 | + | |
| 5410 | + | |
| 5411 | + | |
| 5412 | + | |
| 5413 | + | |
5398 | 5414 | | |
5399 | 5415 | | |
5400 | 5416 | | |
| |||
5412 | 5428 | | |
5413 | 5429 | | |
5414 | 5430 | | |
| 5431 | + | |
| 5432 | + | |
| 5433 | + | |
5415 | 5434 | | |
5416 | 5435 | | |
5417 | 5436 | | |
| |||
0 commit comments