diff options
author | Ben Laurie <ben@links.org> | 2014-07-06 10:58:34 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2014-07-06 10:58:34 +0100 |
commit | 772efd4099c8e93290a5109302c03f0147275497 (patch) | |
tree | 80f9a13e0478de33a9ffe9e0825722dee76dff63 | |
parent | 4ba341b5ac79d642d6b2c65c26442d9fdacaff01 (diff) | |
download | openssl-new-772efd4099c8e93290a5109302c03f0147275497.tar.gz |
Make SSL_set_tlsext_heartbeat_no_requests() a real function.
-rw-r--r-- | ssl/s3_lib.c | 15 | ||||
-rw-r--r-- | ssl/ssl.h | 1 | ||||
-rw-r--r-- | ssl/ssl_locl.h | 3 | ||||
-rw-r--r-- | ssl/tls1.h | 12 |
4 files changed, 14 insertions, 17 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 74516ddbc5..d1db6b3de2 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3446,6 +3446,14 @@ int SSL_get_tlsext_heartbeat_pending(SSL *s) return s->tlsext_hb_pending; } +void SSL_set_tlsext_heartbeat_no_requests(SSL, unsigned set) + { + if (set) + s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS; + else + s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS; + } + #endif #endif /* ndef OPENSSL_NO_TLSEXT */ @@ -3620,13 +3628,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) ret = tls1_heartbeat(s); break; - case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS: - if (larg) - s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS; - else - s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS; - ret = 1; - break; #endif #endif /* !OPENSSL_NO_TLSEXT */ @@ -1819,7 +1819,6 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) #define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81 #ifndef OPENSSL_NO_HEARTBEATS #define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85 -#define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87 #endif #endif /* OPENSSL_NO_TLSEXT */ diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 651b837f54..7bfea92db3 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1293,6 +1293,9 @@ int ssl_prepare_clienthello_tlsext(SSL *s); int ssl_prepare_serverhello_tlsext(SSL *s); #ifndef OPENSSL_NO_HEARTBEATS +#define SSL_TLSEXT_HB_ENABLED 0x01 +#define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02 +#define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04 int tls1_heartbeat(SSL *s); int dtls1_heartbeat(SSL *s); int tls1_process_heartbeat(SSL *s); diff --git a/ssl/tls1.h b/ssl/tls1.h index 38c23824df..1429dbabf2 100644 --- a/ssl/tls1.h +++ b/ssl/tls1.h @@ -357,18 +357,12 @@ void SSL_set_tlsext_status_ocsp_resp(SSL *s, unsigned char *resp, # ifdef TLSEXT_TYPE_opaque_prf_input void SSL_set_tlsext_opaque_prf_input(SSL *s, const void *src, size_t len); # endif +# ifndef OPENSSL_NO_HEARTBEATS int SSL_get_tlsext_heartbeat_pending(SSL *s); +void SSL_set_tlsext_heartbeat_no_requests(SSL, unsigned set); +# endif #endif /* ndef OPENSSL_NO_TLSEXT */ -#ifndef OPENSSL_NO_HEARTBEATS -#define SSL_TLSEXT_HB_ENABLED 0x01 -#define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02 -#define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04 - -#define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \ - SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL) -#endif - #define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb) |