Commit b31db505 authored by Matt Caswell's avatar Matt Caswell
Browse files

Provide documentation for missing SSL_SESSION_* functions

parent 43708c15
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -2,16 +2,26 @@

=head1 NAME

SSL_SESSION_free - free an allocated SSL_SESSION structure
SSL_SESSION_new,
SSL_SESSION_up_ref,
SSL_SESSION_free - create, free and manage SSL_SESSION structures

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 SSL_SESSION *SSL_SESSION_new(void);
 int SSL_SESSION_up_ref(SSL_SESSION *ses);
 void SSL_SESSION_free(SSL_SESSION *session);

=head1 DESCRIPTION

SSL_SESSION_new() creates a new SSL_SESSION structure and returns a pointer to
it.

SSL_SESSION_up_ref() increments the reference count on the given SSL_SESSION
structure.

SSL_SESSION_free() decrements the reference count of B<session> and removes
the B<SSL_SESSION> structure pointed to by B<session> and frees up the allocated
memory, if the reference count has reached 0.
@@ -44,7 +54,10 @@ incorrect reference counts and therefore program failures.

=head1 RETURN VALUES

SSL_SESSION_free() does not provide diagnostic information.
SSL_SESSION_new returns a pointer to the newly allocated SSL_SESSION structure
or NULL on error.

SSL_SESSION_up_ref returns 1 on success or 0 on error.

=head1 SEE ALSO

+16 −1
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@

=head1 NAME

SSL_SESSION_get0_id_context - get the SSL ID context associated with a session
SSL_SESSION_get0_id_context,
SSL_SESSION_set1_id_context
- get and set the SSL ID context associated with a session

=head1 SYNOPSIS

@@ -10,9 +12,14 @@ SSL_SESSION_get0_id_context - get the SSL ID context associated with a session

 const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s,
                                                  unsigned int *len)
 int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
                                unsigned int sid_ctx_len);

=head1 DESCRIPTION

See L<SSL_CTX_set_session_id_context(3)> for further details on session ID
contexts.

SSL_SESSION_get0_id_context() returns the ID context associated with
the SSL/TLS session B<s>. The length of the ID context is written to
B<*len> if B<len> is not NULL.
@@ -20,6 +27,14 @@ B<*len> if B<len> is not NULL.
The value returned is a pointer to an object maintained within B<s> and
should not be released.

SSL_SESSION_set1_id_context() takes a copy of the provided ID context given in
B<sid_ctx> and associates it with the session B<s>. The length of the ID context
is given by B<sid_ctx_len> which must not exceed SSL_MAX_SID_CTX_LENGTH bytes.

=head1 RETURN VALUES

SSL_SESSION_set1_id_context() returns 1 on success or 0 on error.

=head1 SEE ALSO

L<ssl(7)>,
+38 −0
Original line number Diff line number Diff line
=pod

=head1 NAME

SSL_SESSION_get0_peer
- get details about peer's certificate for a session

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);

=head1 DESCRIPTION

SSL_SESSION_get0_peer() returns the peer certificate associated with the session
B<s> or NULL if no peer certificate is available. The caller should not free the
returned value (unless L<X509_up_ref(3)> has also been called).

=head1 RETURN VALUES

SSL_SESSION_get0_peer() returns a pointer to the peer certificate or NULL if
no peer certificat is available.

=head1 SEE ALSO

L<ssl(7)>

=head1 COPYRIGHT

Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
+39 −0
Original line number Diff line number Diff line
=pod

=head1 NAME

SSL_SESSION_get_compress_id
- get details about the compression associated with a session

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);

=head1 DESCRIPTION

If compression has been negotiated for an ssl session then
SSL_SESSION_get_compress_id() will return the id for the compression method or
0 otherwise. The only built-in supported compression method is zlib which has an
id of 1.

=head1 RETURN VALUES

SSL_SESSION_get_compress_id() returns the id of the compression method or 0 if
none.

=head1 SEE ALSO

L<ssl(7)>

=head1 COPYRIGHT

Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
+47 −0
Original line number Diff line number Diff line
=pod

=head1 NAME

SSL_SESSION_set_ex_data,
SSL_SESSION_get_ex_data
- get and set application specific data on a session

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data);
 void *SSL_SESSION_get_ex_data(const SSL_SESSION *s, int idx);

=head1 DESCRIPTION

SSL_SESSION_set_ex_data() enables an application to store arbitrary application
specific data B<data> in an SSL_SESSION structure B<ss>. The index B<idx> should
be a value previously returned from a call to L<CRYPTO_get_ex_new_index(3)>.

SSL_SESSION_get_ex_data() retrieves application specific data previously stored
in an SSL_SESSION structure B<s>. The B<idx> value should be the same as that
used when originally storing the data.

=head1 RETURN VALUES

SSL_SESSION_set_ex_data() returns 1 for success or 0 for failure.

SSL_SESSION_get_ex_data() returns the previously stored value or NULL on
failure. NULL may also be a valid value.

=head1 SEE ALSO

L<ssl(7)>,
L<CRYPTO_get_ex_new_index(3)>

=head1 COPYRIGHT

Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
Loading