Skip to content

Commit 34ad7de

Browse files
committed
asn: normalize TINY extension guard indentation and fix stale #endif comment
1 parent a7aaa51 commit 34ad7de

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21249,8 +21249,9 @@ WOLFSSL_TEST_VIS int DecodeExtensionType(const byte* input, word32 length,
2124921249
}
2125021250
break;
2125121251

21252-
#if !defined(IGNORE_NAME_CONSTRAINTS) && \
21253-
(!defined(WOLFSSL_X509_TINY) || defined(WOLFSSL_X509_TINY_NAME_CONSTRAINTS))
21252+
#if !defined(IGNORE_NAME_CONSTRAINTS) && \
21253+
(!defined(WOLFSSL_X509_TINY) || \
21254+
defined(WOLFSSL_X509_TINY_NAME_CONSTRAINTS))
2125421255
/* Name constraints. */
2125521256
case NAME_CONS_OID:
2125621257
#ifndef WOLFSSL_NO_ASN_STRICT
@@ -21269,29 +21270,29 @@ WOLFSSL_TEST_VIS int DecodeExtensionType(const byte* input, word32 length,
2126921270
ret = ASN_PARSE_E;
2127021271
}
2127121272
break;
21272-
#elif !defined(IGNORE_NAME_CONSTRAINTS)
21273+
#elif !defined(IGNORE_NAME_CONSTRAINTS)
2127321274
/* TINY can't enforce name constraints; fail closed rather than ignore. */
2127421275
case NAME_CONS_OID:
2127521276
WOLFSSL_ERROR_VERBOSE(ASN_NAME_INVALID_E);
2127621277
ret = ASN_NAME_INVALID_E;
2127721278
break;
21278-
#endif /* IGNORE_NAME_CONSTRAINTS */
21279+
#endif /* NAME_CONS_OID (name constraints / TINY) */
2127921280

21280-
#ifndef WOLFSSL_X509_TINY
21281+
#ifndef WOLFSSL_X509_TINY
2128121282
/* Inhibit anyPolicy. */
2128221283
case INHIBIT_ANY_OID:
2128321284
VERIFY_AND_SET_OID(cert->inhibitAnyOidSet);
2128421285
WOLFSSL_MSG("Inhibit anyPolicy extension not supported yet.");
2128521286
break;
2128621287

21287-
#ifndef IGNORE_NETSCAPE_CERT_TYPE
21288+
#ifndef IGNORE_NETSCAPE_CERT_TYPE
2128821289
/* Netscape's certificate type. */
2128921290
case NETSCAPE_CT_OID:
2129021291
if (DecodeNsCertType(input, (int)length, cert) < 0)
2129121292
ret = ASN_PARSE_E;
2129221293
break;
21293-
#endif
21294-
#ifdef HAVE_OCSP
21294+
#endif
21295+
#ifdef HAVE_OCSP
2129521296
/* OCSP no check. */
2129621297
case OCSP_NOCHECK_OID:
2129721298
VERIFY_AND_SET_OID(cert->ocspNoCheckSet);
@@ -21300,14 +21301,14 @@ WOLFSSL_TEST_VIS int DecodeExtensionType(const byte* input, word32 length,
2130021301
ret = ASN_PARSE_E;
2130121302
}
2130221303
break;
21303-
#endif
21304+
#endif
2130421305
case POLICY_CONST_OID:
2130521306
VERIFY_AND_SET_OID(cert->extPolicyConstSet);
2130621307
cert->extPolicyConstCrit = critical ? 1 : 0;
2130721308
if (DecodePolicyConstraints(&input[idx], (int)length, cert) < 0)
2130821309
return ASN_PARSE_E;
2130921310
break;
21310-
#endif /* !WOLFSSL_X509_TINY (inhibitAny/netscape/ocsp-nocheck/policyConstraints) */
21311+
#endif /* !WOLFSSL_X509_TINY (inhibitAny/netscape/ocsp/policyConst) */
2131121312
#ifdef WOLFSSL_SUBJ_DIR_ATTR
2131221313
case SUBJ_DIR_ATTR_OID:
2131321314
VERIFY_AND_SET_OID(cert->extSubjDirAttrSet);

0 commit comments

Comments
 (0)