1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimSSL_SESSION_get0_id_context,
6e71b7053SJung-uk KimSSL_SESSION_set1_id_context
7e71b7053SJung-uk Kim- get and set the SSL ID context associated with a session
8e71b7053SJung-uk Kim
9e71b7053SJung-uk Kim=head1 SYNOPSIS
10e71b7053SJung-uk Kim
11e71b7053SJung-uk Kim #include <openssl/ssl.h>
12e71b7053SJung-uk Kim
13e71b7053SJung-uk Kim const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s,
14*b077aed3SPierre Pronchery                                                  unsigned int *len);
15e71b7053SJung-uk Kim int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
16e71b7053SJung-uk Kim                                unsigned int sid_ctx_len);
17e71b7053SJung-uk Kim
18e71b7053SJung-uk Kim=head1 DESCRIPTION
19e71b7053SJung-uk Kim
20e71b7053SJung-uk KimSee L<SSL_CTX_set_session_id_context(3)> for further details on session ID
21e71b7053SJung-uk Kimcontexts.
22e71b7053SJung-uk Kim
23e71b7053SJung-uk KimSSL_SESSION_get0_id_context() returns the ID context associated with
24e71b7053SJung-uk Kimthe SSL/TLS session B<s>. The length of the ID context is written to
25e71b7053SJung-uk KimB<*len> if B<len> is not NULL.
26e71b7053SJung-uk Kim
27e71b7053SJung-uk KimThe value returned is a pointer to an object maintained within B<s> and
28e71b7053SJung-uk Kimshould not be released.
29e71b7053SJung-uk Kim
30e71b7053SJung-uk KimSSL_SESSION_set1_id_context() takes a copy of the provided ID context given in
31e71b7053SJung-uk KimB<sid_ctx> and associates it with the session B<s>. The length of the ID context
32e71b7053SJung-uk Kimis given by B<sid_ctx_len> which must not exceed SSL_MAX_SID_CTX_LENGTH bytes.
33e71b7053SJung-uk Kim
34e71b7053SJung-uk Kim=head1 RETURN VALUES
35e71b7053SJung-uk Kim
36e71b7053SJung-uk KimSSL_SESSION_set1_id_context() returns 1 on success or 0 on error.
37e71b7053SJung-uk Kim
38e71b7053SJung-uk Kim=head1 SEE ALSO
39e71b7053SJung-uk Kim
40e71b7053SJung-uk KimL<ssl(7)>,
41e71b7053SJung-uk KimL<SSL_set_session_id_context(3)>
42e71b7053SJung-uk Kim
43e71b7053SJung-uk Kim=head1 HISTORY
44e71b7053SJung-uk Kim
456935a639SJung-uk KimThe SSL_SESSION_get0_id_context() function was added in OpenSSL 1.1.0.
46e71b7053SJung-uk Kim
47e71b7053SJung-uk Kim=head1 COPYRIGHT
48e71b7053SJung-uk Kim
49*b077aed3SPierre ProncheryCopyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
50e71b7053SJung-uk Kim
51*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
52e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
53e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
54e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
55e71b7053SJung-uk Kim
56e71b7053SJung-uk Kim=cut
57