diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 2895f8c37..eca8a353a 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -1180,11 +1180,15 @@ static int GetName(DecodedCert* cert, int nameType) else { /* skip */ byte email = FALSE; + byte uid = FALSE; int adv; if (joint[0] == 0x2a && joint[1] == 0x86) /* email id hdr */ email = TRUE; + if (joint[0] == 0x9 && joint[1] == 0x92) /* uid id hdr */ + uid = TRUE; + cert->srcIdx += oidSz + 1; if (GetLength(cert->source, &cert->srcIdx, &adv) < 0) @@ -1210,6 +1214,16 @@ static int GetName(DecodedCert* cert, int nameType) 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; } }