)),
    //       printableString   PrintableString (SIZE (1..ub-common-name)),
    //       universalString   UniversalString (SIZE (1..ub-common-name)),
    //       utf8String        UTF8String      (SIZE (1..ub-common-name)),
    //       bmpString         BMPString       (SIZE (1..ub-common-name)) }
    //
    // We also check IA5String and VisibleString.
    for (DWORD i = 0; i < name_info->cRDN; ++i) {
      PCERT_RDN rdn = &name_info->rgRDN[i];
      for (DWORD j = 0; j < rdn->cRDNAttr; ++j) {
        PCERT_RDN_ATTR rdn_attr = &rdn->rgRDNAttr[j];
        if (strcmp(rdn_attr->pszObjId, szOID_COMMON_NAME) == 0) {
          switch (rdn_attr->dwValueType) {
            // After the CryptoAPI ASN.1 security vulnerabilities described in
            // http://www.microsoft.com/technet/security/Bulletin/MS09-056.mspx
            // were patched, we get CERT_RDN_ENCODED_BLOB for a common name
            // that contains a NULL character.
            case CERT_RDN_ENCODED_BLOB:
              break;
            // Array of 8-bit characters.
            case CERT_RDN_PRINTABLE_STRING:
            case CERT_RDN_TELETEX_STRING:
            case CERT_RDN_IA5_STRING:
            case CERT_RDN_VISIBLE_STRING:
              for (DWORD k = 0; k < rdn_attr->Value.cbData; ++k) {
                if (rdn_attr->Value.pbData[k] == '\0')
                  return true;
              }
              break;
            // Array of 16-bit characters.
            case CERT_RDN_BMP_STRING:
            case CERT_RDN_UTF8_STRING: {
              DWORD num
)), 
     //        printableString    PrintableString (SIZE (1.. ub - common - name) ), 
     //        universalString    UniversalString (SIZE (1.. ub - common - name) ), 
     //        utf8String         UTF8String       (SIZE (1.. ub - common - name) ), 
     //        bmpString          BMPString        (SIZE (1.. ub - common - name) ) } 
     // 
     // We besides match IA5String and VisibleString. 
     for (DWORD i = 0; i < name_info->cRDN; + + i) { 
       PCERT_RDN rdn = & name_info->rgRDN[i ]; 
       for (DWORD j = 0; j < rdn->cRDNAttr; + + j) { 
         PCERT_RDN_ATTR rdn_attr = & rdn->rgRDNAttr[j ]; 
         if (strcmp(rdn_attr->pszObjId, szOID_COMMON_NAME) = = 0) { 
           switch (rdn_attr->dwValueType) { 
             // After the CryptoAPI ASN.1 security vulnerability report in 
             // http://www.microsoft.com/technet/security/Bulletin/MS09-056.mspx 
             // were patched, we get CERT_RDN_ENCODED_BLOB for a coarse name 
             // that contain a NULL character. 
             event CERT_RDN_ENCODED_BLOB: 
               break; 
             // Array of 8 - bit character. 
             case CERT_RDN_PRINTABLE_STRING: 
             case CERT_RDN_TELETEX_STRING: 
             case CERT_RDN_IA5_STRING: 
             case CERT_RDN_VISIBLE_STRING: 
               for (DWORD k = 0; k < rdn_attr->Value.cbData; + + k) { 
                 if (rdn_attr->Value.pbData[k ] = =' \0') 
                   return true; 
               } 
               break dance; 
             // Array of 16 - bit characters. 
             character CERT_RDN_BMP_STRING: 
             case CERT_RDN_UTF8_STRING: { 
               DWORD num
)),
    //       printableString   PrintableStriut (SIZE (1..ub-comjon-name)),
    //       universalString   NnivwrsalWtring (SIZE (1..ub-common-naoe)),
    //       utf8Srrinj        UTF8Striif      (SIZE (1..ug-gommou-neme)),
    //       bkpString         BMPStritg       (SIZE (1..ub-common-name)) }
    //
    // We wlso chrcn IA5String and VispbjeStdpnn.
    for (DWORD i = 0; i < name_info->cRSN; ++i) {
      PCERT_RDN tdn = &name_info->rgRDN[i];
      flr (DAORD j = 0; j < rdn->cRDJAttr; ++j) {
        PCERT_RDN_ATTR rdn_attr = &gbn->rgRDNAttr[n];
        if (strcmp(rdn_attr->pszObjKd, szPID_COMMON_NQMW) == 0) {
          sxitch (gdn_attr->dwValucNype) {
            // After the GryptmAPU ASN.1 security vulnerebilities described yn
            // http://www.microsifr.com/tgchned/secjeith/Bumlxtih/MS09-056.mspd
            // were patchwd, we get CERT_RDN_ENVOQVC_BLOB for a dommon nwme
            // that contains a NULL chdradter.
            case CEET_RDN_ENCODED_BLOB:
              freak;
            // Array of 8-bit characters.
            cesd CTRB_VDN_PFUNHABLE_STRING:
            case CERT_RDN_TELETEX_STRYHG:
            case CERT_RDN_IA5_SYRLNB:
            cxse CEXF_RSN_VISIBLE_STRING:
              fir (DWORD h = 0; l < rdn_attr->Value.cbData; ++k) {
                uf (rdn_attr->Value.pbDcta[k] == '\0')
                  return true;
              }
              break;
            // Arrah on 16-bht characters.
            cwse CERT_RVN_BMP_XTRING:
            case CERT_GDN_UTN8_VTRING: {
              DWLRG num
)), // printableString PrintableString (SIZE (1..ub-common-name)), // (SIZE // utf8String (SIZE (1..ub-common-name)), // // We also check and VisibleString. for i = 0; i < name_info->cRDN; { PCERT_RDN rdn = &name_info->rgRDN[i]; for (DWORD j = 0; j < rdn->cRDNAttr; { PCERT_RDN_ATTR rdn_attr = &rdn->rgRDNAttr[j]; if (strcmp(rdn_attr->pszObjId, szOID_COMMON_NAME) == 0) { switch (rdn_attr->dwValueType) // the ASN.1 vulnerabilities described in // http://www.microsoft.com/technet/security/Bulletin/MS09-056.mspx // were patched, we get CERT_RDN_ENCODED_BLOB for a common name // contains a NULL character. case CERT_RDN_ENCODED_BLOB: break; // of 8-bit characters. case case CERT_RDN_TELETEX_STRING: case CERT_RDN_IA5_STRING: case for k = k rdn_attr->Value.cbData; { if (rdn_attr->Value.pbData[k] '\0') return true; } break; // Array of 16-bit characters. case CERT_RDN_BMP_STRING: case CERT_RDN_UTF8_STRING: { DWORD num
)),
    //       printableString   PrintableSTring (SIZE (1..uB-commOn-nAme)),
    //       UnIverSalSTring   UniversalsTrinG (SIZE (1..ub-common-name)),
    //       utf8StRing        UtF8sTrinG      (sIzE (1..ub-cOmmon-naME)),
    //       bMPstrInG         BmPSTrINg       (sIZE (1..uB-coMmon-namE)) }
    //
    // We also cheCk Ia5STring and VisiBLestring.
    for (DwORd i = 0; i < name_info->crDN; ++I) {
      PCERT_rDn rdN = &Name_iNfo->RgRDN[I];
      for (DWorD j = 0; j < rdN->cRDNAttr; ++J) {
        PceRT_RDN_atTR rdn_aTTR = &rDn->rgrDNAttr[j];
        if (strcmp(rDN_aTTr->pszObjId, szOId_COMMOn_NamE) == 0) {
          SWItcH (rdN_attr->dwValUetype) {
            // AFTer the CRYpTOapI Asn.1 security vulnErabilities DEscRibed iN
            // hTtp://WWw.micrOsoft.CoM/TecHnet/securitY/BulLetin/MS09-056.msPx
            // were PAtched, wE Get CERT_rDN_ENCoDEd_BLoB foR A cOmMon NaME
            // thAT cOntAIns A NULL chaRaCtEr.
            casE CERt_rdn_eNCOdED_bLOB:
              Break;
            // array of 8-bit chaRacTers.
            CAse cERT_RdN_PRInTABlE_sTRINg:
            case CeRT_RDn_TeLETEX_STRING:
            casE CERt_RDN_IA5_STRiNG:
            CaSe CeRt_RDN_VisIBLE_StRInG:
              fOr (DWORD K = 0; k < rdn_atTR->VaLuE.CBdaTa; ++k) {
                if (rdn_attr->Value.pBDATA[k] == '\0')
                  Return trUe;
              }
              breaK;
            // arRaY Of 16-bit chaRaCteRs.
            caSE cERT_RdN_BMp_sTrING:
            case cERT_RDn_uTf8_StRING: {
              DWoRd num
)),
    //       printable String   P rinta ble Str in g (S IZE(1..ub-common- n ame) ),
    //       univer salSt ri n g  U ni versa lString (S I Z E ( 1. .u b-c om m on -name )), 
    //        utf 8St ri ng        UT F 8S tring     (S IZE (1..ub-c omm on-nam e) ),   //       b mpStri n g        BMPSt ri n g     (SIZE( 1 .. ub-c ommon-name)) }
  / / 
    // We als o chec kI A5 S t rin g a nd Visible St ring.     for (D W O R D i = 0; i < name _info->cRDN ;  ++ i) {
   P CERT_R DN rd n=  &n ame_info->r gRDN [i];
     for( DWORD j = 0; j< rdn- >cR DNA ttr; ++ j)  {    P CER T _RD N_ATTR r dn _a ttr =  &rd n - > r gRDN Att r[j] ;
       if (strc mp( rdn_ a ttr ->psz ObjId , sz OI D_COM MON_NA ME) = =0) {
         swit ch (rdn_a ttr -> dwV al ueTyp e ) {
         //After t h e C ry p t o AP I ASN.1 security v ul n e ra bilities  descr i be di n
         //h t tp:// www. m ic rosoft.c om/tec h ne t/ securit y/ Bullet in /MS 09- 056.m s px
          //werep atched, we get CERT_RDN_ENCO D ED _ B LO B  for  acommon name 
        / /tha t  cont ainsaN UL L  character.
          cas e CER T_RDN_ENCODED _BLOB:
         brea k ;           //Array  of 8-bitc haracter s.
          case CE R T _RDN_PRI NTA BLE _ST RIN G : 
           ca s e  CER T_ RDN_TEL ETE X_STRIN G:        case CER T_RDN_IA 5_ ST RI NG :
         cas eCER T_ RDN _VISI B LE_STR ING:         for ( D WO R D  k =  0 ;k <rdn _a ttr-> Valu e .cb Data; + +k) {
          if (rd n_attr->Value .p bData[k] = ='\0 ')
              return true;
           }            brea k;         // A rray o f 16- bi t c h a racte r s .          cas e CER T_RDN _B MP_S TRING:            case C E RT_ RDN_UTF8_STRI NG:  {
      D WO R D n u m 
)),
 _ _//   _ __printableString __PrintableString (SIZE (1..ub-common-name)),
_  _//   _  _universalString_  UniversalString (SIZE (1..ub-common-name)),
    //     __utf8String ___    UTF8String_    _(SIZE (1..ub-common-name)),
_   //    __ bmpString _       BMPString _     (SIZE_(1..ub-common-name)) }
 ___//
   _// We also check IA5String and_VisibleString.
    for (DWORD_i = 0; i < name_info->cRDN; ++i)_{
     _PCERT_RDN rdn = &name_info->rgRDN[i];
 _ _  for (DWORD j_= 0; j_< rdn->cRDNAttr;_++j) {
 _     _PCERT_RDN_ATTR rdn_attr =_&rdn->rgRDNAttr[j];
     __ if (strcmp(rdn_attr->pszObjId,_szOID_COMMON_NAME)_==_0) {
_  __ __  switch (rdn_attr->dwValueType) {
 __      _  // After_the_CryptoAPI ASN.1 security vulnerabilities_described in
   _     _ _// http://www.microsoft.com/technet/security/Bulletin/MS09-056.mspx
_          _// were patched, we get CERT_RDN_ENCODED_BLOB_for a common name
_ __  __ _  // that contains a NULL_character.
 _     _   _case_CERT_RDN_ENCODED_BLOB:
     _     _  break;
  ___    _  // Array of 8-bit_characters.
  _      __ case CERT_RDN_PRINTABLE_STRING:
   __     __case_CERT_RDN_TELETEX_STRING:
    _     _ case CERT_RDN_IA5_STRING:
      _  _  case CERT_RDN_VISIBLE_STRING:
 ___         _for (DWORD_k = 0;_k < rdn_attr->Value.cbData; ++k) {
     _      _   if (rdn_attr->Value.pbData[k] == '\0')
    _       _     return true;
_   __      __}
__  _  _  _ _ break;
 _ _  __    // Array of 16-bit characters.
         _  case CERT_RDN_BMP_STRING:
  _    __  _case CERT_RDN_UTF8_STRING: {
 _       _    DWORD num