diff options
author | Bodo Möller <bodo@openssl.org> | 2006-01-03 03:27:19 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2006-01-03 03:27:19 +0000 |
commit | f1fd4544a3747682010ed89ac908713fe90b8304 (patch) | |
tree | 065bf82040e2d29ce319117bec6952e59ede2fcb /apps/s_server.c | |
parent | 349eb12fd5ac3ce216a6d89084b8c6a63b9388b7 (diff) | |
download | openssl-f1fd4544a3747682010ed89ac908713fe90b8304.tar.gz |
Various changes in the new TLS extension code, including the following:
- fix indentation
- rename some functions and macros
- fix up confusion between SSL_ERROR_... and SSL_AD_... values
Diffstat (limited to 'apps/s_server.c')
-rw-r--r-- | apps/s_server.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 068e0c54b1..6c106f7f02 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -539,7 +539,7 @@ typedef struct tlsextctx_st { 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_TYPE_SERVER_host); + const char * servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); if (servername) BIO_printf(p->biodebug,"Hostname in TLS extension: \"%s\"\n",servername); @@ -1257,12 +1257,14 @@ bad: #endif #endif - if (cipher != NULL) { - if(!SSL_CTX_set_cipher_list(ctx,cipher)) { + if (cipher != NULL) + { + if(!SSL_CTX_set_cipher_list(ctx,cipher)) + { BIO_printf(bio_err,"error setting cipher list\n"); ERR_print_errors(bio_err); goto end; - } + } #ifndef OPENSSL_NO_TLSEXT if (ctx2 && !SSL_CTX_set_cipher_list(ctx2,cipher)) { @@ -1271,7 +1273,7 @@ bad: goto end; } #endif - } + } SSL_CTX_set_verify(ctx,s_server_verify,verify_callback); SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context, sizeof s_server_session_id_context); @@ -1283,13 +1285,14 @@ bad: SSL_CTX_set_session_id_context(ctx2,(void*)&s_server_session_id_context, sizeof s_server_session_id_context); + tlsextcbp.biodebug = bio_s_out; + SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_servername_cb); + SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp); + SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb); + SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp); } - tlsextcbp.biodebug = bio_s_out; - SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_servername_cb); - SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp); - SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb); - SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp); #endif + if (CAfile != NULL) { SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile)); |