VirtualBox

Changeset 95634 in vbox


Ignore:
Timestamp:
Jul 14, 2022 2:09:59 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152278
Message:

IPRT/RTAsn1OctetString: Added RTAsn1OctetString_AllocContent and RTAsn1OctetString_SetContent. bugref:8691

Location:
trunk
Files:
3 edited

Legend:

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

    r95624 r95634  
    12251225RTASN1TYPE_STANDARD_PROTOTYPES(RTASN1OCTETSTRING, RTDECL, RTAsn1OctetString, Asn1Core);
    12261226
     1227RTDECL(int) RTAsn1OctetString_AllocContent(PRTASN1OCTETSTRING pThis, void const *pvSrc, size_t cb,
     1228                                           PCRTASN1ALLOCATORVTABLE pAllocator);
     1229RTDECL(int) RTAsn1OctetString_SetContent(PRTASN1OCTETSTRING pThis, void const *pvSrc, size_t cbSrc,
     1230                                         PCRTASN1ALLOCATORVTABLE pAllocator);
    12271231RTDECL(bool) RTAsn1OctetString_AreContentBytesValid(PCRTASN1OCTETSTRING pThis, uint32_t fFlags);
    12281232RTDECL(int) RTAsn1OctetString_RefreshContent(PRTASN1OCTETSTRING pThis, uint32_t fFlags,
  • trunk/include/iprt/mangling.h

    r95630 r95634  
    32373237# define RTAsn1SeqOfObjIds_DecodeAsn1                   RT_MANGLER(RTAsn1SeqOfObjIds_DecodeAsn1)
    32383238# define RTAsn1SetOfObjIds_DecodeAsn1                   RT_MANGLER(RTAsn1SetOfObjIds_DecodeAsn1)
     3239# define RTAsn1OctetString_AllocContent                 RT_MANGLER(RTAsn1OctetString_AllocContent)
     3240# define RTAsn1OctetString_SetContent                   RT_MANGLER(RTAsn1OctetString_AllocContent)
    32393241# define RTAsn1OctetString_CheckSanity                  RT_MANGLER(RTAsn1OctetString_CheckSanity)
    32403242# define RTAsn1OctetString_Clone                        RT_MANGLER(RTAsn1OctetString_Clone)
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp

    r93115 r95634  
    127127
    128128
     129RTDECL(int) RTAsn1OctetString_AllocContent(PRTASN1OCTETSTRING pThis, void const *pvSrc, size_t cb,
     130                                           PCRTASN1ALLOCATORVTABLE pAllocator)
     131{
     132    AssertReturn(!pThis->pEncapsulated, VERR_INVALID_STATE);
     133    int rc;
     134    if (pvSrc)
     135        rc = RTAsn1ContentDup(&pThis->Asn1Core, pvSrc, cb, pAllocator);
     136    else
     137        rc = RTAsn1ContentAllocZ(&pThis->Asn1Core, cb, pAllocator);
     138    return rc;
     139}
     140
     141
     142RTDECL(int) RTAsn1OctetString_SetContent(PRTASN1OCTETSTRING pThis, void const *pvSrc, size_t cbSrc,
     143                                         PCRTASN1ALLOCATORVTABLE pAllocator)
     144{
     145    AssertPtrReturn(pvSrc, VERR_INVALID_POINTER);
     146    return RTAsn1OctetString_AllocContent(pThis, pvSrc, cbSrc, pAllocator);
     147}
     148
     149
    129150RTDECL(bool) RTAsn1OctetString_AreContentBytesValid(PCRTASN1OCTETSTRING pThis, uint32_t fFlags)
    130151{
Note: See TracChangeset for help on using the changeset viewer.

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