diff --git a/contracts/Constants.sol b/contracts/Constants.sol index d220789..276d411 100644 --- a/contracts/Constants.sol +++ b/contracts/Constants.sol @@ -33,20 +33,22 @@ library OIDs { // Decent OIDs // Root OIDs bytes32 constant OID_DECENT_EXT_VER = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e010000000000000000000000; + 0x2B0601040183E445010000000000000000000000000000000000000000000000; bytes32 constant OID_DECENT_PLATFORM_TYPE = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e020000000000000000000000; + 0x2B0601040183E445020000000000000000000000000000000000000000000000; bytes32 constant OID_DECENT_HASHED_KEYS = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e040000000000000000000000; + 0x2B0601040183E445040000000000000000000000000000000000000000000000; bytes32 constant OID_DECENT_APP_HASH = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e050000000000000000000000; + 0x2B0601040183E445050000000000000000000000000000000000000000000000; bytes32 constant OID_DECENT_AUTH_LIST = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e060000000000000000000000; + 0x2B0601040183E445060000000000000000000000000000000000000000000000; + bytes32 constant OID_DECENT_PLATFORM_ID = + 0x2B0601040183E445070000000000000000000000000000000000000000000000; // Platform specific OIDs bytes32 constant OID_DECENT_STD_REP_DATA = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e030101000000000000000000; + 0x2B0601040183E445030101000000000000000000000000000000000000000000; bytes32 constant OID_DECENT_ATTESTATION = - 0x6982f5c89a94ffdfaaab8591c1b5f7c2f782b01e030102000000000000000000; + 0x2B0601040183E445030102000000000000000000000000000000000000000000; } library Names { diff --git a/contracts/DecentServerCert.sol b/contracts/DecentServerCert.sol index b7b87d4..43549ad 100644 --- a/contracts/DecentServerCert.sol +++ b/contracts/DecentServerCert.sol @@ -270,12 +270,13 @@ library DecentServerCert { // extracting extensions X509Extension.ExtEntry[] memory extEntries = - new X509Extension.ExtEntry[](5); + new X509Extension.ExtEntry[](6); extEntries[0].extnID = OIDs.OID_DECENT_EXT_VER; extEntries[1].extnID = OIDs.OID_DECENT_PLATFORM_TYPE; extEntries[2].extnID = OIDs.OID_DECENT_HASHED_KEYS; extEntries[3].extnID = OIDs.OID_DECENT_STD_REP_DATA; extEntries[4].extnID = OIDs.OID_DECENT_ATTESTATION; + extEntries[5].extnID = OIDs.OID_DECENT_PLATFORM_ID; X509Extension.extractNeededExtensions( certDer, @@ -316,6 +317,10 @@ library DecentServerCert { require(false, "Unsupported platform"); } + // Platform ID + require(extEntries[5].isParsed, "Platform ID not found"); + cert.platformId = extEntries[5].extnValue.readBytes32(0); + // Decent server public key extractDecentServerKey(cert, certNodes, certDer, keyRing);