Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions apps/s_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static int s_nbio_test = 0;
static int s_crlf = 0;
static SSL_CTX *ctx = NULL;
static SSL_CTX *ctx2 = NULL;
static X509 *s_cert2 = NULL;
static int www = 0;

static BIO *bio_s_out = NULL;
Expand Down Expand Up @@ -731,22 +732,8 @@ static int ssl_ech_servername_cb(SSL *s, int *ad, void *arg)
return SSL_TLSEXT_ERR_NOACK;
if (echrv == SSL_ECH_STATUS_SUCCESS && servername != NULL) {
if (ctx2 != NULL) {
int mrv;
X509_VERIFY_PARAM *vpm = NULL;

BIO_printf(p->biodebug,
"ssl_ech_servername_cb: TLS servername: %s.\n",
servername);
BIO_printf(p->biodebug,
"ssl_ech_servername_cb: Cert servername: %s.\n",
p->servername);
vpm = X509_VERIFY_PARAM_new();
if (vpm == NULL)
return SSL_TLSEXT_ERR_NOACK;
mrv = X509_VERIFY_PARAM_set1_host(vpm, servername,
strlen(servername));
X509_VERIFY_PARAM_free(vpm);
if (mrv == 1) {
int check_hostrv = X509_check_host(s_cert2, servername, 0, 0, NULL);
if (check_hostrv == 1) {
if (p->biodebug != NULL)
BIO_printf(p->biodebug,
"ssl_ech_servername_cb: Switching context.\n");
Expand All @@ -755,7 +742,7 @@ static int ssl_ech_servername_cb(SSL *s, int *ad, void *arg)
if (p->biodebug!=NULL)
BIO_printf(p->biodebug,
"ssl_ech_servername_cb: Not switching context "\
"- no name match (%d).\n",mrv);
"- no name match (%d).\n",check_hostrv);
}
}
} else {
Expand Down Expand Up @@ -1415,7 +1402,6 @@ int s_server_main(int argc, char *argv[])
unsigned char *context = NULL;
OPTION_CHOICE o;
EVP_PKEY *s_key2 = NULL;
X509 *s_cert2 = NULL;
#ifndef OPENSSL_NO_ECH
/* again the added field isn't really ECH specific */
tlsextctx tlsextcbp = { NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING, NULL };
Expand Down