From: Matt Caswell Date: Wed, 8 Feb 2017 16:52:23 +0000 (+0000) Subject: Add a capability to s_server to send KeyUpdate messages X-Git-Tag: OpenSSL_1_1_1-pre1~2368 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=34df45b531c58f94c921992c5114c2d9475f73e9 Add a capability to s_server to send KeyUpdate messages Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2609) --- diff --git a/apps/s_server.c b/apps/s_server.c index e064290721..dba7b67709 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2320,6 +2320,20 @@ static int sv_body(int s, int stype, unsigned char *context) * cert\n"); */ } + if ((buf[0] == 'K' || buf[0] == 'k') + && ((buf[1] == '\n') || (buf[1] == '\r'))) { + SSL_key_update(con, buf[0] == 'K' ? + SSL_KEY_UPDATE_REQUESTED + : SSL_KEY_UPDATE_NOT_REQUESTED); + i = SSL_do_handshake(con); + printf("SSL_do_handshake -> %d\n", i); + i = 0; + continue; + /* + * strcpy(buf,"server side RE-NEGOTIATE asking for client + * cert\n"); + */ + } if (buf[0] == 'P') { static const char *str = "Lets print some clear text\n"; BIO_write(SSL_get_wbio(con), str, strlen(str));