Commit 08ce96d
committed
Remove empty-label lower-bound check in CRYPTO_tls13_hkdf_expand_label
The RFC 8446 Section 7.1 "opaque label<7..255>" lower bound on the HkdfLabel.label field does not match real caller behavior: SSL_export_keying_material permits a zero-length caller label, which the ssl/test/runner exerciser relies on for TLS 1.3 exporter interop tests. Neither the pre-refactor ssl/tls13_enc.cc hkdf_expand_label nor BoringSSL's CRYPTO_tls13_hkdf_expand_label enforce the lower bound, so rejecting label_len == 0 here regressed every TLS-TLS13-* and QUIC-TLS13-* runner test that uses exportKeyingMaterial.
The upper bound on out_len is already enforced implicitly by CBB_add_u16, so the explicit check is redundant. Drop the whole block and document what CBB enforces for us.1 parent aa53c55 commit 08ce96d
1 file changed
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | 153 | | |
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
173 | 166 | | |
174 | 167 | | |
175 | 168 | | |
| |||
0 commit comments