x_crl.c (openssl-1.1.1o) | : | x_crl.c (openssl-1.1.1p) | ||
---|---|---|---|---|
/* | /* | |||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. | * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. | |||
* | * | |||
* Licensed under the OpenSSL license (the "License"). You may not use | * Licensed under the OpenSSL license (the "License"). You may not use | |||
* this file except in compliance with the License. You can obtain a copy | * this file except in compliance with the License. You can obtain a copy | |||
* in the file LICENSE in the source distribution or at | * in the file LICENSE in the source distribution or at | |||
* https://www.openssl.org/source/license.html | * https://www.openssl.org/source/license.html | |||
*/ | */ | |||
#include <stdio.h> | #include <stdio.h> | |||
#include "internal/cryptlib.h" | #include "internal/cryptlib.h" | |||
#include <openssl/asn1t.h> | #include <openssl/asn1t.h> | |||
skipping to change at line 105 | skipping to change at line 105 | |||
X509_EXTENSION *ext; | X509_EXTENSION *ext; | |||
gtmp = X509_REVOKED_get_ext_d2i(rev, | gtmp = X509_REVOKED_get_ext_d2i(rev, | |||
NID_certificate_issuer, &j, NULL); | NID_certificate_issuer, &j, NULL); | |||
if (!gtmp && (j != -1)) { | if (!gtmp && (j != -1)) { | |||
crl->flags |= EXFLAG_INVALID; | crl->flags |= EXFLAG_INVALID; | |||
return 1; | return 1; | |||
} | } | |||
if (gtmp) { | if (gtmp) { | |||
gens = gtmp; | gens = gtmp; | |||
if (!crl->issuers) { | if (crl->issuers == NULL) { | |||
crl->issuers = sk_GENERAL_NAMES_new_null(); | crl->issuers = sk_GENERAL_NAMES_new_null(); | |||
if (!crl->issuers) | if (crl->issuers == NULL) { | |||
GENERAL_NAMES_free(gtmp); | ||||
return 0; | return 0; | |||
} | ||||
} | } | |||
if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) | if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) { | |||
GENERAL_NAMES_free(gtmp); | ||||
return 0; | return 0; | |||
} | ||||
} | } | |||
rev->issuer = gens; | rev->issuer = gens; | |||
reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL); | reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL); | |||
if (!reason && (j != -1)) { | if (!reason && (j != -1)) { | |||
crl->flags |= EXFLAG_INVALID; | crl->flags |= EXFLAG_INVALID; | |||
return 1; | return 1; | |||
} | } | |||
if (reason) { | if (reason) { | |||
skipping to change at line 257 | skipping to change at line 261 | |||
if (crl->meth->crl_init) { | if (crl->meth->crl_init) { | |||
if (crl->meth->crl_init(crl) == 0) | if (crl->meth->crl_init(crl) == 0) | |||
return 0; | return 0; | |||
} | } | |||
crl->flags |= EXFLAG_SET; | crl->flags |= EXFLAG_SET; | |||
break; | break; | |||
case ASN1_OP_FREE_POST: | case ASN1_OP_FREE_POST: | |||
if (crl->meth->crl_free) { | if (crl->meth != NULL && crl->meth->crl_free != NULL) { | |||
if (!crl->meth->crl_free(crl)) | if (!crl->meth->crl_free(crl)) | |||
return 0; | return 0; | |||
} | } | |||
AUTHORITY_KEYID_free(crl->akid); | AUTHORITY_KEYID_free(crl->akid); | |||
ISSUING_DIST_POINT_free(crl->idp); | ISSUING_DIST_POINT_free(crl->idp); | |||
ASN1_INTEGER_free(crl->crl_number); | ASN1_INTEGER_free(crl->crl_number); | |||
ASN1_INTEGER_free(crl->base_crl_number); | ASN1_INTEGER_free(crl->base_crl_number); | |||
sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); | sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); | |||
break; | break; | |||
} | } | |||
End of changes. 7 change blocks. | ||||
5 lines changed or deleted | 9 lines changed or added |