Commit b159a2a
committed
Fix SKID buffer overflow in CSR path and add missing NULL checks
Fix heap buffer overflow write in ReqCertFromX509() when subjKeyIdSz
exceeds CTC_MAX_SKID_SIZE. The existing CertFromX509() path already
had this bound check but the CSR path did not, so
wolfSSL_X509_set_subject_key_id() with a long SKID followed by
X509_REQ_sign() could overflow cert->skid.
Also fix NULL dereference in wc_SRTP_KDF / wc_SRTCP_KDF when idx is
NULL but kdrIdx >= 0. The idx pointer is dereferenced unconditionally
in wc_srtp_kdf_first_block() but was not validated at the entry points.
Additional minor hardening in wolfSSL_X509_get_der() and
wolfSSL_i2d_X509() to guard against derCert->length truncation when
cast to int and to reject zero/negative derSz before use.1 parent c36beba commit b159a2a
2 files changed
+17
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4404 | 4404 | | |
4405 | 4405 | | |
4406 | 4406 | | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
4407 | 4411 | | |
4408 | 4412 | | |
4409 | 4413 | | |
| |||
8674 | 8678 | | |
8675 | 8679 | | |
8676 | 8680 | | |
8677 | | - | |
| 8681 | + | |
8678 | 8682 | | |
8679 | 8683 | | |
8680 | 8684 | | |
| |||
11711 | 11715 | | |
11712 | 11716 | | |
11713 | 11717 | | |
11714 | | - | |
| 11718 | + | |
| 11719 | + | |
11715 | 11720 | | |
11716 | 11721 | | |
11717 | 11722 | | |
| 11723 | + | |
| 11724 | + | |
| 11725 | + | |
| 11726 | + | |
11718 | 11727 | | |
11719 | 11728 | | |
11720 | 11729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
| 1012 | + | |
| 1013 | + | |
1013 | 1014 | | |
1014 | 1015 | | |
1015 | 1016 | | |
| |||
1103 | 1104 | | |
1104 | 1105 | | |
1105 | 1106 | | |
1106 | | - | |
| 1107 | + | |
| 1108 | + | |
1107 | 1109 | | |
1108 | 1110 | | |
1109 | 1111 | | |
| |||
1194 | 1196 | | |
1195 | 1197 | | |
1196 | 1198 | | |
1197 | | - | |
| 1199 | + | |
1198 | 1200 | | |
1199 | 1201 | | |
1200 | 1202 | | |
| |||
1267 | 1269 | | |
1268 | 1270 | | |
1269 | 1271 | | |
1270 | | - | |
| 1272 | + | |
1271 | 1273 | | |
1272 | 1274 | | |
1273 | 1275 | | |
| |||
0 commit comments