summaryrefslogtreecommitdiffstats
path: root/apps/s_cb.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-12-31 22:59:57 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-12-31 22:59:57 +0000
commit4817504d069b4c5082161b02a22116ad75f822b1 (patch)
tree7a85f6af852e34e5b80080b50d80741f6ab36c5a /apps/s_cb.c
parent84b6e277d4f45487377d0159e82c356d750e1218 (diff)
PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Support for TLS/DTLS heartbeats.
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r--apps/s_cb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c
index 3cfad32593..c0f089c4b4 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -603,6 +603,26 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
}
}
}
+
+#ifndef OPENSSL_NO_HEARTBEATS
+ if (content_type == 24) /* Heartbeat */
+ {
+ str_details1 = ", Heartbeat";
+
+ if (len > 0)
+ {
+ switch (((const unsigned char*)buf)[0])
+ {
+ case 1:
+ str_details1 = ", HeartbeatRequest";
+ break;
+ case 2:
+ str_details1 = ", HeartbeatResponse";
+ break;
+ }
+ }
+ }
+#endif
}
BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)len, str_details1, str_details2);