Skip to content

Commit

Permalink
Add the ability for s_client to send a KeyUpdate message
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2609)
  • Loading branch information
mattcaswell committed Feb 17, 2017
1 parent 53d1d07 commit b07b2a1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,8 @@ int s_client_main(int argc, char **argv)
else
timeoutp = NULL;

if (SSL_in_init(con) && !SSL_total_renegotiations(con)) {
if (SSL_in_init(con) && !SSL_total_renegotiations(con)
&& SSL_get_key_update_type(con) == SSL_KEY_UPDATE_NONE) {
in_init = 1;
tty_on = 0;
} else {
Expand Down Expand Up @@ -2606,6 +2607,15 @@ int s_client_main(int argc, char **argv)
SSL_renegotiate(con);
cbuf_len = 0;
}

if ((!c_ign_eof) && ((cbuf[0] == 'K' || cbuf[0] == 'k' )
&& cmdletters)) {
BIO_printf(bio_err, "KEYUPDATE\n");
SSL_key_update(con,
cbuf[0] == 'K' ? SSL_KEY_UPDATE_REQUESTED
: SSL_KEY_UPDATE_NOT_REQUESTED);
cbuf_len = 0;
}
#ifndef OPENSSL_NO_HEARTBEATS
else if ((!c_ign_eof) && (cbuf[0] == 'B' && cmdletters)) {
BIO_printf(bio_err, "HEARTBEATING\n");
Expand Down

0 comments on commit b07b2a1

Please sign in to comment.