forked from wolfSSL/wolfssl
memory free on failure, spelling, better function name
This commit is contained in:
@ -83,6 +83,7 @@ ASN Options:
|
|||||||
* WOLFSSL_SUBJ_DIR_ATTR: Enable support for SubjectDirectoryAttributes
|
* WOLFSSL_SUBJ_DIR_ATTR: Enable support for SubjectDirectoryAttributes
|
||||||
extension.
|
extension.
|
||||||
* WOLFSSL_SUBJ_INFO_ACC: Enable support for SubjectInfoAccess extension.
|
* WOLFSSL_SUBJ_INFO_ACC: Enable support for SubjectInfoAccess extension.
|
||||||
|
* WOLFSSL_FPKI: Enable support for FPKI (Federal PKI) extensions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_ASN
|
#ifndef NO_ASN
|
||||||
@ -14953,13 +14954,18 @@ static int DecodeSepHwAltName(DecodedCert* cert, const byte* input,
|
|||||||
idx += strLen;
|
idx += strLen;
|
||||||
|
|
||||||
ret = GetOctetString(input, &idx, &strLen, sz);
|
ret = GetOctetString(input, &idx, &strLen, sz);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
XFREE(cert->hwType, cert->heap, DYNAMIC_TYPE_X509_EXT);
|
||||||
|
cert->hwType = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
cert->hwSerialNum = (byte*)XMALLOC(strLen + 1, cert->heap,
|
cert->hwSerialNum = (byte*)XMALLOC(strLen + 1, cert->heap,
|
||||||
DYNAMIC_TYPE_X509_EXT);
|
DYNAMIC_TYPE_X509_EXT);
|
||||||
if (cert->hwSerialNum == NULL) {
|
if (cert->hwSerialNum == NULL) {
|
||||||
WOLFSSL_MSG("\tOut of Memory");
|
WOLFSSL_MSG("\tOut of Memory");
|
||||||
|
XFREE(cert->hwType, cert->heap, DYNAMIC_TYPE_X509_EXT);
|
||||||
|
cert->hwType = NULL;
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21281,7 +21287,7 @@ int wc_GetPubKeyDerFromCert(struct DecodedCert* cert,
|
|||||||
* otherwise the search starts from the node after 'current' alt name.
|
* otherwise the search starts from the node after 'current' alt name.
|
||||||
* Returns 0 on success
|
* Returns 0 on success
|
||||||
*/
|
*/
|
||||||
static DNS_entry* wc_GetAltName(struct DecodedCert* cert, int nameType,
|
static DNS_entry* FindAltName(struct DecodedCert* cert, int nameType,
|
||||||
DNS_entry* current)
|
DNS_entry* current)
|
||||||
{
|
{
|
||||||
DNS_entry* entry;
|
DNS_entry* entry;
|
||||||
@ -21312,7 +21318,7 @@ int wc_GetUUIDFromCert(struct DecodedCert* cert, byte* uuid, word32* uuidSz)
|
|||||||
DNS_entry* id = NULL;
|
DNS_entry* id = NULL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
id = wc_GetAltName(cert, ASN_URI_TYPE, id);
|
id = FindAltName(cert, ASN_URI_TYPE, id);
|
||||||
if (id != NULL) {
|
if (id != NULL) {
|
||||||
/* check if URI string matches expected format for UUID */
|
/* check if URI string matches expected format for UUID */
|
||||||
if (id->len != DEFAULT_UUID_SZ) {
|
if (id->len != DEFAULT_UUID_SZ) {
|
||||||
@ -21349,7 +21355,7 @@ int wc_GetFASCNFromCert(struct DecodedCert* cert, byte* fascn, word32* fascnSz)
|
|||||||
DNS_entry* id = NULL;
|
DNS_entry* id = NULL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
id = wc_GetAltName(cert, ASN_OTHER_TYPE, id);
|
id = FindAltName(cert, ASN_OTHER_TYPE, id);
|
||||||
if (id != NULL && id->oidSum == FASCN_OID) {
|
if (id != NULL && id->oidSum == FASCN_OID) {
|
||||||
if (fascn == NULL) {
|
if (fascn == NULL) {
|
||||||
*fascnSz = id->len;
|
*fascnSz = id->len;
|
||||||
|
@ -1290,7 +1290,7 @@ struct DNS_entry {
|
|||||||
char* ipString; /* human readable form of IP address */
|
char* ipString; /* human readable form of IP address */
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_FPKI
|
#ifdef WOLFSSL_FPKI
|
||||||
int oidSum; /* provid oid sum for verification */
|
int oidSum; /* provide oid sum for verification */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user