Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
*pV = *pB++;
*pV |= *pB++ << 8;
*pV |= *pB++ << 16;
- *pV |= *pB++ << 24;
+ *pV |= (uint32_t)*pB++ << 24;
}
for (i = 1; i < N; i++, pV += 32 * r)
OPENSSL_free(alpn_selected);
alpn_selected = NULL;
- if (client_proto_len != server_proto_len ||
+ if (client_proto_len != server_proto_len) {
+ BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
+ goto err;
+ }
+
+ if (client_proto != NULL &&
memcmp(client_proto, server_proto, client_proto_len) != 0) {
BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
goto err;