How to respond to TLS heartbeat in openssl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to respond to TLS heartbeat in openssl

Keshava Krishna Bhat K
Hi All,

I am writing a TLS server that responds to a incoming TLS heartbeat request. I am using OpenSSL 1.0.2g .
But I am not able to get the server respond to a hearbeat request. 
Any clue on what I am missing?

I also got a clue that the version of openssl I am using might have hearbeats disabled. But how do I check if heartbeats are enabled in OpenSSL 1.0.2g?

Regards,
Keshava.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: How to respond to TLS heartbeat in openssl

Keshava Krishna Bhat K
Hi,

Is this controlled by the Makefile?

Regards,
Keshava.

On Wed, Dec 20, 2017 at 6:20 PM, Keshava Krishna Bhat K <[hidden email]> wrote:
Hi All,

I am writing a TLS server that responds to a incoming TLS heartbeat request. I am using OpenSSL 1.0.2g .
But I am not able to get the server respond to a hearbeat request. 
Any clue on what I am missing?

I also got a clue that the version of openssl I am using might have hearbeats disabled. But how do I check if heartbeats are enabled in OpenSSL 1.0.2g?

Regards,
Keshava.


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: How to respond to TLS heartbeat in openssl

Keshava Krishna Bhat K
Ok, I got to know that 
 openssl version -a gives out the flags used while building openssl.
so the output of this was 

OpenSSL 1.0.2g  1 Mar 2016
built on: reproducible build, date unspecified
platform: debian-amd64
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx) 
compiler: cc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/lib/ssl"

Since the putput above does not have OPENSSL_NO_HEARTBEATS, I assume heartbeats are not disabled in the build.
So I am back to square one :( -> how do I make the server respond to a TLS heartbeat request ? Do I have to read the packet and write it back ?

But code in the following file and method suggests this would done automatically (but again I have a layman's knowledge on C, I could be wrong)
t1_lib.c tls1_process_heartbeat

Regards,
Keshava.

On Thu, Dec 21, 2017 at 11:49 AM, Keshava Krishna Bhat K <[hidden email]> wrote:
Hi,

Is this controlled by the Makefile?

Regards,
Keshava.

On Wed, Dec 20, 2017 at 6:20 PM, Keshava Krishna Bhat K <[hidden email]> wrote:
Hi All,

I am writing a TLS server that responds to a incoming TLS heartbeat request. I am using OpenSSL 1.0.2g .
But I am not able to get the server respond to a hearbeat request. 
Any clue on what I am missing?

I also got a clue that the version of openssl I am using might have hearbeats disabled. But how do I check if heartbeats are enabled in OpenSSL 1.0.2g?

Regards,
Keshava.



--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: How to respond to TLS heartbeat in openssl

Jeffrey Walton-3
On Fri, Dec 22, 2017 at 1:32 AM, Keshava Krishna Bhat K
<[hidden email]> wrote:

> Ok, I got to know that
>  openssl version -a gives out the flags used while building openssl.
> so the output of this was
>
> OpenSSL 1.0.2g  1 Mar 2016
> built on: reproducible build, date unspecified
> platform: debian-amd64
> options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)
> compiler: cc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS
> -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack
> -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT
> -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM
> -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM
> -DGHASH_ASM -DECP_NISTZ256_ASM
> OPENSSLDIR: "/usr/lib/ssl"
>
> Since the putput above does not have OPENSSL_NO_HEARTBEATS, I assume
> heartbeats are not disabled in the build.
> So I am back to square one :( -> how do I make the server respond to a TLS
> heartbeat request ? Do I have to read the packet and write it back ?

You should also check <openssl/opensslconf.h> for OPENSSL_NO_HEARTBEATS.

$ cd openssl
$ grep -B 1 -A 1 HEART include/openssl/opensslconf.h
#endif
#ifndef OPENSSL_NO_HEARTBEATS
# define OPENSSL_NO_HEARTBEATS
#endif

Jeff
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: How to respond to TLS heartbeat in openssl

Keshava Krishna Bhat K
Hi Jeff,

I checked in the git repo (tags/OpenSSL_1_0_2g), opnesslconf.h does not have OPENSSL_NO_HEARTBEATS the above definition in 1.0.2g.
So I think its enabled.

Regards,
Keshava.

On Fri, Dec 22, 2017 at 12:20 PM, Jeffrey Walton <[hidden email]> wrote:
On Fri, Dec 22, 2017 at 1:32 AM, Keshava Krishna Bhat K
<[hidden email]> wrote:
> Ok, I got to know that
>  openssl version -a gives out the flags used while building openssl.
> so the output of this was
>
> OpenSSL 1.0.2g  1 Mar 2016
> built on: reproducible build, date unspecified
> platform: debian-amd64
> options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)
> compiler: cc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS
> -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack
> -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT
> -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM
> -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM
> -DGHASH_ASM -DECP_NISTZ256_ASM
> OPENSSLDIR: "/usr/lib/ssl"
>
> Since the putput above does not have OPENSSL_NO_HEARTBEATS, I assume
> heartbeats are not disabled in the build.
> So I am back to square one :( -> how do I make the server respond to a TLS
> heartbeat request ? Do I have to read the packet and write it back ?

You should also check <openssl/opensslconf.h> for OPENSSL_NO_HEARTBEATS.

$ cd openssl
$ grep -B 1 -A 1 HEART include/openssl/opensslconf.h
#endif
#ifndef OPENSSL_NO_HEARTBEATS
# define OPENSSL_NO_HEARTBEATS
#endif

Jeff
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users