SSL_CTX_set_stateless_cookie_generate_cb.pod 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_set_stateless_cookie_generate_cb,
  4. SSL_CTX_set_stateless_cookie_verify_cb
  5. - Callback functions for stateless TLS1.3 cookies
  6. =head1 SYNOPSIS
  7. #include <openssl/ssl.h>
  8. void SSL_CTX_set_stateless_cookie_generate_cb(
  9. SSL_CTX *ctx,
  10. int (*gen_stateless_cookie_cb) (SSL *ssl,
  11. unsigned char *cookie,
  12. size_t *cookie_len));
  13. void SSL_CTX_set_stateless_cookie_verify_cb(
  14. SSL_CTX *ctx,
  15. int (*verify_stateless_cookie_cb) (SSL *ssl,
  16. const unsigned char *cookie,
  17. size_t cookie_len));
  18. =head1 DESCRIPTION
  19. SSL_CTX_set_cookie_generate_cb() sets the callback used by L<SSL_stateless(3)>
  20. to generate the application-controlled portion of the cookie provided to clients
  21. in the HelloRetryRequest transmitted as a response to a ClientHello with a
  22. missing or invalid cookie. gen_stateless_cookie_cb() must write at most
  23. SSL_COOKIE_LENGTH bytes into B<cookie>, and must write the number of bytes
  24. written to B<cookie_len>. If a cookie cannot be generated, a zero return value
  25. can be used to abort the handshake.
  26. SSL_CTX_set_cookie_verify_cb() sets the callback used by L<SSL_stateless(3)> to
  27. determine whether the application-controlled portion of a ClientHello cookie is
  28. valid. A nonzero return value from app_verify_cookie_cb() communicates that the
  29. cookie is valid. The integrity of the entire cookie, including the
  30. application-controlled portion, is automatically verified by HMAC before
  31. verify_stateless_cookie_cb() is called.
  32. =head1 RETURN VALUES
  33. Neither function returns a value.
  34. =head1 SEE ALSO
  35. L<SSL_stateless(3)>
  36. =head1 COPYRIGHT
  37. Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
  38. Licensed under the OpenSSL license (the "License"). You may not use
  39. this file except in compliance with the License. You can obtain a copy
  40. in the file LICENSE in the source distribution or at
  41. L<https://www.openssl.org/source/license.html>.
  42. =cut