SSL_set_session_secret_cb.pod 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. =pod
  2. =head1 NAME
  3. SSL_set_session_secret_cb, tls_session_secret_cb_fn
  4. - set the session secret callback
  5. =head1 SYNOPSIS
  6. #include <openssl/ssl.h>
  7. typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len,
  8. STACK_OF(SSL_CIPHER) *peer_ciphers,
  9. const SSL_CIPHER **cipher, void *arg);
  10. int SSL_set_session_secret_cb(SSL *s,
  11. tls_session_secret_cb_fn session_secret_cb,
  12. void *arg);
  13. =head1 DESCRIPTION
  14. SSL_set_session_secret_cb() sets the session secret callback to be used
  15. (I<session_secret_cb>), and an optional argument (I<arg>) to be passed to that
  16. callback when it is called. This is only useful for an implementation of
  17. EAP-FAST (RFC4851). The presence of the callback also modifies the internal
  18. OpenSSL TLS state machine to match the modified TLS behaviour as described in
  19. RFC4851. Therefore this callback should not be used except when implementing
  20. EAP-FAST.
  21. The callback is expected to set the master secret to be used by filling in the
  22. data pointed to by I<*secret>. The size of the secret buffer is initially
  23. available in I<*secret_len> and may be updated by the callback (but must not be
  24. larger than the initial value).
  25. On the server side the set of ciphersuites offered by the peer is provided in
  26. the I<peer_ciphers> stack. Optionally the callback may select the preferred
  27. ciphersuite by setting it in I<*cipher>.
  28. On the client side the I<peer_ciphers> stack will always be NULL. The callback
  29. may specify the preferred cipher in I<*cipher> and this will be associated with
  30. the B<SSL_SESSION> - but it does not affect the ciphersuite selected by the
  31. server.
  32. The callback is also supplied with an additional argument in I<arg> which is the
  33. argument that was provided to the original SSL_set_session_secret_cb() call.
  34. =head1 RETURN VALUES
  35. SSL_set_session_secret_cb() returns 1 on success and 0 on failure.
  36. If the callback returns 1 then this indicates it has successfully set the
  37. secret. A return value of 0 indicates that the secret has not been set. On the
  38. client this will cause an immediate abort of the handshake.
  39. =head1 SEE ALSO
  40. L<ssl(7)>,
  41. L<SSL_get_session(3)>
  42. =head1 COPYRIGHT
  43. Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
  44. Licensed under the Apache License 2.0 (the "License"). You may not use
  45. this file except in compliance with the License. You can obtain a copy
  46. in the file LICENSE in the source distribution or at
  47. L<https://www.openssl.org/source/license.html>.
  48. =cut