-/* $OpenBSD: cert.c,v 1.51 2022/01/18 16:36:49 claudio Exp $ */
+/* $OpenBSD: cert.c,v 1.52 2022/01/18 16:52:18 claudio Exp $ */
/*
* Copyright (c) 2021 Job Snijders <job@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
pk = d2i_PUBKEY(NULL, &pkey, pkeysz);
assert(pk != NULL);
- if ((opk = X509_get_pubkey(p->x509)) == NULL)
+ if ((opk = X509_get0_pubkey(p->x509)) == NULL)
cryptowarnx("%s: RFC 6487 (trust anchor): "
"missing pubkey", fn);
else if (EVP_PKEY_cmp(pk, opk) != 1)
rc = 1;
EVP_PKEY_free(pk);
- EVP_PKEY_free(opk);
}
if (rc == 0) {