Move ciphersuite selection before session resumption in TLSv1.3
[openssl.git] / ssl / statem / extensions_srvr.c
index fe181abad0aa3fff7df35b80145ab9663ec0c3c3..39e6c07fe0ba49d65cc0197ebdb48696be70af09 100644 (file)
@@ -726,11 +726,8 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
             continue;
 
         md = ssl_md(sess->cipher->algorithm2);
-        if (md == NULL) {
-            /*
-             * Don't recognise this cipher so we can't use the session.
-             * Ignore it
-             */
+        if (md != ssl_md(s->s3->tmp.new_cipher->algorithm2)) {
+            /* The ciphersuite is not compatible with this session. */
             SSL_SESSION_free(sess);
             sess = NULL;
             continue;