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

Macros defined

Source code


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


  4. #ifndef _NGX_EVENT_QUIC_TOKENS_H_INCLUDED_
  5. #define _NGX_EVENT_QUIC_TOKENS_H_INCLUDED_


  6. #include <ngx_config.h>
  7. #include <ngx_core.h>


  8. #define NGX_QUIC_MAX_TOKEN_SIZE              64
  9.     /* SHA-1(addr)=20 + sizeof(time_t) + retry(1) + odcid.len(1) + odcid */

  10. #define NGX_QUIC_AES_256_GCM_IV_LEN          12
  11. #define NGX_QUIC_AES_256_GCM_TAG_LEN         16

  12. #define NGX_QUIC_TOKEN_BUF_SIZE             (NGX_QUIC_AES_256_GCM_IV_LEN      \
  13.                                              + NGX_QUIC_MAX_TOKEN_SIZE        \
  14.                                              + NGX_QUIC_AES_256_GCM_TAG_LEN)


  15. ngx_int_t ngx_quic_new_sr_token(ngx_connection_t *c, ngx_str_t *cid,
  16.     u_char *secret, u_char *token);
  17. ngx_int_t ngx_quic_new_token(ngx_log_t *log, struct sockaddr *sockaddr,
  18.     socklen_t socklen, u_char *key, ngx_str_t *token, ngx_str_t *odcid,
  19.     time_t expires, ngx_uint_t is_retry);
  20. ngx_int_t ngx_quic_validate_token(ngx_connection_t *c,
  21.     u_char *key, ngx_quic_header_t *pkt);

  22. #endif /* _NGX_EVENT_QUIC_TOKENS_H_INCLUDED_ */