VirtualBox

Changeset 64864 in vbox


Ignore:
Timestamp:
Dec 14, 2016 1:38:16 PM (8 years ago)
Author:
vboxsync
Message:

IPRT: Added set-of-object-id-sequences and RTCrDigestTypeToHashSize.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asn1.h

    r64820 r64864  
    187187RTDECL(PRTASN1ALLOCATION) RTAsn1MemInitAllocation(PRTASN1ALLOCATION pAllocation, PCRTASN1ALLOCATORVTABLE pAllocator);
    188188
     189/** Pointer to a core ASN.1 encoding info structure. */
     190typedef struct RTASN1CORE *PRTASN1CORE;
     191/** Pointer to a const core ASN.1 encoding info structure. */
     192typedef struct RTASN1CORE const *PCRTASN1CORE;
     193
    189194RTDECL(int)  RTAsn1ContentAllocZ(struct RTASN1CORE *pAsn1Core, size_t cb, PCRTASN1ALLOCATORVTABLE pAllocator);
    190195RTDECL(int)  RTAsn1ContentDup(struct RTASN1CORE *pAsn1Core, void const *pvSrc, size_t cbSrc, PCRTASN1ALLOCATORVTABLE pAllocator);
     
    192197RTDECL(void) RTAsn1ContentFree(struct RTASN1CORE *pAsn1Core);
    193198
    194 
    195 
    196 /** Pointer to a core ASN.1 encoding info structure. */
    197 typedef struct RTASN1CORE *PRTASN1CORE;
    198 /** Pointer to a const core ASN.1 encoding info structure. */
    199 typedef struct RTASN1CORE const *PCRTASN1CORE;
    200199
    201200
     
    10011000RTASN1_IMPL_GEN_SEQ_OF_TYPEDEFS_AND_PROTOS(RTASN1SEQOFOBJIDS, RTASN1OBJID, RTDECL, RTAsn1SeqOfObjIds);
    10021001RTASN1_IMPL_GEN_SET_OF_TYPEDEFS_AND_PROTOS(RTASN1SETOFOBJIDS, RTASN1OBJID, RTDECL, RTAsn1SetOfObjIds);
     1002RTASN1_IMPL_GEN_SET_OF_TYPEDEFS_AND_PROTOS(RTASN1SETOFOBJIDSEQS, RTASN1SEQOFOBJIDS, RTDECL, RTAsn1SetOfObjIdSeqs);
    10031003
    10041004
     
    10641064    /** Core ASN.1 encoding details. */
    10651065    RTASN1CORE          Asn1Core;
    1066     /** Pointer to user structure encapsulated in this string, if dynamically
    1067      * allocated the EncapsulatedAllocation member can be used to track it and
    1068      * trigger automatic cleanup on object destruction.  If EncapsulatedAllocation
    1069      * is zero, any object pointed to will only be deleted. */
     1066    /** Pointer to user structure encapsulated in this string.
     1067     *
     1068     * If dynamically allocated the EncapsulatedAllocation member can be used to
     1069     * track it and trigger automatic cleanup on object destruction.  If
     1070     * EncapsulatedAllocation is zero, any object pointed to will only be
     1071     * deleted. */
    10701072    PRTASN1CORE         pEncapsulated;
    10711073    /** Allocation tracking structure for pEncapsulated. */
  • trunk/include/iprt/crypto/digest.h

    r64817 r64864  
    216216RTDECL(const char *) RTCrDigestTypeToName(RTDIGESTTYPE enmDigestType);
    217217
     218/**
     219 * Translates an IPRT digest type value to a hash size.
     220 *
     221 * @returns Hash size (in bytes).
     222 * @param       enmDigestType       The IPRT digest type value to convert.
     223 */
     224RTDECL(uint32_t) RTCrDigestTypeToHashSize(RTDIGESTTYPE enmDigestType);
     225
    218226/** @} */
    219227
  • trunk/include/iprt/mangling.h

    r64817 r64864  
    25912591# define RTAsn1SetOfObjIds_Enum                         RT_MANGLER(RTAsn1SetOfObjIds_Enum)
    25922592# define RTAsn1SetOfObjIds_Init                         RT_MANGLER(RTAsn1SetOfObjIds_Init)
     2593# define RTAsn1SeqOfObjIdSeqs_CheckSanity               RT_MANGLER(RTAsn1SeqOfObjIdSeqs_CheckSanity)
     2594# define RTAsn1SeqOfObjIdSeqs_Clone                     RT_MANGLER(RTAsn1SeqOfObjIdSeqs_Clone)
     2595# define RTAsn1SeqOfObjIdSeqs_Compare                   RT_MANGLER(RTAsn1SeqOfObjIdSeqs_Compare)
     2596# define RTAsn1SeqOfObjIdSeqs_Delete                    RT_MANGLER(RTAsn1SeqOfObjIdSeqs_Delete)
     2597# define RTAsn1SeqOfObjIdSeqs_Enum                      RT_MANGLER(RTAsn1SeqOfObjIdSeqs_Enum)
     2598# define RTAsn1SeqOfObjIdSeqs_Init                      RT_MANGLER(RTAsn1SeqOfObjIdSeqs_Init)
     2599# define RTAsn1SetOfObjIdSeqs_CheckSanity               RT_MANGLER(RTAsn1SetOfObjIdSeqs_CheckSanity)
     2600# define RTAsn1SetOfObjIdSeqs_Clone                     RT_MANGLER(RTAsn1SetOfObjIdSeqs_Clone)
     2601# define RTAsn1SetOfObjIdSeqs_Compare                   RT_MANGLER(RTAsn1SetOfObjIdSeqs_Compare)
     2602# define RTAsn1SetOfObjIdSeqs_Delete                    RT_MANGLER(RTAsn1SetOfObjIdSeqs_Delete)
     2603# define RTAsn1SetOfObjIdSeqs_Enum                      RT_MANGLER(RTAsn1SetOfObjIdSeqs_Enum)
     2604# define RTAsn1SetOfObjIdSeqs_Init                      RT_MANGLER(RTAsn1SetOfObjIdSeqs_Init)
    25932605# define RTAsn1ObjId_DecodeAsn1                         RT_MANGLER(RTAsn1ObjId_DecodeAsn1)
    25942606# define RTAsn1SeqOfObjIds_DecodeAsn1                   RT_MANGLER(RTAsn1SeqOfObjIds_DecodeAsn1)
     
    27782790# define RTCrDigestTypeToAlgorithmOid                   RT_MANGLER(RTCrDigestTypeToAlgorithmOid)
    27792791# define RTCrDigestTypeToName                           RT_MANGLER(RTCrDigestTypeToName)
     2792# define RTCrDigestTypeToHashSize                       RT_MANGLER(RTCrDigestTypeToHashSize)
    27802793# define RTCrRsaDigestInfo_DecodeAsn1                   RT_MANGLER(RTCrRsaDigestInfo_DecodeAsn1)
    27812794# define RTCrRsaOtherPrimeInfo_DecodeAsn1               RT_MANGLER(RTCrRsaOtherPrimeInfo_DecodeAsn1)
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-objid-template.h

    r62477 r64864  
    4444#undef RTASN1TMPL_INT_NAME
    4545
     46
     47#define RTASN1TMPL_TYPE         RTASN1SETOFOBJIDSEQS
     48#define RTASN1TMPL_EXT_NAME     RTAsn1SetOfObjIdSeqs
     49#define RTASN1TMPL_INT_NAME     rtAsn1SetOfObjIdSeqs
     50RTASN1TMPL_SET_OF(RTASN1SEQOFOBJIDS, RTAsn1SeqOfObjIds);
     51#undef RTASN1TMPL_TYPE
     52#undef RTASN1TMPL_EXT_NAME
     53#undef RTASN1TMPL_INT_NAME
     54
  • trunk/src/VBox/Runtime/common/crypto/digest-core.cpp

    r64817 r64864  
    419419}
    420420
     421
     422RTDECL(uint32_t) RTCrDigestTypeToHashSize(RTDIGESTTYPE enmDigestType)
     423{
     424    switch (enmDigestType)
     425    {
     426        case RTDIGESTTYPE_CRC32:        return  32 / 8;
     427        case RTDIGESTTYPE_CRC64:        return  64 / 8;
     428        case RTDIGESTTYPE_MD2:          return 128 / 8;
     429        case RTDIGESTTYPE_MD4:          return 128 / 8;
     430        case RTDIGESTTYPE_MD5:          return 128 / 8;
     431        case RTDIGESTTYPE_SHA1:         return 160 / 8;
     432        case RTDIGESTTYPE_SHA224:       return 224 / 8;
     433        case RTDIGESTTYPE_SHA256:       return 256 / 8;
     434        case RTDIGESTTYPE_SHA384:       return 384 / 8;
     435        case RTDIGESTTYPE_SHA512:       return 512 / 8;
     436        case RTDIGESTTYPE_SHA512T224:   return 224 / 8;
     437        case RTDIGESTTYPE_SHA512T256:   return 256 / 8;
     438        default:
     439            AssertFailed();
     440            return 0;
     441    }
     442}
     443
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