boringssl/ssl
Adam Langley 0289c73051 Fix TLS-PSK identity hint implementation issues.
PSK identity hint can be stored in SSL_CTX and in SSL/SSL_SESSION,
similar to other TLS parameters, with the value in SSL/SSL_SESSION
taking precedence over the one in SSL_CTX. The value in SSL_CTX is
shared (used as the default) between all SSL instances associated
with that SSL_CTX, whereas the value in SSL/SSL_SESSION is confined
to that particular TLS/SSL connection/session.

The existing implementation of TLS-PSK does not correctly distinguish
between PSK identity hint in SSL_CTX and in SSL/SSL_SESSION. This
change fixes these issues:
1. SSL_use_psk_identity_hint does nothing and returns "success" when
   the SSL object does not have an associated SSL_SESSION.
2. On the client, the hint in SSL_CTX (which is shared between
   multiple SSL instances) is overwritten with the hint received from
   server or reset to NULL if no hint was received.
3. On the client, psk_client_callback is invoked with the hint from
   SSL_CTX rather than from current SSL/SSL_SESSION (i.e., the one
   received from the server). Issue #2 above masks this issue.
4. On the server, the hint in SSL/SSL_SESSION is ignored and the hint
   from SSL_CTX is sent to the client.
5. On the server, the hint in SSL/SSL_SESSION is reset to the one in
   SSL_CTX after the ClientKeyExchange message step.

This change fixes the issues by:
* Adding storage for the hint in the SSL object. The idea being that
  the hint in the associated SSL_SESSION takes precedence.
* Reading the hint during the handshake only from the associated
  SSL_SESSION object.
* Initializing the hint in SSL object with the one from the SSL_CTX
  object.
* Initializing the hint in SSL_SESSION object with the one from the
  SSL object.
* Making SSL_use_psk_identity_hint and SSL_get_psk_identity_hint
  set/get the hint to/from SSL_SESSION associated with the provided
  SSL object, or, if no SSL_SESSION is available, set/get the hint
  to/from the provided SSL object.
* Removing code which resets the hint during handshake.
2014-06-20 13:17:36 -07:00
..
pqueue Inital import. 2014-06-20 13:17:32 -07:00
test Inital import. 2014-06-20 13:17:32 -07:00
CMakeLists.txt Inital import. 2014-06-20 13:17:32 -07:00
d1_both.c Inital import. 2014-06-20 13:17:32 -07:00
d1_clnt.c Inital import. 2014-06-20 13:17:32 -07:00
d1_enc.c Inital import. 2014-06-20 13:17:32 -07:00
d1_lib.c Inital import. 2014-06-20 13:17:32 -07:00
d1_meth.c Inital import. 2014-06-20 13:17:32 -07:00
d1_pkt.c CBC record splitting. 2014-06-20 13:17:35 -07:00
d1_srtp.c Inital import. 2014-06-20 13:17:32 -07:00
d1_srvr.c Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
dtls1.h Inital import. 2014-06-20 13:17:32 -07:00
s3_both.c ChannelID support. 2014-06-20 13:17:33 -07:00
s3_cbc.c Inital import. 2014-06-20 13:17:32 -07:00
s3_clnt.c Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
s3_enc.c Fallback SCSV. 2014-06-20 13:17:36 -07:00
s3_lib.c Equal preference cipher groups. 2014-06-20 13:17:35 -07:00
s3_meth.c Inital import. 2014-06-20 13:17:32 -07:00
s3_pkt.c CBC record splitting. 2014-06-20 13:17:35 -07:00
s3_srvr.c Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
s23_clnt.c TLS extension limit check fixes. 2014-06-20 13:17:36 -07:00
s23_lib.c Inital import. 2014-06-20 13:17:32 -07:00
s23_meth.c Inital import. 2014-06-20 13:17:32 -07:00
s23_pkt.c Inital import. 2014-06-20 13:17:32 -07:00
s23_srvr.c Inital import. 2014-06-20 13:17:32 -07:00
srtp.h Inital import. 2014-06-20 13:17:32 -07:00
ssl2.h Inital import. 2014-06-20 13:17:32 -07:00
ssl3.h Fallback SCSV. 2014-06-20 13:17:36 -07:00
ssl23.h Inital import. 2014-06-20 13:17:32 -07:00
ssl_algs.c Inital import. 2014-06-20 13:17:32 -07:00
ssl_asn1.c ChannelID support. 2014-06-20 13:17:33 -07:00
ssl_cert.c Inital import. 2014-06-20 13:17:32 -07:00
ssl_ciph.c Const correctness. 2014-06-20 13:17:36 -07:00
ssl_error.c Early callback support. 2014-06-20 13:17:36 -07:00
ssl_lib.c Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
ssl_locl.h Early callback support. 2014-06-20 13:17:36 -07:00
ssl_rsa.c Inital import. 2014-06-20 13:17:32 -07:00
ssl_sess.c Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
ssl_stat.c Add support for asynchronous session lookup. 2014-06-20 13:17:32 -07:00
ssl_txt.c SSL AEAD support. 2014-06-20 13:17:34 -07:00
ssl.h Fix TLS-PSK identity hint implementation issues. 2014-06-20 13:17:36 -07:00
t1_clnt.c Inital import. 2014-06-20 13:17:32 -07:00
t1_enc.c Fallback SCSV. 2014-06-20 13:17:36 -07:00
t1_lib.c Early callback support. 2014-06-20 13:17:36 -07:00
t1_meth.c Inital import. 2014-06-20 13:17:32 -07:00
t1_reneg.c Inital import. 2014-06-20 13:17:32 -07:00
t1_srvr.c Inital import. 2014-06-20 13:17:32 -07:00
tls1.h Implement ECDHE-PSK-WITH-AES-128-GCM-SHA256. 2014-06-20 13:17:35 -07:00