-/* $OpenBSD: x509.c,v 1.27 2021/12/12 20:28:02 tb Exp $ */
+/* $OpenBSD: x509.c,v 1.28 2021/12/12 20:29:15 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
} else if (x509_config.modulus == i) {
EVP_PKEY *pkey;
- pkey = X509_get_pubkey(x);
+ pkey = X509_get0_pubkey(x);
if (pkey == NULL) {
BIO_printf(bio_err,
"Modulus=unavailable\n");
BIO_printf(STDout,
"Wrong Algorithm type");
BIO_printf(STDout, "\n");
- EVP_PKEY_free(pkey);
} else if (x509_config.pubkey == i) {
EVP_PKEY *pkey;
- pkey = X509_get_pubkey(x);
+ pkey = X509_get0_pubkey(x);
if (pkey == NULL) {
BIO_printf(bio_err,
"Error getting public key\n");
goto end;
}
PEM_write_bio_PUBKEY(STDout, pkey);
- EVP_PKEY_free(pkey);
} else if (x509_config.C == i) {
unsigned char *d;
char *m;