VirtualBox

Changeset 59665 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Feb 14, 2016 11:57:30 PM (9 years ago)
Author:
vboxsync
Message:

iprt/asn1: Fixed bug represnation of explicit tags that caused trouble doing encoding by piggypacking on the enumeration method. Added simple X.509 testcase.

Location:
trunk/src/VBox/Runtime/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asn1/asn1-basics.cpp

    r57926 r59665  
    576576 */
    577577
    578 RTDECL(int) RTAsn1ContextTagN_Init(PRTASN1CONTEXTTAG pThis, uint32_t uTag)
     578RTDECL(int) RTAsn1ContextTagN_Init(PRTASN1CONTEXTTAG pThis, uint32_t uTag, PCRTASN1COREVTABLE pVtable)
    579579{
    580580    return RTAsn1Core_InitEx(&pThis->Asn1Core,
    581581                             uTag,
    582582                             ASN1_TAGCLASS_CONTEXT | ASN1_TAGFLAG_CONSTRUCTED,
    583                              NULL,
     583                             pVtable,
    584584                             RTASN1CORE_F_PRESENT);
    585585}
  • trunk/src/VBox/Runtime/common/asn1/asn1-cursor.cpp

    r57358 r59665  
    415415
    416416RTDECL(int) RTAsn1CursorGetContextTagNCursor(PRTASN1CURSOR pCursor, uint32_t fFlags, uint32_t uExpectedTag,
    417                                              PRTASN1CONTEXTTAG pCtxTag, PRTASN1CURSOR pCtxTagCursor, const char *pszErrorTag)
    418 {
    419     return rtAsn1CursorGetXxxxCursor(pCursor, fFlags, uExpectedTag, ASN1_TAGCLASS_CONTEXT | ASN1_TAGFLAG_CONSTRUCTED,
    420                                      &pCtxTag->Asn1Core, pCtxTagCursor, pszErrorTag, "ctx tag");
     417                                             PCRTASN1COREVTABLE pVtable, PRTASN1CONTEXTTAG pCtxTag, PRTASN1CURSOR pCtxTagCursor,
     418                                             const char *pszErrorTag)
     419{
     420    int rc = rtAsn1CursorGetXxxxCursor(pCursor, fFlags, uExpectedTag, ASN1_TAGCLASS_CONTEXT | ASN1_TAGFLAG_CONSTRUCTED,
     421                                       &pCtxTag->Asn1Core, pCtxTagCursor, pszErrorTag, "ctx tag");
     422    pCtxTag->Asn1Core.pOps = pVtable;
     423    return rc;
    421424}
    422425
  • trunk/src/VBox/Runtime/common/crypto/x509-file.cpp

    r59625 r59665  
    7070            if (RT_SUCCESS(rc))
    7171            {
    72                 rc = RTCrX509Certificate_Clone(pCertificate, &TmpCert, &g_RTAsn1DefaultAllocator);
     72                rc = RTCrX509Certificate_Clone(pCertificate, &TmpCert, pAllocator);
    7373                if (RT_SUCCESS(rc))
    7474                {
     
    105105            if (RT_SUCCESS(rc))
    106106            {
    107                 rc = RTCrX509Certificate_Clone(pCertificate, &TmpCert, &g_RTAsn1DefaultAllocator);
     107                rc = RTCrX509Certificate_Clone(pCertificate, &TmpCert, pAllocator);
    108108                if (RT_SUCCESS(rc))
    109109                {
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