]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - test/ssl_old_test.c
ssl_old_test.c: Check inconsistent values from SSL_get0_alpn_selected()
[thirdparty/openssl.git] / test / ssl_old_test.c
index 439d0ed8d02c74bd9906f54dcd3b153c79a94f8c..8218ab1a908776efe2150d5d81fe9f3bb5113658 100644 (file)
@@ -332,6 +332,18 @@ static int verify_alpn(SSL *client, SSL *server)
     OPENSSL_free(alpn_selected);
     alpn_selected = NULL;
 
+    if (client_proto == NULL && client_proto_len != 0) {
+        BIO_printf(bio_stdout,
+                   "Inconsistent SSL_get0_alpn_selected() for client!\n");
+        goto err;
+    }
+
+    if (server_proto == NULL && server_proto_len != 0) {
+        BIO_printf(bio_stdout,
+                   "Inconsistent SSL_get0_alpn_selected() for server!\n");
+        goto err;
+    }
+
     if (client_proto_len != server_proto_len) {
         BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
         goto err;