-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: correct the SSL_CTX_set_info_callback(3) manual page #22224
Conversation
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness.
TestcaseThe implementation of
demo.c#include <openssl/bio.h>
#include <openssl/ssl.h>
BIO * bio_err = NULL;
void apps_ssl_info_callback(SSL *s, int where, int ret)
{
const char *str;
int 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 (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));
}
}
}
int main (int argc, char *argv[])
{
SSL_CTX_set_info_callback(NULL, apps_ssl_info_callback);
SSL_set_info_callback(NULL, apps_ssl_info_callback);
return 0;
} Makefile
|
@t8m I forgot to check the getters, they needed to be fixed as well. Please reapprove. |
For your convenience: openssl/include/openssl/ssl.h.in Lines 740 to 743 in 8ed76c6
openssl/include/openssl/ssl.h.in Lines 2110 to 2113 in 8ed76c6
|
This pull request is ready to merge |
Merged to master, 3.1, and 3.0 branches. Thank you. |
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #22224)
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#22224) (cherry picked from commit 92986c0) Signed-off-by: fly2x <fly2x@hitls.org>
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#22224) Signed-off-by: fly2x <fly2x@hitls.org>
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#22224) (cherry picked from commit 92986c0) Signed-off-by: fly2x <fly2x@hitls.org>
The info callback is not prototyped correctly, and the code example fails to compile because of const-incorrectness.