Don't depend on SSL structure internals
authorMatt Caswell <matt@openssl.org>
Mon, 5 Oct 2015 09:21:11 +0000 (10:21 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 30 Oct 2015 08:39:46 +0000 (08:39 +0000)
The macros SSL_in_connect_init() and SSL_in_accept_init() inadvertently
depended on SSL structure internals. This fixes it to use public API calls
instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
include/openssl/ssl.h

index 8570f33653ba9e6633d01e7776c4b121b67f9e59..a810da7759553b1f965ab66a91cdfb9e8bd05bbe 100644 (file)
@@ -1007,8 +1007,8 @@ typedef enum {
 
 /* Is the SSL_connection established? */
 # define SSL_get_state(a)                SSL_state(a)
-# define SSL_in_connect_init(a)          (SSL_in_init(a) && !a->server)
-# define SSL_in_accept_init(a)           (SSL_in_init(a) && a->server)
+# define SSL_in_connect_init(a)          (SSL_in_init(a) && !SSL_is_server(a))
+# define SSL_in_accept_init(a)           (SSL_in_init(a) && SSL_is_server(a))
 int SSL_in_init(SSL *s);
 int SSL_in_before(SSL *s);
 int SSL_is_init_finished(SSL *s);