src/event/quic/ngx_event_quic_openssl_compat.h - nginx source code

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Nginx, Inc.
  3. */


  4. #ifndef _NGX_EVENT_QUIC_OPENSSL_COMPAT_H_INCLUDED_
  5. #define _NGX_EVENT_QUIC_OPENSSL_COMPAT_H_INCLUDED_

  6. #if defined SSL_R_MISSING_QUIC_TRANSPORT_PARAMETERS_EXTENSION                 \
  7.     || defined LIBRESSL_VERSION_NUMBER
  8. #undef NGX_QUIC_OPENSSL_COMPAT
  9. #else


  10. #include <ngx_config.h>
  11. #include <ngx_core.h>


  12. typedef struct ngx_quic_compat_s  ngx_quic_compat_t;


  13. enum ssl_encryption_level_t {
  14.     ssl_encryption_initial = 0,
  15.     ssl_encryption_early_data,
  16.     ssl_encryption_handshake,
  17.     ssl_encryption_application
  18. };


  19. typedef struct ssl_quic_method_st {
  20.     int (*set_read_secret)(SSL *ssl, enum ssl_encryption_level_t level,
  21.                            const SSL_CIPHER *cipher,
  22.                            const uint8_t *rsecret, size_t secret_len);
  23.     int (*set_write_secret)(SSL *ssl, enum ssl_encryption_level_t level,
  24.                             const SSL_CIPHER *cipher,
  25.                             const uint8_t *wsecret, size_t secret_len);
  26.     int (*add_handshake_data)(SSL *ssl, enum ssl_encryption_level_t level,
  27.                               const uint8_t *data, size_t len);
  28.     int (*flush_flight)(SSL *ssl);
  29.     int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level,
  30.                       uint8_t alert);
  31. } SSL_QUIC_METHOD;


  32. ngx_int_t ngx_quic_compat_init(ngx_conf_t *cf, SSL_CTX *ctx);

  33. int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method);
  34. int SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level,
  35.     const uint8_t *data, size_t len);
  36. int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params,
  37.     size_t params_len);
  38. void SSL_get_peer_quic_transport_params(const SSL *ssl,
  39.     const uint8_t **out_params, size_t *out_params_len);


  40. #endif /* TLSEXT_TYPE_quic_transport_parameters */

  41. #endif /* _NGX_EVENT_QUIC_OPENSSL_COMPAT_H_INCLUDED_ */