diff options
author | Bodo Möller <bodo@openssl.org> | 2006-01-06 09:08:59 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2006-01-06 09:08:59 +0000 |
commit | 1aeb3da83f267bc5e7cb9e7bd72dc0e07a751ba3 (patch) | |
tree | 439399808bd9feddefd89a6524b0547b79f8031a /apps | |
parent | e8e5b46e2b92b234791b8be3331cdc0f187d4bbe (diff) |
Fixes for TLS server_name extension
Submitted by: Peter Sylvester
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_client.c | 2 | ||||
-rw-r--r-- | apps/s_server.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/apps/s_client.c b/apps/s_client.c index c791667741..96cf511403 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -245,7 +245,7 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg) else BIO_printf(bio_err,"Can't use SSL_get_servername\n"); - return SSL_ERROR_NONE; + return 1; } #endif diff --git a/apps/s_server.c b/apps/s_server.c index 6c106f7f02..24a25d8156 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -540,24 +540,24 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg) { tlsextctx * p = (tlsextctx *) arg; const char * servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); - if (servername) + if (servername && p->biodebug) BIO_printf(p->biodebug,"Hostname in TLS extension: \"%s\"\n",servername); if (!p->servername) { SSL_set_tlsext_servername_done(s,2); - return SSL_ERROR_NONE; + return 1; } if (servername) { if (strcmp(servername,p->servername)) - return TLS1_AD_UNRECOGNIZED_NAME; + return 0; if (ctx2) SSL_set_SSL_CTX(s,ctx2); SSL_set_tlsext_servername_done(s,1); } - return SSL_ERROR_NONE; + return 1; } #endif @@ -845,7 +845,6 @@ int MAIN(int argc, char *argv[]) { if (--argc < 1) goto bad; tlsextcbp.servername= *(++argv); - /* meth=TLSv1_server_method(); */ } else if (strcmp(*argv,"-cert2") == 0) { |