Fix ISO C function/object pointer issue

Showed up on GCC with strict warnings.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3325)
This commit is contained in:
Rich Salz 2017-04-26 16:43:54 -04:00
parent 710756a9b3
commit cf10df81e1

View File

@ -264,16 +264,16 @@ static int test_keylog(void)
if (!TEST_true(SSL_CTX_set_cipher_list(cctx, "RSA")))
goto end;
if (!TEST_ptr_null((void *)SSL_CTX_get_keylog_callback(cctx))
|| !TEST_ptr_null((void *)SSL_CTX_get_keylog_callback(sctx)))
if (!TEST_true(SSL_CTX_get_keylog_callback(cctx) == NULL)
|| !TEST_true(SSL_CTX_get_keylog_callback(sctx) == NULL))
goto end;
SSL_CTX_set_keylog_callback(cctx, client_keylog_callback);
if (!TEST_ptr_eq((void *)SSL_CTX_get_keylog_callback(cctx),
(void *)client_keylog_callback))
if (!TEST_true(SSL_CTX_get_keylog_callback(cctx)
== client_keylog_callback))
goto end;
SSL_CTX_set_keylog_callback(sctx, server_keylog_callback);
if (!TEST_ptr_eq((void *)SSL_CTX_get_keylog_callback(sctx),
(void *)server_keylog_callback))
if (!TEST_true(SSL_CTX_get_keylog_callback(sctx)
== server_keylog_callback))
goto end;
/* Now do a handshake and check that the logs have been written to. */
@ -334,18 +334,18 @@ static int test_keylog_no_master_key(void)
&cctx, cert, privkey)))
return 0;
if (!TEST_ptr_null((void *)SSL_CTX_get_keylog_callback(cctx))
|| !TEST_ptr_null((void *)SSL_CTX_get_keylog_callback(sctx)))
if (!TEST_true(SSL_CTX_get_keylog_callback(cctx) == NULL)
|| !TEST_true(SSL_CTX_get_keylog_callback(sctx) == NULL))
goto end;
SSL_CTX_set_keylog_callback(cctx, client_keylog_callback);
if (!TEST_ptr_eq((void *)SSL_CTX_get_keylog_callback(cctx),
(void *)client_keylog_callback))
if (!TEST_true(SSL_CTX_get_keylog_callback(cctx)
== client_keylog_callback))
goto end;
SSL_CTX_set_keylog_callback(sctx, server_keylog_callback);
if (!TEST_ptr_eq((void *)SSL_CTX_get_keylog_callback(sctx),
(void *)server_keylog_callback))
if (!TEST_true(SSL_CTX_get_keylog_callback(sctx)
== server_keylog_callback))
goto end;
/* Now do a handshake and check that the logs have been written to. */