2016-05-17 14:51:34 -04:00
|
|
|
/*
|
2020-11-26 14:18:57 +00:00
|
|
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 10:52:47 +00:00
|
|
|
*
|
2018-12-06 13:17:34 +01:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-17 14:51:34 -04:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1998-12-21 10:52:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 16:56:48 +02:00
|
|
|
#include "internal/cryptlib.h"
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/evp.h>
|
2000-12-08 19:09:35 +00:00
|
|
|
#include <openssl/asn1.h>
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/x509.h>
|
1998-12-21 10:52:47 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
X509_INFO *X509_INFO_new(void)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2015-09-03 09:15:26 -04:00
|
|
|
X509_INFO *ret;
|
2015-01-22 03:40:55 +00:00
|
|
|
|
2015-09-03 09:15:26 -04:00
|
|
|
ret = OPENSSL_zalloc(sizeof(*ret));
|
2015-01-22 03:40:55 +00:00
|
|
|
if (ret == NULL) {
|
2020-11-04 12:23:19 +01:00
|
|
|
ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
|
2016-03-01 18:06:15 +00:00
|
|
|
return NULL;
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
2016-03-01 18:06:15 +00:00
|
|
|
|
|
|
|
return ret;
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
void X509_INFO_free(X509_INFO *x)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
|
|
|
if (x == NULL)
|
|
|
|
return;
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2015-04-30 17:33:59 -04:00
|
|
|
X509_free(x->x509);
|
|
|
|
X509_CRL_free(x->crl);
|
|
|
|
X509_PKEY_free(x->x_pkey);
|
2015-05-01 10:02:07 -04:00
|
|
|
OPENSSL_free(x->enc_data);
|
2015-01-22 03:40:55 +00:00
|
|
|
OPENSSL_free(x);
|
|
|
|
}
|