diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-12-31 23:00:36 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-12-31 23:00:36 +0000 |
commit | bd6941cfaa31ee8a3f8661cb98227a5cbcc0f9f3 (patch) | |
tree | 218fef78d2db96f5eb399893de2f44f448c58a84 /ssl/s3_lib.c | |
parent | 578519edd0d0a810a11bfb7baede0f7b99c7d92b (diff) |
PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve
Support for TLS/DTLS heartbeats.
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 5b54b41445..75d716e88f 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3328,6 +3328,27 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) ret = 1; break; +#ifndef OPENSSL_NO_HEARTBEATS + case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT: + if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) + ret = dtls1_heartbeat(s); + else + ret = tls1_heartbeat(s); + break; + + case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING: + ret = s->tlsext_hb_pending; + 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 */ default: break; |