[gnutls-help] gnutls_heartbeat_ping data_size parameter documentation

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed Jan 25 16:09:42 CET 2017


On Tue, Jan 24, 2017 at 4:17 PM, Olivier Soldano
<olivier.soldano at savoirfairelinux.com> wrote:
> Hello,
> I am currently having some trouble with the documentation of gnutls_heartbeat_ping.
> It is said that : size_t data_size
>                    is the length of the ping payload.
>
> I thought it meant the effective size of the Heartbeat packet generated,
> but my numbers are off. a little example:
>
>  - I specify a data_size of 444 bytes,
>  - I end up with an encrypted message of 471 bytes and a TLS packet of 489 bytes.

Is that the same as the size you specified + the output of
gnutls_record_overhead_size()?


> which after analysis ought to be the TLS header size and the MAC + padding in the
> encryption algorithm used.
> I don't understand where is my error, as i thought that the tls header size
> was covered by DEFAULT_PAYLOAD_SIZE in heartbeat_send_data. I think this is a mixed signal between

Do you mean the DEFAULT_PADDING_SIZE? That's a weird overhead due to
the way the heartbeat extension is defined (normal payload + some
padding). gnutls attempts to hide that padding size as it makes no
sense for applications.

regards,
Nikos



More information about the Gnutls-help mailing list