From 9076bd25bfad9c661cad928331295bd5ec9b5af3 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 11 Sep 2015 17:08:11 +0100 Subject: [PATCH] Make no-psk compile without warnings. PR#4035 Reviewed-by: Matt Caswell --- apps/s_server.c | 4 ---- ssl/s3_lib.c | 3 ++- ssl/ssl_cert.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/s_server.c b/apps/s_server.c index f70539301e..aa43541501 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1316,10 +1316,6 @@ int s_server_main(int argc, char *argv[]) goto end; } break; -#else - case OPT_PSK_HINT: - case OPT_PSK: - break; #endif #ifndef OPENSSL_NO_SRP case OPT_SRPVFILE: diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 4b11e60abd..5e7b618e49 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -5228,8 +5228,9 @@ int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen, s->method->ssl3_enc->generate_master_secret(s, s->session->master_key, pms, pmslen); - +#ifndef OPENSSL_NO_PSK err: +#endif if (pms) { if (free_pms) OPENSSL_clear_free(pms, pmslen); diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 7571095932..1caa3c85e3 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -333,13 +333,13 @@ CERT *ssl_cert_dup(CERT *cert) goto err; if (!custom_exts_copy(&ret->srv_ext, &cert->srv_ext)) goto err; - +#ifndef OPENSSL_NO_PSK if (cert->psk_identity_hint) { ret->psk_identity_hint = BUF_strdup(cert->psk_identity_hint); if (ret->psk_identity_hint == NULL) goto err; } - +#endif return (ret); err: -- 2.40.0