handshake_helper.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  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
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_HANDSHAKE_HELPER_H
  10. #define HEADER_HANDSHAKE_HELPER_H
  11. #include "ssl_test_ctx.h"
  12. typedef struct handshake_result {
  13. ssl_test_result_t result;
  14. /* These alerts are in the 2-byte format returned by the info_callback. */
  15. /* (Latest) alert sent by the client; 0 if no alert. */
  16. int client_alert_sent;
  17. /* Number of fatal or close_notify alerts sent. */
  18. int client_num_fatal_alerts_sent;
  19. /* (Latest) alert received by the server; 0 if no alert. */
  20. int client_alert_received;
  21. /* (Latest) alert sent by the server; 0 if no alert. */
  22. int server_alert_sent;
  23. /* Number of fatal or close_notify alerts sent. */
  24. int server_num_fatal_alerts_sent;
  25. /* (Latest) alert received by the client; 0 if no alert. */
  26. int server_alert_received;
  27. /* Negotiated protocol. On success, these should always match. */
  28. int server_protocol;
  29. int client_protocol;
  30. /* Server connection */
  31. ssl_servername_t servername;
  32. /* Session ticket status */
  33. ssl_session_ticket_t session_ticket;
  34. /* Was this called on the second context? */
  35. int session_ticket_do_not_call;
  36. char *client_npn_negotiated;
  37. char *server_npn_negotiated;
  38. char *client_alpn_negotiated;
  39. char *server_alpn_negotiated;
  40. /* Was the handshake resumed? */
  41. int client_resumed;
  42. int server_resumed;
  43. /* Temporary key type */
  44. int tmp_key_type;
  45. } HANDSHAKE_RESULT;
  46. HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void);
  47. void HANDSHAKE_RESULT_free(HANDSHAKE_RESULT *result);
  48. /* Do a handshake and report some information about the result. */
  49. HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
  50. SSL_CTX *client_ctx, SSL_CTX *resume_server_ctx,
  51. SSL_CTX *resume_client_ctx,
  52. const SSL_TEST_CTX *test_ctx);
  53. #endif /* HEADER_HANDSHAKE_HELPER_H */