VirtualBox

Ignore:
Timestamp:
Jul 13, 2022 9:31:20 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTAsn1,RTCrPkc7,RTCrSpc: Refactoring the RTASN1TMPL_MEMBER_DYN* logic to include the ObjectID member name and the value to compare with (when applicable). This should allow generating setters. bugref:8691

Location:
trunk/src/VBox/Runtime/common/crypto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/pkcs7-template.h

    r93115 r95629  
    5050RTASN1TMPL_BEGIN_SEQCORE();
    5151RTASN1TMPL_MEMBER(              Type,               RTASN1OBJID,                    RTAsn1ObjId);
    52 RTASN1TMPL_MEMBER_DYN_BEGIN(RTCRPKCS7ATTRIBUTETYPE, enmType, Allocation);
     52RTASN1TMPL_MEMBER_DYN_BEGIN(Type, RTCRPKCS7ATTRIBUTETYPE, enmType, Allocation);
    5353RTASN1TMPL_MEMBER_DYN(          uValues,    pOctetStrings,  RTASN1SETOFOCTETSTRINGS,    RTAsn1SetOfOctetStrings,    Allocation,
    54     enmType, RTCRPKCS7ATTRIBUTETYPE_OCTET_STRINGS,  RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_MESSAGE_DIGEST_OID) == 0);
     54    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_OCTET_STRINGS,        RTCR_PKCS9_ID_MESSAGE_DIGEST_OID);
    5555RTASN1TMPL_MEMBER_DYN(          uValues,    pObjIds,        RTASN1SETOFOBJIDS,          RTAsn1SetOfObjIds,          Allocation,
    56     enmType, RTCRPKCS7ATTRIBUTETYPE_OBJ_IDS,        RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_CONTENT_TYPE_OID) == 0);
     56    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_OBJ_IDS,              RTCR_PKCS9_ID_CONTENT_TYPE_OID);
    5757RTASN1TMPL_MEMBER_DYN(          uValues, pCounterSignatures, RTCRPKCS7SINGERINFOS,      RTCrPkcs7SignerInfos,       Allocation,
    58     enmType, RTCRPKCS7ATTRIBUTETYPE_COUNTER_SIGNATURES, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_COUNTER_SIGNATURE_OID) == 0);
     58    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_COUNTER_SIGNATURES,   RTCR_PKCS9_ID_COUNTER_SIGNATURE_OID);
    5959RTASN1TMPL_MEMBER_DYN(          uValues,    pSigningTime,   RTASN1SETOFTIMES,           RTAsn1SetOfTimes,           Allocation,
    60     enmType, RTCRPKCS7ATTRIBUTETYPE_SIGNING_TIME,   RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_SIGNING_TIME_OID) == 0);
     60    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_SIGNING_TIME,         RTCR_PKCS9_ID_SIGNING_TIME_OID);
    6161RTASN1TMPL_MEMBER_DYN(          uValues,    pContentInfos,  RTCRPKCS7SETOFCONTENTINFOS, RTCrPkcs7SetOfContentInfos, Allocation,
    62     enmType, RTCRPKCS7ATTRIBUTETYPE_MS_TIMESTAMP,   RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_MS_TIMESTAMP) == 0);
     62    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_MS_TIMESTAMP,         RTCR_PKCS9_ID_MS_TIMESTAMP);
    6363RTASN1TMPL_MEMBER_DYN(          uValues,    pContentInfos,  RTCRPKCS7SETOFCONTENTINFOS, RTCrPkcs7SetOfContentInfos, Allocation,
    64     enmType, RTCRPKCS7ATTRIBUTETYPE_MS_NESTED_SIGNATURE, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_MS_NESTED_SIGNATURE) == 0);
     64    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_MS_NESTED_SIGNATURE,  RTCR_PKCS9_ID_MS_NESTED_SIGNATURE);
    6565RTASN1TMPL_MEMBER_DYN(          uValues,    pObjIdSeqs,     RTASN1SETOFOBJIDSEQS,       RTAsn1SetOfObjIdSeqs,       Allocation,
    66     enmType, RTCRPKCS7ATTRIBUTETYPE_MS_STATEMENT_TYPE, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_MS_STATEMENT_TYPE) == 0);
     66    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_MS_STATEMENT_TYPE,    RTCR_PKCS9_ID_MS_STATEMENT_TYPE);
    6767RTASN1TMPL_MEMBER_DYN(          uValues,    pOctetStrings,  RTASN1SETOFOCTETSTRINGS,    RTAsn1SetOfOctetStrings,    Allocation,
    68     enmType, RTCRPKCS7ATTRIBUTETYPE_APPLE_MULTI_CD_PLIST,  RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_APPLE_MULTI_CD_PLIST) == 0);
     68    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_APPLE_MULTI_CD_PLIST, RTCR_PKCS9_ID_APPLE_MULTI_CD_PLIST);
    6969RTASN1TMPL_MEMBER_DYN_DEFAULT(  uValues,    pCores,         RTASN1SETOFCORES,           RTAsn1SetOfCores,           Allocation,
    70     enmType, RTCRPKCS7ATTRIBUTETYPE_UNKNOWN);
    71 RTASN1TMPL_MEMBER_DYN_END(RTCRPKCS7ATTRIBUTETYPE, enmType, Allocation);
     70    Type, enmType, RTCRPKCS7ATTRIBUTETYPE_UNKNOWN);
     71RTASN1TMPL_MEMBER_DYN_END(Type, RTCRPKCS7ATTRIBUTETYPE, enmType, Allocation);
    7272RTASN1TMPL_END_SEQCORE();
    7373#undef RTASN1TMPL_TYPE
  • trunk/src/VBox/Runtime/common/crypto/spc-template.h

    r93115 r95629  
    5252RTASN1TMPL_BEGIN_SEQCORE();
    5353RTASN1TMPL_MEMBER(              Type,               RTASN1OBJID,                    RTAsn1ObjId);
    54 RTASN1TMPL_MEMBER_DYN_BEGIN(    RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE, enmType, Allocation);
    55 RTASN1TMPL_MEMBER_DYN(          u, pPageHashes, RTCRSPCSERIALIZEDPAGEHASHES, RTCrSpcSerializedPageHashes, Allocation, enmType,
    56     RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCRSPC_PE_IMAGE_HASHES_V1_OID) == 0);
    57 RTASN1TMPL_MEMBER_DYN(          u, pPageHashes, RTCRSPCSERIALIZEDPAGEHASHES, RTCrSpcSerializedPageHashes, Allocation, enmType,
    58     RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCRSPC_PE_IMAGE_HASHES_V2_OID) == 0);
    59 RTASN1TMPL_MEMBER_DYN_DEFAULT(  u, pCore, RTASN1CORE, RTAsn1Core, Allocation, enmType, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN);
    60 RTASN1TMPL_MEMBER_DYN_END(      RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE, enmType, Allocation);
     54RTASN1TMPL_MEMBER_DYN_BEGIN(    Type, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE, enmType, Allocation);
     55RTASN1TMPL_MEMBER_DYN(          u, pPageHashes, RTCRSPCSERIALIZEDPAGEHASHES, RTCrSpcSerializedPageHashes, Allocation,
     56    Type, enmType, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1, RTCRSPC_PE_IMAGE_HASHES_V1_OID);
     57RTASN1TMPL_MEMBER_DYN(          u, pPageHashes, RTCRSPCSERIALIZEDPAGEHASHES, RTCrSpcSerializedPageHashes, Allocation,
     58    Type, enmType, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2, RTCRSPC_PE_IMAGE_HASHES_V2_OID);
     59RTASN1TMPL_MEMBER_DYN_DEFAULT(  u, pCore, RTASN1CORE, RTAsn1Core, Allocation,
     60    Type, enmType, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN);
     61RTASN1TMPL_MEMBER_DYN_END(      Type, RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE, enmType, Allocation);
    6162RTASN1TMPL_END_SEQCORE();
    6263#undef RTASN1TMPL_TYPE
     
    160161RTASN1TMPL_BEGIN_SEQCORE();
    161162RTASN1TMPL_MEMBER(              Type,               RTASN1OBJID,                    RTAsn1ObjId);
    162 RTASN1TMPL_MEMBER_DYN_BEGIN(    RTCRSPCAAOVTYPE, enmType, Allocation);
    163 RTASN1TMPL_MEMBER_DYN(          uValue, pPeImage, RTCRSPCPEIMAGEDATA, RTCrSpcPeImageData, Allocation, enmType,
    164     RTCRSPCAAOVTYPE_PE_IMAGE_DATA, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCRSPCPEIMAGEDATA_OID) == 0);
    165 RTASN1TMPL_MEMBER_DYN_DEFAULT(  uValue, pCore,    RTASN1CORE,         RTAsn1Core, Allocation, enmType, RTCRSPCAAOVTYPE_UNKNOWN);
    166 RTASN1TMPL_MEMBER_DYN_END(      RTCRSPCAAOVTYPE, enmType, Allocation);
     163RTASN1TMPL_MEMBER_DYN_BEGIN(    Type, RTCRSPCAAOVTYPE, enmType, Allocation);
     164RTASN1TMPL_MEMBER_DYN(          uValue, pPeImage, RTCRSPCPEIMAGEDATA, RTCrSpcPeImageData, Allocation,
     165    Type, enmType, RTCRSPCAAOVTYPE_PE_IMAGE_DATA, RTCRSPCPEIMAGEDATA_OID);
     166RTASN1TMPL_MEMBER_DYN_DEFAULT(  uValue, pCore,    RTASN1CORE,         RTAsn1Core, Allocation,
     167    Type, enmType, RTCRSPCAAOVTYPE_UNKNOWN);
     168RTASN1TMPL_MEMBER_DYN_END(      Type, RTCRSPCAAOVTYPE, enmType, Allocation);
    167169RTASN1TMPL_END_SEQCORE();
    168170#undef RTASN1TMPL_TYPE
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