Commit b612799a authored by Richard Levitte's avatar Richard Levitte
Browse files

Revert "Remove heartbeats completely"



Done too soon, this is for future OpenSSL 1.2.0

This reverts commit 6c62f9e1.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 6c62f9e1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ my @disablables = (
    "fuzz-libfuzzer",
    "fuzz-afl",
    "gost",
    "heartbeats",
    "hw(-.+)?",
    "idea",
    "makedepend",
@@ -434,6 +435,7 @@ our %disabled = ( # "what" => "comment"
		  "external-tests"	=> "default",
		  "fuzz-libfuzzer"	=> "default",
		  "fuzz-afl"		=> "default",
		  "heartbeats"          => "default",
		  "md2"                 => "default",
                  "msan"                => "default",
		  "rc5"                 => "default",
@@ -485,8 +487,8 @@ my @disable_cascades = (

    "tls"		=> [ @tls ],

    # SRP requires TLSEXT
    "tlsext"		=> [ "srp" ],
    # SRP and HEARTBEATS require TLSEXT
    "tlsext"		=> [ "srp", "heartbeats" ],

    "crypto-mdebug"     => [ "crypto-mdebug-backtrace" ],

@@ -504,6 +506,7 @@ my @disable_cascades = (
    "stdio"             => [ "apps", "capieng" ],
    "apps"              => [ "tests" ],
    "comp"		=> [ "zlib" ],
    sub { !$disabled{"unit-test"} } => [ "heartbeats" ],

    sub { !$disabled{"msan"} } => [ "asm" ],
    );
+3 −0
Original line number Diff line number Diff line
@@ -628,6 +628,9 @@ static void list_disabled(void)
#ifdef OPENSSL_NO_GOST
    BIO_puts(bio_out, "GOST\n");
#endif
#ifdef OPENSSL_NO_HEARTBEATS
    BIO_puts(bio_out, "HEARTBEATS\n");
#endif
#ifdef OPENSSL_NO_IDEA
    BIO_puts(bio_out, "IDEA\n");
#endif
+17 −0
Original line number Diff line number Diff line
@@ -555,6 +555,22 @@ void msg_cb(int write_p, int version, int content_type, const void *buf,
        case 23:
            str_content_type = "ApplicationData";
            break;
#ifndef OPENSSL_NO_HEARTBEATS
        case 24:
            str_details1 = ", Heartbeat";

            if (len > 0) {
                switch (bp[0]) {
                case 1:
                    str_details1 = ", HeartbeatRequest";
                    break;
                case 2:
                    str_details1 = ", HeartbeatResponse";
                    break;
                }
            }
            break;
#endif
        }
    }

@@ -595,6 +611,7 @@ static STRINT_PAIR tlsext_types[] = {
    {"SRP", TLSEXT_TYPE_srp},
    {"signature algorithms", TLSEXT_TYPE_signature_algorithms},
    {"use SRTP", TLSEXT_TYPE_use_srtp},
    {"heartbeat", TLSEXT_TYPE_heartbeat},
    {"session ticket", TLSEXT_TYPE_session_ticket},
    {"renegotiation info", TLSEXT_TYPE_renegotiate},
    {"signed certificate timestamps", TLSEXT_TYPE_signed_certificate_timestamp},
+7 −0
Original line number Diff line number Diff line
@@ -2448,6 +2448,13 @@ int s_client_main(int argc, char **argv)
                SSL_renegotiate(con);
                cbuf_len = 0;
            }
#ifndef OPENSSL_NO_HEARTBEATS
            else if ((!c_ign_eof) && (cbuf[0] == 'B' && cmdletters)) {
                BIO_printf(bio_err, "HEARTBEATING\n");
                SSL_heartbeat(con);
                cbuf_len = 0;
            }
#endif
            else {
                cbuf_len = i;
                cbuf_off = 0;
+8 −0
Original line number Diff line number Diff line
@@ -2226,6 +2226,14 @@ static int sv_body(int s, int stype, unsigned char *context)
                     */
                    goto err;
                }
#ifndef OPENSSL_NO_HEARTBEATS
                if ((buf[0] == 'B') && ((buf[1] == '\n') || (buf[1] == '\r'))) {
                    BIO_printf(bio_err, "HEARTBEATING\n");
                    SSL_heartbeat(con);
                    i = 0;
                    continue;
                }
#endif
                if ((buf[0] == 'r') && ((buf[1] == '\n') || (buf[1] == '\r'))) {
                    SSL_renegotiate(con);
                    i = SSL_do_handshake(con);
Loading