in DecodeAltNames, skip unknown name types, don't treat as error

This commit is contained in:
John Safranek
2014-03-18 09:24:07 -07:00
parent 1ea620cece
commit ac452eebdc

View File

@@ -2936,8 +2936,17 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert)
} }
#endif /* CYASSL_SEP */ #endif /* CYASSL_SEP */
else { else {
CYASSL_MSG("\tNot DNS type"); int strLen;
return ASN_PARSE_E; word32 lenStartIdx = idx;
CYASSL_MSG("\tUnsupported name type, skipping");
if (GetLength(input, &idx, &strLen, sz) < 0) {
CYASSL_MSG("\tfail: unsupported name length");
return ASN_PARSE_E;
}
length -= (strLen + idx - lenStartIdx);
idx += strLen;
} }
} }
return 0; return 0;