diff options
author | Emilia Kasper <emilia@openssl.org> | 2016-08-12 14:29:24 +0200 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2016-08-18 12:49:32 +0200 |
commit | dd8e5a573272d369cb6dd21592e2b1b1d3941939 (patch) | |
tree | d41b73d43ba6469317fcd680b3cb42ca0b74b0c4 /test/handshake_helper.c | |
parent | 6dc9974547427261db25758612b6a570083d52e6 (diff) |
Test that the peers send at most one fatal alert
Duplicate alerts have happened, see
70c22888c1648fe8652e77107f3c74bf2212de36
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/handshake_helper.c')
-rw-r--r-- | test/handshake_helper.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/handshake_helper.c b/test/handshake_helper.c index 6b5f834f86..409f16cf08 100644 --- a/test/handshake_helper.c +++ b/test/handshake_helper.c @@ -41,6 +41,7 @@ void HANDSHAKE_RESULT_free(HANDSHAKE_RESULT *result) */ typedef struct handshake_ex_data_st { int alert_sent; + int num_fatal_alerts_sent; int alert_received; int session_ticket_do_not_call; ssl_servername_t servername; @@ -71,6 +72,9 @@ static void info_cb(const SSL *s, int where, int ret) (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (where & SSL_CB_WRITE) { ex_data->alert_sent = ret; + if (strcmp(SSL_alert_type_string(ret), "F") == 0 + || strcmp(SSL_alert_desc_string(ret), "CN") == 0) + ex_data->num_fatal_alerts_sent++; } else { ex_data->alert_received = ret; } @@ -840,8 +844,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( } err: ret->server_alert_sent = server_ex_data.alert_sent; + ret->server_num_fatal_alerts_sent = server_ex_data.num_fatal_alerts_sent; ret->server_alert_received = client_ex_data.alert_received; ret->client_alert_sent = client_ex_data.alert_sent; + ret->client_num_fatal_alerts_sent = client_ex_data.num_fatal_alerts_sent; ret->client_alert_received = server_ex_data.alert_received; ret->server_protocol = SSL_version(server.ssl); ret->client_protocol = SSL_version(client.ssl); |