diff options
author | Todd Short <tshort@akamai.com> | 2019-04-11 10:47:13 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-07-16 09:08:21 +0200 |
commit | 8c2bfd25129aea1b1f1b66ec753b21955f8ed523 (patch) | |
tree | 530798b60ed46a10265c5a061dedfd2694918ce3 /apps/s_server.c | |
parent | 55affcadbe4aac7d4832448b8c071b582da4e344 (diff) |
Add SSL_get[01]_peer_certificate()
Deprecate SSL_get_peer_certificte() and replace with
SSL_get1_peer_certificate().
Add SSL_get0_peer_certificate.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/8730)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r-- | apps/s_server.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 9995953526..15d479ce0e 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2939,12 +2939,11 @@ static void print_connection_info(SSL *con) PEM_write_bio_SSL_SESSION(bio_s_out, SSL_get_session(con)); - peer = SSL_get_peer_certificate(con); + peer = SSL_get0_peer_certificate(con); if (peer != NULL) { BIO_printf(bio_s_out, "Client certificate\n"); PEM_write_bio_X509(bio_s_out, peer); dump_cert_text(bio_s_out, peer); - X509_free(peer); peer = NULL; } @@ -3265,12 +3264,11 @@ static int www_body(int s, int stype, int prot, unsigned char *context) BIO_printf(io, "---\n"); print_stats(io, SSL_get_SSL_CTX(con)); BIO_printf(io, "---\n"); - peer = SSL_get_peer_certificate(con); + peer = SSL_get0_peer_certificate(con); if (peer != NULL) { BIO_printf(io, "Client certificate\n"); X509_print(io, peer); PEM_write_bio_X509(io, peer); - X509_free(peer); peer = NULL; } else { BIO_puts(io, "no client certificate available\n"); |