From 99e959b3452e5b44dc52e0e6e87b7e4ec42147af Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 3 Feb 2022 17:44:04 +0000 Subject: Use X509_*get0_pubkey() wherever possible to simplify and clean up the code. Also add error checking where possible. ok jsing --- src/usr.bin/openssl/s_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/usr.bin/openssl/s_client.c') diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c index da6ef088b8..15ebb0c0a7 100644 --- a/src/usr.bin/openssl/s_client.c +++ b/src/usr.bin/openssl/s_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_client.c,v 1.57 2021/12/26 14:46:06 jsing Exp $ */ +/* $OpenBSD: s_client.c,v 1.58 2022/02/03 17:44:04 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1772,10 +1772,10 @@ print_stuff(BIO *bio, SSL *s, int full) SSL_CIPHER_get_name(c)); if (peer != NULL) { EVP_PKEY *pktmp; - pktmp = X509_get_pubkey(peer); + + pktmp = X509_get0_pubkey(peer); BIO_printf(bio, "Server public key is %d bit\n", EVP_PKEY_bits(pktmp)); - EVP_PKEY_free(pktmp); } BIO_printf(bio, "Secure Renegotiation IS%s supported\n", SSL_get_secure_renegotiation_support(s) ? "" : " NOT"); -- cgit v1.2.3-55-g6feb