Import OpenSSL 1.1.0f
This commit is contained in:
@@ -20,7 +20,7 @@ SSL_CTX_set_info_callback() sets the B<callback> function, that can be used to
|
||||
obtain state information for SSL objects created from B<ctx> during connection
|
||||
setup and use. The setting for B<ctx> is overridden from the setting for
|
||||
a specific SSL object, if specified.
|
||||
When B<callback> is NULL, not callback function is used.
|
||||
When B<callback> is NULL, no callback function is used.
|
||||
|
||||
SSL_set_info_callback() sets the B<callback> function, that can be used to
|
||||
obtain state information for B<ssl> during connection setup and use.
|
||||
@@ -93,10 +93,10 @@ Callback has been called because a handshake is finished.
|
||||
=back
|
||||
|
||||
The current state information can be obtained using the
|
||||
L<SSL_state_string(3)|SSL_state_string(3)> family of functions.
|
||||
L<SSL_state_string(3)> family of functions.
|
||||
|
||||
The B<ret> information can be evaluated using the
|
||||
L<SSL_alert_type_string(3)|SSL_alert_type_string(3)> family of functions.
|
||||
L<SSL_alert_type_string(3)> family of functions.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
@@ -110,44 +110,53 @@ The following example callback function prints state strings, information
|
||||
about alerts being handled and error messages to the B<bio_err> BIO.
|
||||
|
||||
void apps_ssl_info_callback(SSL *s, int where, int ret)
|
||||
{
|
||||
const char *str;
|
||||
int w;
|
||||
{
|
||||
const char *str;
|
||||
int w;
|
||||
|
||||
w=where& ~SSL_ST_MASK;
|
||||
w = where & ~SSL_ST_MASK;
|
||||
|
||||
if (w & SSL_ST_CONNECT) str="SSL_connect";
|
||||
else if (w & SSL_ST_ACCEPT) str="SSL_accept";
|
||||
else str="undefined";
|
||||
if (w & SSL_ST_CONNECT) str = "SSL_connect";
|
||||
else if (w & SSL_ST_ACCEPT) str = "SSL_accept";
|
||||
else str = "undefined";
|
||||
|
||||
if (where & SSL_CB_LOOP)
|
||||
{
|
||||
BIO_printf(bio_err,"%s:%s\n",str,SSL_state_string_long(s));
|
||||
}
|
||||
else if (where & SSL_CB_ALERT)
|
||||
{
|
||||
str=(where & SSL_CB_READ)?"read":"write";
|
||||
BIO_printf(bio_err,"SSL3 alert %s:%s:%s\n",
|
||||
str,
|
||||
SSL_alert_type_string_long(ret),
|
||||
SSL_alert_desc_string_long(ret));
|
||||
}
|
||||
else if (where & SSL_CB_EXIT)
|
||||
{
|
||||
if (ret == 0)
|
||||
BIO_printf(bio_err,"%s:failed in %s\n",
|
||||
str,SSL_state_string_long(s));
|
||||
else if (ret < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"%s:error in %s\n",
|
||||
str,SSL_state_string_long(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (where & SSL_CB_LOOP)
|
||||
{
|
||||
BIO_printf(bio_err, "%s:%s\n", str, SSL_state_string_long(s));
|
||||
}
|
||||
else if (where & SSL_CB_ALERT)
|
||||
{
|
||||
str = (where & SSL_CB_READ) ? "read" : "write";
|
||||
BIO_printf(bio_err, "SSL3 alert %s:%s:%s\n",
|
||||
str,
|
||||
SSL_alert_type_string_long(ret),
|
||||
SSL_alert_desc_string_long(ret));
|
||||
}
|
||||
else if (where & SSL_CB_EXIT)
|
||||
{
|
||||
if (ret == 0)
|
||||
BIO_printf(bio_err, "%s:failed in %s\n",
|
||||
str, SSL_state_string_long(s));
|
||||
else if (ret < 0)
|
||||
{
|
||||
BIO_printf(bio_err, "%s:error in %s\n",
|
||||
str, SSL_state_string_long(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(3)|ssl(3)>, L<SSL_state_string(3)|SSL_state_string(3)>,
|
||||
L<SSL_alert_type_string(3)|SSL_alert_type_string(3)>
|
||||
L<ssl(3)>, L<SSL_state_string(3)>,
|
||||
L<SSL_alert_type_string(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2001-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>.
|
||||
|
||||
=cut
|
||||
|
||||
Reference in New Issue
Block a user