forked from wolfSSL/wolfssl
UID name tracking
This commit is contained in:
@@ -1180,11 +1180,15 @@ static int GetName(DecodedCert* cert, int nameType)
|
|||||||
else {
|
else {
|
||||||
/* skip */
|
/* skip */
|
||||||
byte email = FALSE;
|
byte email = FALSE;
|
||||||
|
byte uid = FALSE;
|
||||||
int adv;
|
int adv;
|
||||||
|
|
||||||
if (joint[0] == 0x2a && joint[1] == 0x86) /* email id hdr */
|
if (joint[0] == 0x2a && joint[1] == 0x86) /* email id hdr */
|
||||||
email = TRUE;
|
email = TRUE;
|
||||||
|
|
||||||
|
if (joint[0] == 0x9 && joint[1] == 0x92) /* uid id hdr */
|
||||||
|
uid = TRUE;
|
||||||
|
|
||||||
cert->srcIdx += oidSz + 1;
|
cert->srcIdx += oidSz + 1;
|
||||||
|
|
||||||
if (GetLength(cert->source, &cert->srcIdx, &adv) < 0)
|
if (GetLength(cert->source, &cert->srcIdx, &adv) < 0)
|
||||||
@@ -1210,6 +1214,16 @@ static int GetName(DecodedCert* cert, int nameType)
|
|||||||
idx += adv;
|
idx += adv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uid) {
|
||||||
|
if (5 > (ASN_NAME_MAX - idx))
|
||||||
|
return ASN_PARSE_E;
|
||||||
|
XMEMCPY(&full[idx], "/UID=", 5);
|
||||||
|
idx += 5;
|
||||||
|
|
||||||
|
XMEMCPY(&full[idx], &cert->source[cert->srcIdx], adv);
|
||||||
|
idx += adv;
|
||||||
|
}
|
||||||
|
|
||||||
cert->srcIdx += adv;
|
cert->srcIdx += adv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user