diff options
author | Matt Caswell <matt@openssl.org> | 2017-02-08 16:52:23 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-02-17 10:28:00 +0000 |
commit | 34df45b531c58f94c921992c5114c2d9475f73e9 (patch) | |
tree | db15ca4c18918a279bc33b1d1a8680d083346506 | |
parent | 44c04a2e063715abdf2db095827261456fada74a (diff) | |
download | openssl-34df45b531c58f94c921992c5114c2d9475f73e9.tar.gz |
Add a capability to s_server to send KeyUpdate messages
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2609)
-rw-r--r-- | apps/s_server.c | 14 |
1 files changed, 14 insertions, 0 deletions
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)); |