Changeset 62564 in vbox for trunk/src/VBox/Runtime/common/asn1
- Timestamp:
- Jul 26, 2016 2:43:03 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109133
- Location:
- trunk/src/VBox/Runtime/common/asn1
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asn1/asn1-basics.cpp
r62477 r62564 588 588 RTDECL(int) RTAsn1ContextTagN_Clone(PRTASN1CONTEXTTAG pThis, PCRTASN1CONTEXTTAG pSrc, uint32_t uTag) 589 589 { 590 Assert(pSrc->Asn1Core.uTag == uTag || !RTASN1CORE_IS_PRESENT(&pSrc->Asn1Core)); 590 Assert(pSrc->Asn1Core.uTag == uTag || !RTASN1CORE_IS_PRESENT(&pSrc->Asn1Core)); RT_NOREF_PV(uTag); 591 591 return RTAsn1Core_CloneNoContent(&pThis->Asn1Core, &pSrc->Asn1Core); 592 592 } -
trunk/src/VBox/Runtime/common/asn1/asn1-default-allocator.cpp
r62477 r62564 58 58 static DECLCALLBACK(void) rtAsn1DefaultAllocator_Free(PCRTASN1ALLOCATORVTABLE pThis, PRTASN1ALLOCATION pAllocation, void *pv) 59 59 { 60 RT_NOREF_PV(pThis); 60 61 RTMemFree(pv); 61 62 pAllocation->cbAllocated = 0; … … 75 76 return VINF_SUCCESS; 76 77 } 78 RT_NOREF_PV(pThis); 77 79 return VERR_NO_MEMORY; 78 80 } … … 93 95 return VINF_SUCCESS; 94 96 } 97 RT_NOREF_PV(pThis); 95 98 return VERR_NO_MEMORY; 96 99 } -
trunk/src/VBox/Runtime/common/asn1/asn1-efence-allocator.cpp
r62477 r62564 40 40 static DECLCALLBACK(void) rtAsn1EFenceAllocator_Free(PCRTASN1ALLOCATORVTABLE pThis, PRTASN1ALLOCATION pAllocation, void *pv) 41 41 { 42 RT_NOREF_PV(pThis); 42 43 RTMemEfFreeNP(pv); 43 44 pAllocation->cbAllocated = 0; … … 56 57 return VINF_SUCCESS; 57 58 } 59 RT_NOREF_PV(pThis); 58 60 return VERR_NO_MEMORY; 59 61 } … … 73 75 return VINF_SUCCESS; 74 76 } 77 RT_NOREF_PV(pThis); 75 78 return VERR_NO_MEMORY; 76 79 } -
trunk/src/VBox/Runtime/common/asn1/asn1-encode.cpp
r62477 r62564 167 167 { 168 168 RTASN1ENCODEPREPARGS *pArgs = (RTASN1ENCODEPREPARGS *)pvUser; 169 RT_NOREF_PV(pszName); 169 170 if (RTASN1CORE_IS_PRESENT(pAsn1Core)) 170 171 { … … 376 377 { 377 378 RTASN1ENCODEWRITEARGS *pArgs = (RTASN1ENCODEWRITEARGS *)pvUser; 379 RT_NOREF_PV(pszName); 378 380 int rc; 379 381 if (RTASN1CORE_IS_PRESENT(pAsn1Core)) … … 460 462 pArgs->cbDst = 0; 461 463 } 464 RT_NOREF_PV(pErrInfo); 462 465 return VERR_BUFFER_OVERFLOW; 463 466 } -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
r62477 r62564 82 82 return VERR_NOT_EQUAL; 83 83 pCtx->offBuf += (uint32_t)cbToWrite; 84 RT_NOREF_PV(pErrInfo); 84 85 return VINF_SUCCESS; 85 86 } -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp
r62477 r62564 54 54 RTDECL(int) RTAsn1Boolean_InitDefault(PRTASN1BOOLEAN pThis, bool fValue, PCRTASN1ALLOCATORVTABLE pAllocator) 55 55 { 56 RT_NOREF_PV(pAllocator); 56 57 RTAsn1Core_InitEx(&pThis->Asn1Core, ASN1_TAG_BOOLEAN, ASN1_TAGCLASS_UNIVERSAL | ASN1_TAGFLAG_PRIMITIVE, 57 58 &g_RTAsn1Boolean_Vtable, RTASN1CORE_F_DEFAULT | RTASN1CORE_F_PRIMITE_TAG_STRUCT); … … 102 103 RTDECL(int) RTAsn1Boolean_Init(PRTASN1BOOLEAN pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 103 104 { 105 RT_NOREF_PV(pAllocator); 104 106 RTAsn1Core_InitEx(&pThis->Asn1Core, ASN1_TAG_BOOLEAN, ASN1_TAGCLASS_UNIVERSAL | ASN1_TAGFLAG_PRIMITIVE, 105 107 &g_RTAsn1Boolean_Vtable, RTASN1CORE_F_PRESENT | RTASN1CORE_F_PRIMITE_TAG_STRUCT); … … 161 163 { 162 164 Assert(pThis && (!RTAsn1Boolean_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1Boolean_Vtable)); 165 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 163 166 164 167 /* No children to enumerate. */ … … 190 193 if (RT_UNLIKELY(!RTAsn1Boolean_IsPresent(pThis))) 191 194 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (BOOLEAN).", pszErrorTag); 195 RT_NOREF_PV(fFlags); 192 196 return VINF_SUCCESS; 193 197 } -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp
r62477 r62564 45 45 return VINF_SUCCESS; 46 46 } 47 RT_NOREF_PV(fFlags); 47 48 RT_ZERO(*pThis); 48 49 return rc; -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp
r62477 r62564 206 206 RTDECL(int) RTAsn1Core_Init(PRTASN1CORE pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 207 207 { 208 RT_NOREF_PV(pAllocator); 208 209 return RTAsn1Core_InitEx(pThis, 0, ASN1_TAGCLASS_CONTEXT | ASN1_TAGFLAG_PRIMITIVE, 209 210 &g_RTAsn1Core_Vtable, RTASN1CORE_F_PRESENT); … … 262 263 RTDECL(int) RTAsn1Core_CheckSanity(PCRTASN1CORE pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 263 264 { 265 RT_NOREF_PV(fFlags); 266 264 267 /* We can only check that it's present. */ 265 268 if (!RTAsn1Core_IsPresent(pThis)) -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp
r62477 r62564 43 43 RT_ZERO(*pDynType); 44 44 45 Assert(!(fFlags & RTASN1CURSOR_GET_F_IMPLICIT)); 45 Assert(!(fFlags & RTASN1CURSOR_GET_F_IMPLICIT)); RT_NOREF_PV(fFlags); 46 46 uint32_t cbSavedLeft = pCursor->cbLeft; 47 47 uint8_t const *pbSavedCur = pCursor->pbCur; -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp
r62477 r62564 45 45 RTDECL(int) RTAsn1DynType_Init(PRTASN1DYNTYPE pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 46 46 { 47 RT_NOREF_PV(pAllocator); 47 48 RT_ZERO(*pThis); 48 49 pThis->enmType = RTASN1TYPE_NOT_PRESENT; -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp
r60030 r62564 403 403 RTDECL(int) RTAsn1Integer_Init(PRTASN1INTEGER pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 404 404 { 405 RT_NOREF_PV(pAllocator); 405 406 RTAsn1Core_InitEx(&pThis->Asn1Core, 406 407 ASN1_TAG_INTEGER, … … 462 463 RTDECL(int) RTAsn1Integer_Enum(PRTASN1INTEGER pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) 463 464 { 465 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 464 466 Assert(pThis && (!RTAsn1Integer_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1Integer_Vtable)); 465 467 … … 477 479 RTDECL(int) RTAsn1Integer_CheckSanity(PCRTASN1INTEGER pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 478 480 { 481 RT_NOREF_PV(fFlags); 479 482 if (RT_UNLIKELY(!RTAsn1Integer_IsPresent(pThis))) 480 483 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (INTEGER).", pszErrorTag); -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-null.cpp
r62477 r62564 67 67 RTDECL(int) RTAsn1Null_Init(PRTASN1NULL pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 68 68 { 69 RT_NOREF_PV(pAllocator); 69 70 return RTAsn1Core_InitEx(&pThis->Asn1Core, ASN1_TAG_NULL, ASN1_TAGCLASS_UNIVERSAL | ASN1_TAGFLAG_PRIMITIVE, 70 71 &g_RTAsn1Null_Vtable, RTASN1CORE_F_PRESENT | RTASN1CORE_F_PRIMITE_TAG_STRUCT); … … 74 75 RTDECL(int) RTAsn1Null_Clone(PRTASN1NULL pThis, PCRTASN1NULL pSrc, PCRTASN1ALLOCATORVTABLE pAllocator) 75 76 { 76 AssertPtr(pSrc); AssertPtr(pThis); AssertPtr(pAllocator); 77 AssertPtr(pSrc); AssertPtr(pThis); AssertPtr(pAllocator); RT_NOREF_PV(pAllocator); 77 78 RT_ZERO(*pThis); 78 79 if (RTAsn1Null_IsPresent(pSrc)) … … 102 103 RTDECL(int) RTAsn1Null_Enum(PRTASN1NULL pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) 103 104 { 105 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 104 106 Assert(pThis && (!RTAsn1Null_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1Null_Vtable)); 105 107 … … 120 122 RTDECL(int) RTAsn1Null_CheckSanity(PCRTASN1NULL pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 121 123 { 124 RT_NOREF_PV(fFlags); 122 125 if (RT_UNLIKELY(!RTAsn1Null_IsPresent(pThis))) 123 126 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (NULL).", pszErrorTag); -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp
r62477 r62564 233 233 } 234 234 return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_OBJID_TOO_LONG_STRING_FORM, 235 " Object ID has a too long string form: %#x (max %#x)",236 cchObjId, RT_SIZEOFMEMB(RTASN1OBJID, szObjId));235 "%s: Object ID has a too long string form: %#x (max %#x)", 236 pszErrorTag, cchObjId, RT_SIZEOFMEMB(RTASN1OBJID, szObjId)); 237 237 } 238 238 return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_OBJID_TOO_MANY_COMPONENTS, 239 " Object ID has too many components: %#x (max 127)", cComponents);239 "%s: Object ID has too many components: %#x (max 127)", pszErrorTag, cComponents); 240 240 } 241 241 … … 244 244 } while (rc > 0); 245 245 } 246 rc = RTAsn1CursorSetInfo(pCursor, rc, " Bad object ID component #%u encoding: %.*Rhxs",247 cComponents, cbContent, pbContent);246 rc = RTAsn1CursorSetInfo(pCursor, rc, "%s: Bad object ID component #%u encoding: %.*Rhxs", 247 pszErrorTag, cComponents, cbContent, pbContent); 248 248 } 249 249 else if (cbContent) 250 rc = RTAsn1CursorSetInfo(pCursor, VERR_ASN1_INVALID_OBJID_ENCODING, "Object ID content is loo long: %#x", cbContent); 250 rc = RTAsn1CursorSetInfo(pCursor, VERR_ASN1_INVALID_OBJID_ENCODING, "%s: Object ID content is loo long: %#x", 251 pszErrorTag, cbContent); 251 252 else 252 rc = RTAsn1CursorSetInfo(pCursor, VERR_ASN1_INVALID_OBJID_ENCODING, " Zero length object ID content");253 rc = RTAsn1CursorSetInfo(pCursor, VERR_ASN1_INVALID_OBJID_ENCODING, "%s: Zero length object ID content", pszErrorTag); 253 254 return rc; 254 255 } -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp
r62477 r62564 395 395 RTDECL(int) RTAsn1ObjId_Init(PRTASN1OBJID pThis, PCRTASN1ALLOCATORVTABLE pAllocator) 396 396 { 397 RT_NOREF_PV(pAllocator); 397 398 RTAsn1Core_InitEx(&pThis->Asn1Core, 398 399 ASN1_TAG_OID, … … 497 498 RTDECL(int) RTAsn1ObjId_Enum(PRTASN1OBJID pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) 498 499 { 500 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 499 501 Assert(pThis && (!RTAsn1ObjId_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1ObjId_Vtable)); 500 502 … … 527 529 RTDECL(int) RTAsn1ObjId_CheckSanity(PCRTASN1OBJID pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 528 530 { 531 RT_NOREF_PV(fFlags); 529 532 if (RT_UNLIKELY(!RTAsn1ObjId_IsPresent(pThis))) 530 533 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (OBJID).", pszErrorTag); -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
r62477 r62564 78 78 { 79 79 RTASN1OCTETSTRINGWRITERCTX *pCtx = (RTASN1OCTETSTRINGWRITERCTX *)pvUser; 80 RT_NOREF_PV(pErrInfo); 80 81 AssertReturn(cbToWrite <= pCtx->cbBuf - pCtx->offBuf, VERR_BUFFER_OVERFLOW); 81 82 if (memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0) -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp
r62477 r62564 1736 1736 RTDECL(int) RTAsn1String_Enum(PRTASN1STRING pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) 1737 1737 { 1738 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 1738 1739 Assert(pThis && (!RTAsn1String_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1String_Vtable)); 1739 1740 … … 1752 1753 RTDECL(int) RTAsn1String_CheckSanity(PCRTASN1STRING pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 1753 1754 { 1755 RT_NOREF_PV(fFlags); 1754 1756 if (RT_UNLIKELY(!RTAsn1String_IsPresent(pThis))) 1755 1757 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (STRING).", pszErrorTag); … … 1787 1789 RTDECL(int) RT_CONCAT(a_Api,_Enum)(PRTASN1STRING pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) \ 1788 1790 { \ 1791 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); \ 1789 1792 Assert( pThis \ 1790 1793 && ( !RTAsn1String_IsPresent(pThis) \ -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-time-decode.cpp
r62477 r62564 305 305 RTDECL(int) RTAsn1Time_DecodeAsn1(PRTASN1CURSOR pCursor, uint32_t fFlags, PRTASN1TIME pThis, const char *pszErrorTag) 306 306 { 307 Assert(!(fFlags & RTASN1CURSOR_GET_F_IMPLICIT)); 307 Assert(!(fFlags & RTASN1CURSOR_GET_F_IMPLICIT)); RT_NOREF_PV(fFlags); 308 308 int rc = RTAsn1CursorReadHdr(pCursor, &pThis->Asn1Core, pszErrorTag); 309 309 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Runtime/common/asn1/asn1-ut-time.cpp
r62477 r62564 55 55 RTDECL(int) RTAsn1Time_InitEx(PRTASN1TIME pThis, uint32_t uTag, PCRTASN1ALLOCATORVTABLE pAllocator) 56 56 { 57 RT_NOREF_PV(pAllocator); 57 58 AssertReturn(uTag == ASN1_TAG_UTC_TIME || uTag == ASN1_TAG_GENERALIZED_TIME, VERR_INVALID_PARAMETER); 58 59 RTAsn1Core_InitEx(&pThis->Asn1Core, … … 154 155 RTDECL(int) RTAsn1Time_Enum(PRTASN1TIME pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) 155 156 { 157 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); 156 158 Assert(pThis && (!RTAsn1Time_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1Time_Vtable)); 157 159 … … 190 192 RTDECL(int) RTAsn1Time_CheckSanity(PCRTASN1TIME pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag) 191 193 { 194 RT_NOREF_PV(fFlags); 192 195 if (RT_UNLIKELY(!RTAsn1Time_IsPresent(pThis))) 193 196 return RTErrInfoSetF(pErrInfo, VERR_ASN1_NOT_PRESENT, "%s: Missing (TIME).", pszErrorTag); … … 225 228 RTDECL(int) RT_CONCAT(a_Api,_Enum)(PRTASN1TIME pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) \ 226 229 { \ 230 RT_NOREF_PV(pThis); RT_NOREF_PV(pfnCallback); RT_NOREF_PV(uDepth); RT_NOREF_PV(pvUser); \ 227 231 Assert( pThis \ 228 232 && ( !RTAsn1Time_IsPresent(pThis) \
Note:
See TracChangeset
for help on using the changeset viewer.