VirtualBox

Changeset 89018 in vbox for trunk


Ignore:
Timestamp:
May 12, 2021 4:28:56 PM (4 years ago)
Author:
vboxsync
Message:

SUPDev,IPRT: On darwin allow Mac dev certs as long as it is a build using test signing. bugref:10004

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/crypto/applecodesign.h

    r85121 r89018  
    3939 */
    4040
     41/** Apple developer ID for iPhone application software development signing. */
     42#define RTCR_APPLE_CS_DEVID_IPHONE_SW_DEV_OID           "1.2.840.113635.100.6.1.2"
     43/** Apple developer ID for Mac application software development signing. */
     44#define RTCR_APPLE_CS_DEVID_MAC_SW_DEV_OID              "1.2.840.113635.100.6.1.12"
    4145/** Apple developer ID for application signing. */
    4246#define RTCR_APPLE_CS_DEVID_APPLICATION_OID             "1.2.840.113635.100.6.1.13"
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r88587 r89018  
    635635 if defined(VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION) && defined(VBOX_SIGNING_MODE)
    636636  VBoxDrv_DEFS.darwin    += VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION
     637  ifeq ($(VBOX_SIGNING_MODE),test)
     638   VBoxDrv_DEFS.darwin   += VBOX_WITH_DARWIN_R0_TEST_SIGN
     639  endif
    637640 endif
    638641 ifdef VBOX_WITH_NETFLT
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r87700 r89018  
    13201320        uint32_t cDevIdApp  = 0;
    13211321        uint32_t cDevIdKext = 0;
     1322        uint32_t cDevIdMacDev = 0;
    13221323        for (uint32_t i = 0; i < pCert->TbsCertificate.T3.Extensions.cItems; i++)
    13231324        {
     
    13371338                                       "Dev ID kext certificate extension is not flagged critical");
    13381339            }
    1339         }
     1340            else if (RTAsn1ObjId_CompareWithString(&pExt->ExtnId, RTCR_APPLE_CS_DEVID_MAC_SW_DEV_OID) == 0)
     1341            {
     1342                cDevIdMacDev++;
     1343                if (!pExt->Critical.fValue)
     1344                    rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
     1345                                       "Dev ID MAC SW dev certificate extension is not flagged critical");
     1346            }
     1347        }
     1348# ifdef VBOX_WITH_DARWIN_R0_TEST_SIGN
     1349        /*
     1350         * Mac application software development certs do not have the usually required extensions.
     1351         */
     1352        if (cDevIdMacDev)
     1353        {
     1354            cDevIdApp++;
     1355            cDevIdKext++;
     1356        }
     1357# endif
    13401358        if (cDevIdApp == 0)
    13411359            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
  • trunk/src/VBox/Runtime/common/crypto/x509-certpaths.cpp

    r84670 r89018  
    25832583                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_INSTALLER_OID) != 0
    25842584                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_KEXT_OID) != 0
     2585                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_IPHONE_SW_DEV_OID) != 0
     2586                && RTAsn1ObjId_CompareWithString(&pCur->ExtnId, RTCR_APPLE_CS_DEVID_MAC_SW_DEV_OID) != 0
    25852587               )
    25862588                return rtCrX509CpvFailed(pThis, VERR_CR_X509_CPV_UNKNOWN_CRITICAL_EXTENSION,
  • trunk/src/VBox/Runtime/tools/RTSignTool.cpp

    r88588 r89018  
    13721372        else if (pState->enmSignType == VERIFYEXESTATE::kSignType_OSX)
    13731373        {
    1374             uint32_t cDevIdApp  = 0;
    1375             uint32_t cDevIdKext = 0;
     1374            uint32_t cDevIdApp    = 0;
     1375            uint32_t cDevIdKext   = 0;
     1376            uint32_t cDevIdMacDev = 0;
    13761377            for (uint32_t i = 0; i < pCert->TbsCertificate.T3.Extensions.cItems; i++)
    13771378            {
     
    13911392                                           "Dev ID kext certificate extension is not flagged critical");
    13921393                }
     1394                else if (RTAsn1ObjId_CompareWithString(&pExt->ExtnId, RTCR_APPLE_CS_DEVID_MAC_SW_DEV_OID) == 0)
     1395                {
     1396                    cDevIdMacDev++;
     1397                    if (!pExt->Critical.fValue)
     1398                        rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
     1399                                           "Dev ID Mac SW dev certificate extension is not flagged critical");
     1400                }
    13931401            }
    13941402            if (cDevIdApp == 0)
    1395                 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
    1396                                    "Certificate is missing the 'Dev ID Application' extension");
     1403            {
     1404                if (cDevIdMacDev == 0)
     1405                    rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
     1406                                       "Certificate is missing the 'Dev ID Application' extension");
     1407                else
     1408                    RTMsgWarning("Mac SW dev certificate used to sign code.");
     1409            }
    13971410            if (cDevIdKext == 0 && pState->fKernel)
    1398                 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
    1399                                    "Certificate is missing the 'Dev ID kext' extension");
     1411            {
     1412                if (cDevIdMacDev == 0)
     1413                    rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE,
     1414                                       "Certificate is missing the 'Dev ID kext' extension");
     1415                else
     1416                    RTMsgWarning("Mac SW dev certificate used to sign kernel code.");
     1417            }
    14001418        }
    14011419    }
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