Minor simplification to the padding extension logic.
With the fastradio stuff gone, the padding computation is slightly more
straight-forward.
Change-Id: I67ede92fdf5f34c265c7a44e4cdc1a5ce5416df2
Reviewed-on: https://boringssl-review.googlesource.com/5482
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 86cc74e..bc3e556 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -2275,7 +2275,6 @@
}
if (header_len > 0) {
- size_t clienthello_minsize = 0;
header_len += CBB_len(&extensions);
if (header_len > 0xff && header_len < 0x200) {
/* Add padding to workaround bugs in F5 terminators. See
@@ -2283,10 +2282,7 @@
*
* NB: because this code works out the length of all existing extensions
* it MUST always appear last. */
- clienthello_minsize = 0x200;
- }
- if (header_len < clienthello_minsize) {
- size_t padding_len = clienthello_minsize - header_len;
+ size_t padding_len = 0x200 - header_len;
/* Extensions take at least four bytes to encode. Always include least
* one byte of data if including the extension. WebSphere Application
* Server 7.0 is intolerant to the last extension being zero-length. */