|
|
cf3dd1 |
diff -up openssl-1.1.1g/include/openssl/ssl3.h.reneg-no-extms openssl-1.1.1g/include/openssl/ssl3.h
|
|
|
cf3dd1 |
--- openssl-1.1.1g/include/openssl/ssl3.h.reneg-no-extms 2020-04-21 14:22:39.000000000 +0200
|
|
|
cf3dd1 |
+++ openssl-1.1.1g/include/openssl/ssl3.h 2020-06-05 15:20:22.090682776 +0200
|
|
|
cf3dd1 |
@@ -292,6 +292,9 @@ extern "C" {
|
|
|
cf3dd1 |
|
|
|
cf3dd1 |
# define TLS1_FLAGS_STATELESS 0x0800
|
|
|
cf3dd1 |
|
|
|
cf3dd1 |
+/* Set if extended master secret extension required on renegotiation */
|
|
|
cf3dd1 |
+# define TLS1_FLAGS_REQUIRED_EXTMS 0x1000
|
|
|
cf3dd1 |
+
|
|
|
cf3dd1 |
# define SSL3_MT_HELLO_REQUEST 0
|
|
|
cf3dd1 |
# define SSL3_MT_CLIENT_HELLO 1
|
|
|
cf3dd1 |
# define SSL3_MT_SERVER_HELLO 2
|
|
|
cf3dd1 |
diff -up openssl-1.1.1g/ssl/statem/extensions.c.reneg-no-extms openssl-1.1.1g/ssl/statem/extensions.c
|
|
|
cf3dd1 |
--- openssl-1.1.1g/ssl/statem/extensions.c.reneg-no-extms 2020-04-21 14:22:39.000000000 +0200
|
|
|
cf3dd1 |
+++ openssl-1.1.1g/ssl/statem/extensions.c 2020-06-05 15:22:19.677653437 +0200
|
|
|
cf3dd1 |
@@ -1168,14 +1168,26 @@ static int init_etm(SSL *s, unsigned int
|
|
|
cf3dd1 |
|
|
|
cf3dd1 |
static int init_ems(SSL *s, unsigned int context)
|
|
|
cf3dd1 |
{
|
|
|
cf3dd1 |
- if (!s->server)
|
|
|
cf3dd1 |
+ if (s->s3->flags & TLS1_FLAGS_RECEIVED_EXTMS) {
|
|
|
cf3dd1 |
s->s3->flags &= ~TLS1_FLAGS_RECEIVED_EXTMS;
|
|
|
cf3dd1 |
+ s->s3->flags |= TLS1_FLAGS_REQUIRED_EXTMS;
|
|
|
cf3dd1 |
+ }
|
|
|
cf3dd1 |
|
|
|
cf3dd1 |
return 1;
|
|
|
cf3dd1 |
}
|
|
|
cf3dd1 |
|
|
|
cf3dd1 |
static int final_ems(SSL *s, unsigned int context, int sent)
|
|
|
cf3dd1 |
{
|
|
|
cf3dd1 |
+ /*
|
|
|
cf3dd1 |
+ * Check extended master secret extension is not dropped on
|
|
|
cf3dd1 |
+ * renegotiation.
|
|
|
cf3dd1 |
+ */
|
|
|
cf3dd1 |
+ if (!(s->s3->flags & TLS1_FLAGS_RECEIVED_EXTMS)
|
|
|
cf3dd1 |
+ && (s->s3->flags & TLS1_FLAGS_REQUIRED_EXTMS)) {
|
|
|
cf3dd1 |
+ SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_F_FINAL_EMS,
|
|
|
cf3dd1 |
+ SSL_R_INCONSISTENT_EXTMS);
|
|
|
cf3dd1 |
+ return 0;
|
|
|
cf3dd1 |
+ }
|
|
|
cf3dd1 |
if (!s->server && s->hit) {
|
|
|
cf3dd1 |
/*
|
|
|
cf3dd1 |
* Check extended master secret extension is consistent with
|