Commit 23a4a9c
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 17e6859 commit 23a4a9c
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 | |
|---|---|---|---|
| |||
39569 | 39569 | | |
39570 | 39570 | | |
39571 | 39571 | | |
39572 | | - | |
39573 | | - | |
| 39572 | + | |
| 39573 | + | |
| 39574 | + | |
39574 | 39575 | | |
39575 | 39576 | | |
39576 | 39577 | | |
| |||
39609 | 39610 | | |
39610 | 39611 | | |
39611 | 39612 | | |
39612 | | - | |
39613 | | - | |
| 39613 | + | |
| 39614 | + | |
| 39615 | + | |
| 39616 | + | |
| 39617 | + | |
| 39618 | + | |
| 39619 | + | |
| 39620 | + | |
| 39621 | + | |
39614 | 39622 | | |
39615 | 39623 | | |
39616 | 39624 | | |
| |||
39623 | 39631 | | |
39624 | 39632 | | |
39625 | 39633 | | |
39626 | | - | |
39627 | | - | |
| 39634 | + | |
| 39635 | + | |
| 39636 | + | |
| 39637 | + | |
| 39638 | + | |
39628 | 39639 | | |
39629 | 39640 | | |
39630 | 39641 | | |
| |||
0 commit comments