Commit 4e37d99
committed
Fix OCSP key-based responder ID lookup when SM2/SM3 is enabled.
When WOLFSSL_SM2 and WOLFSSL_SM3 are both defined, KEYID_SIZE becomes 32
(WC_SM3_DIGEST_SIZE) but OCSP_RESPONDER_ID_KEY_SZ remains 20 (SHA-1 per
RFC 6960). The guard (int)KEYID_SIZE == OCSP_RESPONDER_ID_KEY_SZ in
OcspFindSigner() and OcspRespIdMatch() evaluated to false (32 != 20),
completely disabling key-based OCSP responder ID matching. This caused
OCSP stapling to fail with BAD_CERTIFICATE_STATUS_ERROR (-406) against
any server using a key-based responder ID (e.g. login.live.com).
Fix by comparing only OCSP_RESPONDER_ID_KEY_SZ bytes for the responder
ID match, and zero-padding the 20-byte key hash to KEYID_SIZE before
passing to CA lookup functions that compare the full KEYID_SIZE.1 parent 7305192 commit 4e37d99
2 files changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
953 | | - | |
| 953 | + | |
| 954 | + | |
954 | 955 | | |
955 | 956 | | |
956 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39573 | 39573 | | |
39574 | 39574 | | |
39575 | 39575 | | |
39576 | | - | |
39577 | | - | |
| 39576 | + | |
| 39577 | + | |
| 39578 | + | |
39578 | 39579 | | |
39579 | 39580 | | |
39580 | 39581 | | |
| |||
39613 | 39614 | | |
39614 | 39615 | | |
39615 | 39616 | | |
39616 | | - | |
39617 | | - | |
| 39617 | + | |
| 39618 | + | |
| 39619 | + | |
| 39620 | + | |
| 39621 | + | |
| 39622 | + | |
| 39623 | + | |
| 39624 | + | |
| 39625 | + | |
39618 | 39626 | | |
39619 | 39627 | | |
39620 | 39628 | | |
| |||
39627 | 39635 | | |
39628 | 39636 | | |
39629 | 39637 | | |
39630 | | - | |
39631 | | - | |
| 39638 | + | |
| 39639 | + | |
| 39640 | + | |
| 39641 | + | |
| 39642 | + | |
39632 | 39643 | | |
39633 | 39644 | | |
39634 | 39645 | | |
| |||
0 commit comments