@@ -32124,15 +32124,19 @@ static int EccSpecifiedECDomainDecode(const byte* input, word32 inSz,
3212432124 }
3212532125#ifndef WOLFSSL_NO_ASN_STRICT
3212632126 /* Only version 2 and above can have a seed. */
32127- if ((ret == 0) && (dataASN[ECCSPECIFIEDASN_IDX_PARAM_SEED].tag != 0) &&
32127+ if (ret == 0) {
32128+ if ((dataASN[ECCSPECIFIEDASN_IDX_PARAM_SEED].tag != 0) &&
3212832129 (version < 2)) {
32129- ret = ASN_PARSE_E;
32130+ ret = ASN_PARSE_E;
32131+ }
3213032132 }
3213132133#endif
3213232134 /* Only version 2 and above can have a hash algorithm. */
32133- if ((ret == 0) && (dataASN[ECCSPECIFIEDASN_IDX_HASH_SEQ].tag != 0) &&
32135+ if (ret == 0) {
32136+ if ((dataASN[ECCSPECIFIEDASN_IDX_HASH_SEQ].tag != 0) &&
3213432137 (version < 2)) {
32135- ret = ASN_PARSE_E;
32138+ ret = ASN_PARSE_E;
32139+ }
3213632140 }
3213732141 if ((ret == 0) && (dataASN[ECCSPECIFIEDASN_IDX_COFACTOR].tag != 0)) {
3213832142 /* Store optional co-factor. */
@@ -32447,8 +32451,10 @@ int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key,
3244732451 inOutIdx, inSz);
3244832452 }
3244932453 /* Only version 1 supported. */
32450- if ((ret == 0) && (version != 1)) {
32451- ret = ASN_PARSE_E;
32454+ if (ret == 0) {
32455+ if (version != 1) {
32456+ ret = ASN_PARSE_E;
32457+ }
3245232458 }
3245332459 /* Curve Parameters are optional. */
3245432460 if ((ret == 0) && (dataASN[ECCKEYASN_IDX_PARAMS].tag != 0)) {
@@ -34416,8 +34422,10 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
3441634422 ret = ASN_PARSE_E;
3441734423 }
3441834424 /* Validate the issuer key hash length is the size required. */
34419- if ((ret == 0) && (issuerKeyHashLen != ocspDigestSize)) {
34420- ret = ASN_PARSE_E;
34425+ if (ret == 0) {
34426+ if (issuerKeyHashLen != ocspDigestSize) {
34427+ ret = ASN_PARSE_E;
34428+ }
3442134429 }
3442234430 if (ret == 0) {
3442334431 /* Store serial size. */
@@ -34804,12 +34812,16 @@ static int DecodeResponseData(byte* source, word32* ioIndex,
3480434812 1, source, ioIndex, size);
3480534813 }
3480634814 /* Only support v1 == 0 */
34807- if ((ret == 0) && (version != 0)) {
34808- ret = ASN_PARSE_E;
34815+ if (ret == 0) {
34816+ if (version != 0) {
34817+ ret = ASN_PARSE_E;
34818+ }
3480934819 }
3481034820 /* Ensure date is a minimal size. */
34811- if ((ret == 0) && (dateSz < MIN_DATE_SIZE)) {
34812- ret = ASN_PARSE_E;
34821+ if (ret == 0) {
34822+ if (dateSz < MIN_DATE_SIZE) {
34823+ ret = ASN_PARSE_E;
34824+ }
3481334825 }
3481434826 if (ret == 0) {
3481534827 /* TODO: use byName/byKey fields. */
0 commit comments