diff options
author | jsing <> | 2019-03-25 16:35:48 +0000 |
---|---|---|
committer | jsing <> | 2019-03-25 16:35:48 +0000 |
commit | 4e5f1e0420a23688bec26a60ba7f49ffdd33ba62 (patch) | |
tree | b392fa487622bd75c8ac0ad1ff6dd527d2c42783 /src/lib/libssl/ssl_srvr.c | |
parent | 491a1b9b73d1852fd706b6845c3635f5bd3d3834 (diff) | |
download | openbsd-4e5f1e0420a23688bec26a60ba7f49ffdd33ba62.tar.gz openbsd-4e5f1e0420a23688bec26a60ba7f49ffdd33ba62.tar.bz2 openbsd-4e5f1e0420a23688bec26a60ba7f49ffdd33ba62.zip |
Rework ssl3_output_cert_chain() to take a CERT_PKEY and consider chains.
We will now include the certificates in the chain in the certificate list,
or use the existing extra_certs if present. Failing that we fall back to
the automatic chain building if not disabled.
This also simplifies the code significantly.
ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index 6872fa3523..f2aafc3032 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.64 2019/02/09 15:26:15 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.65 2019/03/25 16:35:48 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -2467,7 +2467,7 @@ int | |||
2467 | ssl3_send_server_certificate(SSL *s) | 2467 | ssl3_send_server_certificate(SSL *s) |
2468 | { | 2468 | { |
2469 | CBB cbb, server_cert; | 2469 | CBB cbb, server_cert; |
2470 | X509 *x; | 2470 | CERT_PKEY *cpk; |
2471 | 2471 | ||
2472 | /* | 2472 | /* |
2473 | * Server Certificate - RFC 5246, section 7.4.2. | 2473 | * Server Certificate - RFC 5246, section 7.4.2. |
@@ -2476,7 +2476,7 @@ ssl3_send_server_certificate(SSL *s) | |||
2476 | memset(&cbb, 0, sizeof(cbb)); | 2476 | memset(&cbb, 0, sizeof(cbb)); |
2477 | 2477 | ||
2478 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_A) { | 2478 | if (S3I(s)->hs.state == SSL3_ST_SW_CERT_A) { |
2479 | if ((x = ssl_get_server_send_cert(s)) == NULL) { | 2479 | if ((cpk = ssl_get_server_send_pkey(s)) == NULL) { |
2480 | SSLerror(s, ERR_R_INTERNAL_ERROR); | 2480 | SSLerror(s, ERR_R_INTERNAL_ERROR); |
2481 | return (0); | 2481 | return (0); |
2482 | } | 2482 | } |
@@ -2484,7 +2484,7 @@ ssl3_send_server_certificate(SSL *s) | |||
2484 | if (!ssl3_handshake_msg_start(s, &cbb, &server_cert, | 2484 | if (!ssl3_handshake_msg_start(s, &cbb, &server_cert, |
2485 | SSL3_MT_CERTIFICATE)) | 2485 | SSL3_MT_CERTIFICATE)) |
2486 | goto err; | 2486 | goto err; |
2487 | if (!ssl3_output_cert_chain(s, &server_cert, x)) | 2487 | if (!ssl3_output_cert_chain(s, &server_cert, cpk)) |
2488 | goto err; | 2488 | goto err; |
2489 | if (!ssl3_handshake_msg_finish(s, &cbb)) | 2489 | if (!ssl3_handshake_msg_finish(s, &cbb)) |
2490 | goto err; | 2490 | goto err; |