Don't initialize enc_method before version negotiation.
Move it into ssl->s3 so it automatically behaves correctly on SSL_clear.
ssl->version is still a mess though.
Change-Id: I17a692a04a845886ec4f8de229fa6cf99fa7e24a
Reviewed-on: https://boringssl-review.googlesource.com/6844
Reviewed-by: Adam Langley <alangley@gmail.com>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index f6ed6f4..1723ba9 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -3757,10 +3757,6 @@
* TLS). */
const SSL_PROTOCOL_METHOD *method;
- /* enc_method is the method table corresponding to the current protocol
- * version. */
- const SSL3_ENC_METHOD *enc_method;
-
/* There are 2 BIO's even though they are normally both the same. This is so
* data can be read and written to different handlers */
@@ -4010,6 +4006,10 @@
/* aead_write_ctx is the current write cipher state. */
SSL_AEAD_CTX *aead_write_ctx;
+ /* enc_method is the method table corresponding to the current protocol
+ * version. */
+ const SSL3_ENC_METHOD *enc_method;
+
/* State pertaining to the pending handshake.
*
* TODO(davidben): State is current spread all over the place. Move