x509: Fix build with DEBUG_LEVEL < 2 for structures that ignore unknown critical extensions

This commit is contained in:
Tobias Brunner 2023-04-18 16:42:30 +02:00
parent a551f80e4f
commit c0a281472f
3 changed files with 6 additions and 9 deletions

View File

@ -429,7 +429,6 @@ static bool parse_certificate(private_x509_ac_t *this)
int extn_oid = OID_UNKNOWN;
signature_params_t sig_alg = {};
bool success = FALSE;
bool critical;
parser = asn1_parser_create(acObjects, this->encoding);
@ -529,8 +528,8 @@ static bool parse_certificate(private_x509_ac_t *this)
extn_oid = asn1_known_oid(object);
break;
case AC_OBJ_CRITICAL:
critical = object.len && *object.ptr;
DBG2(DBG_ASN, " %s",(critical)?"TRUE":"FALSE");
DBG2(DBG_ASN, " %s",
object.len && *object.ptr ? "TRUE" : "FALSE");
break;
case AC_OBJ_EXTN_VALUE:
{

View File

@ -528,7 +528,6 @@ static bool parse_basicOCSPResponse(private_x509_ocsp_response_t *this,
u_int responses_level = level0;
certificate_t *cert;
bool success = FALSE;
bool critical;
parser = asn1_parser_create(basicResponseObjects, blob);
parser->set_top_level(parser, level0);
@ -573,8 +572,8 @@ static bool parse_basicOCSPResponse(private_x509_ocsp_response_t *this,
extn_oid = asn1_known_oid(object);
break;
case BASIC_RESPONSE_CRITICAL:
critical = object.len && *object.ptr;
DBG2(DBG_ASN, " %s", critical ? "TRUE" : "FALSE");
DBG2(DBG_ASN, " %s",
object.len && *object.ptr ? "TRUE" : "FALSE");
break;
case BASIC_RESPONSE_EXT_VALUE:
if (extn_oid == OID_NONCE &&

View File

@ -430,7 +430,6 @@ static bool parse_extension_request(private_x509_pkcs10_t *this, chunk_t blob, i
int objectID;
int extn_oid = OID_UNKNOWN;
bool success = FALSE;
bool critical;
parser = asn1_parser_create(extensionRequestObjects, blob);
parser->set_top_level(parser, level0);
@ -445,8 +444,8 @@ static bool parse_extension_request(private_x509_pkcs10_t *this, chunk_t blob, i
extn_oid = asn1_known_oid(object);
break;
case PKCS10_EXTN_CRITICAL:
critical = object.len && *object.ptr;
DBG2(DBG_ASN, " %s", critical ? "TRUE" : "FALSE");
DBG2(DBG_ASN, " %s",
object.len && *object.ptr ? "TRUE" : "FALSE");
break;
case PKCS10_EXTN_VALUE:
{