Skip to content

OpenSSL 1.1.1b no longer accepts an empty string as PSK identifier #8894

@M-Peter-Fth

Description

@M-Peter-Fth

We use OpenSSL with PSK+AES256. As we don't use multiple preshared keys, the relevant callback (SSL_set_psk_client_callback()) returns an empty string for the PSK identifier, which worked fine with OpenSSL 1.1.0h and earlier.

When using an empty string as PSK identifier with OpenSSL 1.1.1b, SSL_do_handshake() will result in ERR_R_INTERNAL_ERROR from tls_construct_ctos_early_data() (in line 819 of .\ssl\statem\extensions_clnt.c). This error is queued because the PSK identifier is duplicated with OPENSSL_memdup(id, idlen), which can't allocate a memory block of size 0, 0 being the length of the empty string excluding the terminating '\0'.

Considering the documentation for SSL_CTX_set_psk_client_callback(), which states:

... a buffer identity of length max_identity_len bytes where the resulting NUL-terminated identity is to be stored, ...

the PSK identifier is expected to be a NUL-terminated string. To me this means that OPENSSL_memdup() should be called with idlen+1, to duplicate the string including the terminating '\0'. Using an OpenSSL 1.1.1b built with this change worked as expected, at least for manual tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy