diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-06-09 17:34:55 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-10 17:58:27 +0200 |
commit | ef0449135c4e4e7f04bbeafbd76ce7b5c0518088 (patch) | |
tree | 2d3f76716b0dc63313a35a3ea8da49cf5effe7f3 /apps/s_server.c | |
parent | bedda72ff771a41c317daa7bdb7cbe14608fbc03 (diff) |
Fix s_server app to not report an error when using a non DH certificate.
Fixes #15071
It always tries loading the cert as DH which previously did not produce
an error. The errors are not suppressed for these operations.
The output now matches previous versions of OpenSSL.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15670)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r-- | apps/s_server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 644fe1a905..009ac5a1eb 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2003,7 +2003,8 @@ int s_server_main(int argc, char *argv[]) if (dhfile != NULL) dhpkey = load_keyparams(dhfile, FORMAT_UNDEF, 0, "DH", "DH parameters"); else if (s_cert_file != NULL) - dhpkey = load_keyparams(s_cert_file, FORMAT_UNDEF, 0, "DH", "DH parameters"); + dhpkey = load_keyparams_suppress(s_cert_file, FORMAT_UNDEF, 0, "DH", + "DH parameters", 1); if (dhpkey != NULL) { BIO_printf(bio_s_out, "Setting temp DH parameters\n"); @@ -2035,9 +2036,10 @@ int s_server_main(int argc, char *argv[]) if (ctx2 != NULL) { if (dhfile != NULL) { - EVP_PKEY *dhpkey2 = load_keyparams(s_cert_file2, FORMAT_UNDEF, - 0, "DH", - "DH parameters"); + EVP_PKEY *dhpkey2 = load_keyparams_suppress(s_cert_file2, + FORMAT_UNDEF, + 0, "DH", + "DH parameters", 1); if (dhpkey2 != NULL) { BIO_printf(bio_s_out, "Setting temp DH parameters\n"); |