structs in X509.
-/* $OpenBSD: crl.c,v 1.14 2021/10/23 14:49:39 tb Exp $ */
+/* $OpenBSD: crl.c,v 1.15 2021/10/31 16:47:27 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
X509_STORE *store = NULL;
X509_STORE_CTX *ctx = NULL;
X509_LOOKUP *lookup = NULL;
- X509_OBJECT xobj;
+ X509_OBJECT *xobj = NULL;
EVP_PKEY *pkey;
const EVP_MD *digest;
char *digest_name = NULL;
if ((ctx = X509_STORE_CTX_new()) == NULL)
goto end;
+ if ((xobj = X509_OBJECT_new()) == NULL)
+ goto end;
if (!X509_STORE_CTX_init(ctx, store, NULL, NULL)) {
BIO_printf(bio_err,
goto end;
}
i = X509_STORE_get_by_subject(ctx, X509_LU_X509,
- X509_CRL_get_issuer(x), &xobj);
+ X509_CRL_get_issuer(x), xobj);
if (i <= 0) {
BIO_printf(bio_err,
"Error getting CRL issuer certificate\n");
goto end;
}
- pkey = X509_get_pubkey(X509_OBJECT_get0_X509(&xobj));
- X509_OBJECT_free_contents(&xobj);
+ pkey = X509_get_pubkey(X509_OBJECT_get0_X509(xobj));
+ X509_OBJECT_free(xobj);
+ xobj = NULL;
if (!pkey) {
BIO_printf(bio_err,
"Error getting CRL issuer public key\n");
X509_CRL_free(x);
X509_STORE_CTX_free(ctx);
X509_STORE_free(store);
+ X509_OBJECT_free(xobj);
return (ret);
}
-/* $OpenBSD: pkcs12.c,v 1.15 2021/10/23 14:48:33 tb Exp $ */
+/* $OpenBSD: pkcs12.c,v 1.16 2021/10/31 16:47:27 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
case NID_pkcs8ShroudedKeyBag:
if (options & INFO) {
+ const X509_ALGOR *tp8alg;
+
BIO_printf(bio_err, "Shrouded Keybag: ");
- alg_print(bio_err, bag->value.shkeybag->algor);
+ X509_SIG_get0(bag->value.shkeybag, &tp8alg, NULL);
+ alg_print(bio_err, tp8alg);
}
if (options & NOKEYS)
return 1;
-/* $OpenBSD: s_server.c,v 1.52 2021/10/23 14:52:51 tb Exp $ */
+/* $OpenBSD: s_server.c,v 1.53 2021/10/31 16:47:27 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
STACK_OF(OPENSSL_STRING) *aia = NULL;
X509 *x = NULL;
X509_STORE_CTX *inctx = NULL;
- X509_OBJECT obj;
+ X509_OBJECT *obj = NULL;
OCSP_REQUEST *req = NULL;
OCSP_RESPONSE *resp = NULL;
OCSP_CERTID *id = NULL;
SSL_CTX_get_cert_store(SSL_get_SSL_CTX(s)),
NULL, NULL))
goto err;
+ if ((obj = X509_OBJECT_new()) == NULL)
+ goto done;
if (X509_STORE_get_by_subject(inctx, X509_LU_X509,
- X509_get_issuer_name(x), &obj) <= 0) {
+ X509_get_issuer_name(x), obj) <= 0) {
BIO_puts(err,
"cert_status: Can't retrieve issuer certificate.\n");
X509_STORE_CTX_cleanup(inctx);
req = OCSP_REQUEST_new();
if (!req)
goto err;
- id = OCSP_cert_to_id(NULL, x, X509_OBJECT_get0_X509(&obj));
- X509_OBJECT_free_contents(&obj);
+ id = OCSP_cert_to_id(NULL, x, X509_OBJECT_get0_X509(obj));
+ X509_OBJECT_free(obj);
+ obj = NULL;
X509_STORE_CTX_free(inctx);
inctx = NULL;
if (!id)
ret = SSL_TLSEXT_ERR_OK;
done:
X509_STORE_CTX_free(inctx);
+ X509_OBJECT_free(obj);
if (ret != SSL_TLSEXT_ERR_OK)
ERR_print_errors(err);
if (aia) {