Blame SOURCES/openssl-1.0.2k-cve-2019-1559.patch

3eeb22
diff -up openssl-1.0.2k/ssl/d1_pkt.c.padding-oracle openssl-1.0.2k/ssl/d1_pkt.c
3eeb22
--- openssl-1.0.2k/ssl/d1_pkt.c.padding-oracle	2017-01-26 14:22:04.000000000 +0100
3eeb22
+++ openssl-1.0.2k/ssl/d1_pkt.c	2019-04-05 10:39:08.574409987 +0200
3eeb22
@@ -1290,6 +1290,7 @@ int dtls1_read_bytes(SSL *s, int type, u
3eeb22
             ERR_add_error_data(2, "SSL alert number ", tmp);
3eeb22
             s->shutdown |= SSL_RECEIVED_SHUTDOWN;
3eeb22
             SSL_CTX_remove_session(s->session_ctx, s->session);
3eeb22
+            s->state = SSL_ST_ERR;
3eeb22
             return (0);
3eeb22
         } else {
3eeb22
             al = SSL_AD_ILLEGAL_PARAMETER;
3eeb22
diff -up openssl-1.0.2k/ssl/s3_pkt.c.padding-oracle openssl-1.0.2k/ssl/s3_pkt.c
3eeb22
--- openssl-1.0.2k/ssl/s3_pkt.c.padding-oracle	2017-01-26 14:22:04.000000000 +0100
3eeb22
+++ openssl-1.0.2k/ssl/s3_pkt.c	2019-04-05 10:40:35.838894197 +0200
3eeb22
@@ -1495,6 +1495,7 @@ int ssl3_read_bytes(SSL *s, int type, un
3eeb22
             ERR_add_error_data(2, "SSL alert number ", tmp);
3eeb22
             s->shutdown |= SSL_RECEIVED_SHUTDOWN;
3eeb22
             SSL_CTX_remove_session(s->session_ctx, s->session);
3eeb22
+            s->state = SSL_ST_ERR;
3eeb22
             return (0);
3eeb22
         } else {
3eeb22
             al = SSL_AD_ILLEGAL_PARAMETER;
3eeb22
@@ -1714,9 +1715,12 @@ int ssl3_send_alert(SSL *s, int level, i
3eeb22
                                           * protocol_version alerts */
3eeb22
     if (desc < 0)
3eeb22
         return -1;
3eeb22
-    /* If a fatal one, remove from cache */
3eeb22
-    if ((level == 2) && (s->session != NULL))
3eeb22
-        SSL_CTX_remove_session(s->session_ctx, s->session);
3eeb22
+    /* If a fatal one, remove from cache and go into the error state */
3eeb22
+    if (level == SSL3_AL_FATAL) {
3eeb22
+        if (s->session != NULL)
3eeb22
+            SSL_CTX_remove_session(s->session_ctx, s->session);
3eeb22
+        s->state = SSL_ST_ERR;
3eeb22
+    }
3eeb22
 
3eeb22
     s->s3->alert_dispatch = 1;
3eeb22
     s->s3->send_alert[0] = level;