Move extensions bitmasks into SSL_HANDSHAKE.
Change-Id: I3ab30a44b7f90ef1159e022cd17b7f50ffe27a93
Reviewed-on: https://boringssl-review.googlesource.com/11522
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/custom_extensions.c b/ssl/custom_extensions.c
index ed802ee..780cdc6 100644
--- a/ssl/custom_extensions.c
+++ b/ssl/custom_extensions.c
@@ -72,7 +72,7 @@
const SSL_CUSTOM_EXTENSION *ext = sk_SSL_CUSTOM_EXTENSION_value(stack, i);
if (ssl->server &&
- !(ssl->s3->tmp.custom_extensions.received & (1u << i))) {
+ !(ssl->s3->hs->custom_extensions.received & (1u << i))) {
/* Servers cannot echo extensions that the client didn't send. */
continue;
}
@@ -102,8 +102,8 @@
}
if (!ssl->server) {
- assert((ssl->s3->tmp.custom_extensions.sent & (1u << i)) == 0);
- ssl->s3->tmp.custom_extensions.sent |= (1u << i);
+ assert((ssl->s3->hs->custom_extensions.sent & (1u << i)) == 0);
+ ssl->s3->hs->custom_extensions.sent |= (1u << i);
}
break;
@@ -134,7 +134,7 @@
if (/* Unknown extensions are not allowed in a ServerHello. */
ext == NULL ||
/* Also, if we didn't send the extension, that's also unacceptable. */
- !(ssl->s3->tmp.custom_extensions.sent & (1u << index))) {
+ !(ssl->s3->hs->custom_extensions.sent & (1u << index))) {
OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION);
ERR_add_error_dataf("extension: %u", (unsigned)value);
*out_alert = SSL_AD_UNSUPPORTED_EXTENSION;
@@ -162,8 +162,8 @@
return 1;
}
- assert((ssl->s3->tmp.custom_extensions.received & (1u << index)) == 0);
- ssl->s3->tmp.custom_extensions.received |= (1u << index);
+ assert((ssl->s3->hs->custom_extensions.received & (1u << index)) == 0);
+ ssl->s3->hs->custom_extensions.received |= (1u << index);
if (ext->parse_callback &&
!ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
@@ -184,7 +184,7 @@
* can be set on an |SSL_CTX|. It's determined by the size of the bitset used
* to track when an extension has been sent. */
#define MAX_NUM_CUSTOM_EXTENSIONS \
- (sizeof(((struct ssl3_state_st *)NULL)->tmp.custom_extensions.sent) * 8)
+ (sizeof(((SSL_HANDSHAKE *)NULL)->custom_extensions.sent) * 8)
static int custom_ext_append(STACK_OF(SSL_CUSTOM_EXTENSION) **stack,
unsigned extension_value,