diff options
author | Adam Langley <agl@chromium.org> | 2014-06-20 12:00:00 -0700 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2014-09-05 12:21:44 +0200 |
commit | be0d851732bad7370640702bc9c4a33189ede287 (patch) | |
tree | dbb0532a3820f65cc102409ff574913b1986e285 /util | |
parent | 360928b7d0f16dde70e26841bbf9e1af727e8b8f (diff) |
psk_client_callback, 128-byte id bug.
Fix a bug in handling of 128 byte long PSK identity in
psk_client_callback.
OpenSSL supports PSK identities of up to (and including) 128 bytes in
length. PSK identity is obtained via the psk_client_callback,
implementors of which are expected to provide a NULL-terminated
identity. However, the callback is invoked with only 128 bytes of
storage thus making it impossible to return a 128 byte long identity and
the required additional NULL byte.
This CL fixes the issue by passing in a 129 byte long buffer into the
psk_client_callback. As a safety precaution, this CL also zeroes out the
buffer before passing it into the callback, uses strnlen for obtaining
the length of the identity returned by the callback, and aborts the
handshake if the identity (without the NULL terminator) is longer than
128 bytes.
(Original patch amended to achieve strnlen in a different way.)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions