0289c73051
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. |
||
---|---|---|
.. | ||
pqueue | ||
test | ||
CMakeLists.txt | ||
d1_both.c | ||
d1_clnt.c | ||
d1_enc.c | ||
d1_lib.c | ||
d1_meth.c | ||
d1_pkt.c | ||
d1_srtp.c | ||
d1_srvr.c | ||
dtls1.h | ||
s3_both.c | ||
s3_cbc.c | ||
s3_clnt.c | ||
s3_enc.c | ||
s3_lib.c | ||
s3_meth.c | ||
s3_pkt.c | ||
s3_srvr.c | ||
s23_clnt.c | ||
s23_lib.c | ||
s23_meth.c | ||
s23_pkt.c | ||
s23_srvr.c | ||
srtp.h | ||
ssl2.h | ||
ssl3.h | ||
ssl23.h | ||
ssl_algs.c | ||
ssl_asn1.c | ||
ssl_cert.c | ||
ssl_ciph.c | ||
ssl_error.c | ||
ssl_lib.c | ||
ssl_locl.h | ||
ssl_rsa.c | ||
ssl_sess.c | ||
ssl_stat.c | ||
ssl_txt.c | ||
ssl.h | ||
t1_clnt.c | ||
t1_enc.c | ||
t1_lib.c | ||
t1_meth.c | ||
t1_reneg.c | ||
t1_srvr.c | ||
tls1.h |