Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 0e460b0
  • /
  • ssl
  • /
  • SSL_CTX_set_psk_client_callback.pod
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:a4175081c5b63e4293c05995ce2dfd2a18a8f6e6
directory badge Iframe embedding
swh:1:dir:c805345e9b2db10882c662685a2cb10d5c638f4a
SSL_CTX_set_psk_client_callback.pod
=pod

=head1 NAME

SSL_CTX_set_psk_client_callback, SSL_set_psk_client_callback - set PSK client callback

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
        unsigned int (*callback)(SSL *ssl, const char *hint,
        char *identity, unsigned int max_identity_len,
        unsigned char *psk, unsigned int max_psk_len));
 void SSL_set_psk_client_callback(SSL *ssl,
        unsigned int (*callback)(SSL *ssl, const char *hint,
        char *identity, unsigned int max_identity_len,
        unsigned char *psk, unsigned int max_psk_len));


=head1 DESCRIPTION

A client application must provide a callback function which is called
when the client is sending the ClientKeyExchange message to the server.

The purpose of the callback function is to select the PSK identity and
the pre-shared key to use during the connection setup phase.

The callback is set using functions SSL_CTX_set_psk_client_callback()
or SSL_set_psk_client_callback(). The callback function is given the
connection in parameter B<ssl>, a B<NULL>-terminated PSK identity hint
sent by the server in parameter B<hint>, a buffer B<identity> of
length B<max_identity_len> bytes where the resulting
B<NULL>-terminated identity is to be stored, and a buffer B<psk> of
length B<max_psk_len> bytes where the resulting pre-shared key is to
be stored.

=head1 NOTES

Note that parameter B<hint> given to the callback may be B<NULL>.

=head1 RETURN VALUES

Return values from the client callback are interpreted as follows:

On success (callback found a PSK identity and a pre-shared key to use)
the length (> 0) of B<psk> in bytes is returned.

Otherwise or on errors callback should return 0. In this case
the connection setup fails.

=head1 COPYRIGHT

Copyright 2006-2016 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>.

Copyright 2005 Nokia.

=cut

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top