The TLS protocol allows for extra padding of records in CBC ciphers, to prevent statistical analysis based on the length of exchanged messages (see [RFC5246] section 22.214.171.124). GnuTLS appears to be one of few implementations that take advantage of this feature: the user can provide some plaintext data with a range of lengths she wishes to hide, and GnuTLS adds extra padding to make sure the attacker cannot tell the real plaintext length is in a range smaller than the user-provided one. Use gnutls_record_send_range to send length-hidden messages and gnutls_record_can_use_length_hiding to check whether the current session supports length hiding. Using the standard gnutls_record_send will only add minimal padding.
The TLS implementation in the Symbian operating system, frequently
used by Nokia and Sony-Ericsson mobile phones, cannot handle
non-minimal record padding. What happens when one of these clients
handshake with a GnuTLS server is that the client will fail to compute
the correct MAC for the record. The client sends a TLS alert
bad_record_mac) and disconnects. Typically this will result
in error messages such as ’A TLS fatal alert has been received’, ’Bad
record MAC’, or both, on the GnuTLS server side.
If compatibility with such devices is a concern, not sending length-hidden messages solves the problem by using minimal padding.
If you implement an application that has a configuration file, we recommend that you make it possible for users or administrators to specify a GnuTLS protocol priority string, which is used by your application via gnutls_priority_set. To allow the best flexibility, make it possible to have a different priority string for different incoming IP addresses.