Commit c7d5eba
committed
tls: fix TLSX_PreSharedKey_GetSize word16 overflow (F-2925)
Both TLSX_PreSharedKey_GetSize and TLSX_PreSharedKey_GetSizeBinders
accumulate per-identity bytes into a word16. With enough PSK entries
(or large binderLen/identityLen values) the accumulator wraps silently
and the caller allocates an undersized extension buffer, which
TLSX_PreSharedKey_Write then overflows.
Switch both accumulators to word32 and return LENGTH_ERROR when the
total would exceed the 16-bit wire length field.1 parent 65d0880 commit c7d5eba
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11911 | 11911 | | |
11912 | 11912 | | |
11913 | 11913 | | |
11914 | | - | |
| 11914 | + | |
11915 | 11915 | | |
11916 | 11916 | | |
11917 | 11917 | | |
11918 | | - | |
| 11918 | + | |
| 11919 | + | |
| 11920 | + | |
| 11921 | + | |
| 11922 | + | |
11919 | 11923 | | |
11920 | 11924 | | |
11921 | | - | |
| 11925 | + | |
11922 | 11926 | | |
11923 | 11927 | | |
11924 | 11928 | | |
| |||
11941 | 11945 | | |
11942 | 11946 | | |
11943 | 11947 | | |
11944 | | - | |
| 11948 | + | |
11945 | 11949 | | |
11946 | 11950 | | |
11947 | 11951 | | |
| |||
11951 | 11955 | | |
11952 | 11956 | | |
11953 | 11957 | | |
11954 | | - | |
| 11958 | + | |
| 11959 | + | |
| 11960 | + | |
| 11961 | + | |
| 11962 | + | |
11955 | 11963 | | |
11956 | 11964 | | |
11957 | 11965 | | |
11958 | | - | |
| 11966 | + | |
11959 | 11967 | | |
11960 | 11968 | | |
11961 | 11969 | | |
| |||
0 commit comments