]>
Commit | Line | Data |
---|---|---|
453dfd8d EK |
1 | /* |
2 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. | |
3 | * | |
440e5d80 RS |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
453dfd8d | 7 | * https://www.openssl.org/source/license.html |
453dfd8d EK |
8 | */ |
9 | ||
10 | #ifndef HEADER_HANDSHAKE_HELPER_H | |
11 | #define HEADER_HANDSHAKE_HELPER_H | |
12 | ||
13 | #include "ssl_test_ctx.h" | |
14 | ||
15 | typedef struct handshake_result { | |
16 | ssl_test_result_t result; | |
17 | /* These alerts are in the 2-byte format returned by the info_callback. */ | |
dd8e5a57 | 18 | /* (Latest) alert sent by the client; 0 if no alert. */ |
453dfd8d | 19 | int client_alert_sent; |
dd8e5a57 EK |
20 | /* Number of fatal or close_notify alerts sent. */ |
21 | int client_num_fatal_alerts_sent; | |
22 | /* (Latest) alert received by the server; 0 if no alert. */ | |
453dfd8d | 23 | int client_alert_received; |
dd8e5a57 | 24 | /* (Latest) alert sent by the server; 0 if no alert. */ |
453dfd8d | 25 | int server_alert_sent; |
dd8e5a57 EK |
26 | /* Number of fatal or close_notify alerts sent. */ |
27 | int server_num_fatal_alerts_sent; | |
28 | /* (Latest) alert received by the client; 0 if no alert. */ | |
453dfd8d EK |
29 | int server_alert_received; |
30 | /* Negotiated protocol. On success, these should always match. */ | |
31 | int server_protocol; | |
32 | int client_protocol; | |
5c753de6 | 33 | /* Server connection */ |
81fc33c9 | 34 | ssl_servername_t servername; |
5c753de6 | 35 | /* Session ticket status */ |
81fc33c9 | 36 | ssl_session_ticket_t session_ticket; |
b6611753 | 37 | int compression; |
5c753de6 TS |
38 | /* Was this called on the second context? */ |
39 | int session_ticket_do_not_call; | |
ce2cdac2 EK |
40 | char *client_npn_negotiated; |
41 | char *server_npn_negotiated; | |
42 | char *client_alpn_negotiated; | |
43 | char *server_alpn_negotiated; | |
590ed3d7 EK |
44 | /* Was the handshake resumed? */ |
45 | int client_resumed; | |
46 | int server_resumed; | |
b93ad05d DSH |
47 | /* Temporary key type */ |
48 | int tmp_key_type; | |
7f5f35af DSH |
49 | /* server certificate key type */ |
50 | int server_cert_type; | |
ee5b6a42 DSH |
51 | /* server signing hash */ |
52 | int server_sign_hash; | |
54b7f2a5 DSH |
53 | /* server signature type */ |
54 | int server_sign_type; | |
f15b50c4 DSH |
55 | /* server CA names */ |
56 | STACK_OF(X509_NAME) *server_ca_names; | |
7f5f35af DSH |
57 | /* client certificate key type */ |
58 | int client_cert_type; | |
ee5b6a42 DSH |
59 | /* client signing hash */ |
60 | int client_sign_hash; | |
54b7f2a5 DSH |
61 | /* client signature type */ |
62 | int client_sign_type; | |
2e21539b DSH |
63 | /* Client CA names */ |
64 | STACK_OF(X509_NAME) *client_ca_names; | |
a84e5c9a TS |
65 | /* Session id status */ |
66 | ssl_session_id_t session_id; | |
e1c7871d | 67 | char *cipher; |
453dfd8d EK |
68 | } HANDSHAKE_RESULT; |
69 | ||
ce2cdac2 EK |
70 | HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); |
71 | void HANDSHAKE_RESULT_free(HANDSHAKE_RESULT *result); | |
72 | ||
453dfd8d | 73 | /* Do a handshake and report some information about the result. */ |
ce2cdac2 | 74 | HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, |
590ed3d7 | 75 | SSL_CTX *client_ctx, SSL_CTX *resume_server_ctx, |
11279b13 | 76 | SSL_CTX *resume_client_ctx, |
590ed3d7 | 77 | const SSL_TEST_CTX *test_ctx); |
5c753de6 | 78 | |
453dfd8d | 79 | #endif /* HEADER_HANDSHAKE_HELPER_H */ |