diff options
author | Matt Caswell <matt@openssl.org> | 2018-03-19 12:58:05 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-03-19 14:47:12 +0000 |
commit | c2b290c3d0ff878c33b3540df530f64af23163bf (patch) | |
tree | c9632bd9750f843ad40ee52587373b358ee203ff /ssl | |
parent | 69e2b8d67d980b4dea8c5f2cb17cd86455989bb7 (diff) |
Fix no-psk
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5667)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/statem/extensions_clnt.c | 4 | ||||
-rw-r--r-- | ssl/statem/extensions_srvr.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c index bd025d7c02..bebf73a49c 100644 --- a/ssl/statem/extensions_clnt.c +++ b/ssl/statem/extensions_clnt.c @@ -744,7 +744,6 @@ EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt, unsigned int context, X509 *x, size_t chainidx) { - char identity[PSK_MAX_IDENTITY_LEN + 1]; const unsigned char *id = NULL; size_t idlen = 0; SSL_SESSION *psksess = NULL; @@ -764,7 +763,9 @@ EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt, return EXT_RETURN_FAIL; } +#ifndef OPENSSL_NO_PSK if (psksess == NULL && s->psk_client_callback != NULL) { + char identity[PSK_MAX_IDENTITY_LEN + 1]; unsigned char psk[PSK_MAX_PSK_LEN]; size_t psklen = 0; @@ -815,6 +816,7 @@ EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt, OPENSSL_cleanse(psk, psklen); } } +#endif /* OPENSSL_NO_PSK */ SSL_SESSION_free(s->psksession); s->psksession = psksess; diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index ee4cad124c..90142eb505 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -1047,6 +1047,7 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, return 0; } +#ifndef OPENSSL_NO_PSK if(sess == NULL && s->psk_server_callback != NULL && idlen <= PSK_MAX_IDENTITY_LEN) { @@ -1097,6 +1098,7 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, OPENSSL_cleanse(pskdata, pskdatalen); } } +#endif /* OPENSSL_NO_PSK */ if (sess != NULL) { /* We found a PSK */ |