/*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
#include "crypto/asn1.h"
#include "crypto/x509.h"
+void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs)
+{
+ sk_X509_pop_free(certs, X509_free);
+}
+
#ifndef OPENSSL_NO_STDIO
int X509_print_fp(FILE *fp, X509 *x)
{
{
long l;
int ret = 0, i;
- char *m = NULL, mlch = ' ';
+ char mlch = ' ';
int nmindent = 0, printok = 0;
EVP_PKEY *pkey = NULL;
const char *neg;
}
ret = 1;
err:
- OPENSSL_free(m);
return ret;
}
STACK_OF(X509) *certs = X509_STORE_get1_all_certs(store);
int ret = print_certs(bio, certs);
- sk_X509_pop_free(certs, X509_free);
+ OSSL_STACK_OF_X509_free(certs);
return ret;
} else {
return BIO_printf(bio, " (no trusted store)\n") >= 0;
int cert_error = X509_STORE_CTX_get_error(ctx);
BIO *bio = BIO_new(BIO_s_mem()); /* may be NULL */
- if (bio == NULL) {
- ERR_raise(ERR_LIB_X509, ERR_R_MALLOC_FAILURE);
+ if (bio == NULL)
return 0;
- }
BIO_printf(bio, "%s at depth = %d error = %d (%s)\n",
X509_STORE_CTX_get0_parent_ctx(ctx) != NULL
? "CRL path validation"