VirtualBox

Changeset 91982 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2021 8:43:38 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTCrX509CertPaths: Only ignore critical subject key IDs on end entities. Extended comment. Logging. bugref:10130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/x509-certpaths.cpp

    r91979 r91982  
    685685        pNew->uDepth   = pParent->uDepth + 1;
    686686        RTListAppend(&pParent->ChildListOrLeafEntry, &pNew->SiblingEntry);
     687        Log2Func(("pNew=%p uSrc=%u uDepth=%u\n", pNew, uSrc, pNew->uDepth));
    687688    }
    688689    else
     
    725726
    726727    PCRTCRX509NAME const pIssuer = &pNode->pCert->TbsCertificate.Issuer;
     728#if defined(LOG_ENABLED) && defined(IN_RING3)
     729    if (LogIs2Enabled())
     730    {
     731        char szIssuer[128] = {0};
     732        RTCrX509Name_FormatAsString(pIssuer, szIssuer, sizeof(szIssuer), NULL);
     733        char szSubject[128] = {0};
     734        RTCrX509Name_FormatAsString(&pNode->pCert->TbsCertificate.Subject, szSubject, sizeof(szSubject), NULL);
     735        Log2Func(("pNode=%p uSrc=%u uDepth=%u Issuer='%s' (Subject='%s')\n", pNode, pNode->uSrc, pNode->uDepth, szIssuer, szSubject));
     736    }
     737#endif
    727738
    728739    /*
     
    25852596                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_IPHONE_SW_DEV_OID) != 0
    25862597                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_MAC_SW_DEV_OID) != 0
    2587                 && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCRX509_ID_CE_SUBJECT_KEY_IDENTIFIER_OID) != 0     /* Occurred in an Intel cert. Violates RFC5280. */
    25882598               )
    2589                 return rtCrX509CpvFailed(pThis, VERR_CR_X509_CPV_UNKNOWN_CRITICAL_EXTENSION,
    2590                                          "Node #%u has an unknown critical extension: %s", pThis->v.iNode, pCur->ExtnId.szObjId);
     2599            {
     2600                /* @bugref{10130}: An IntelGraphicsPE2021 cert issued by iKG_AZSKGFDCS has a critical subjectKeyIdentifier
     2601                                   which we quietly ignore here. RFC-5280 conforming CAs should not mark this as critical.
     2602                                   On an end entity this extension can have relevance to path construction. */
     2603                if (   pNode->uSrc == RTCRX509CERTPATHNODE_SRC_TARGET
     2604                    && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCRX509_ID_CE_SUBJECT_KEY_IDENTIFIER_OID) == 0)
     2605                    LogFunc(("Ignoring non-standard subjectKeyIdentifier on target certificate.\n"));
     2606                else
     2607                    return rtCrX509CpvFailed(pThis, VERR_CR_X509_CPV_UNKNOWN_CRITICAL_EXTENSION,
     2608                                             "Node #%u has an unknown critical extension: %s",
     2609                                             pThis->v.iNode, pCur->ExtnId.szObjId);
     2610            }
    25912611        }
    25922612
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette