Changeset 64916 in vbox
- Timestamp:
- Dec 16, 2016 4:32:03 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 112329
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/tools/RTSignTool.cpp
r64905 r64916 346 346 { 347 347 PRTCRPKCS7SIGNERINFO pSignerInfo = pThis->pSignedData->SignerInfos.papItems[0]; 348 int rc; 349 350 /* 351 * Deal with UnauthenticatedAttributes being absent before trying to append to the array. 352 */ 353 if (pSignerInfo->UnauthenticatedAttributes.cItems == 0) 354 { 355 /* HACK ALERT! Invent ASN.1 setters/whatever for members to replace this mess. */ 356 357 if (pSignerInfo->AuthenticatedAttributes.cItems == 0) 358 return RTMsgErrorExit(RTEXITCODE_FAILURE, "No authenticated or unauthenticated attributes! Sorry, no can do."); 359 360 Assert(pSignerInfo->UnauthenticatedAttributes.SetCore.Asn1Core.uTag == 0); 361 rc = RTAsn1SetCore_Init(&pSignerInfo->UnauthenticatedAttributes.SetCore, 362 pSignerInfo->AuthenticatedAttributes.SetCore.Asn1Core.pOps); 363 if (RT_FAILURE(rc)) 364 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTAsn1SetCore_Init failed: %Rrc", rc); 365 pSignerInfo->UnauthenticatedAttributes.SetCore.Asn1Core.uTag = 1; 366 pSignerInfo->UnauthenticatedAttributes.SetCore.Asn1Core.fClass = ASN1_TAGCLASS_CONTEXT | ASN1_TAGFLAG_CONSTRUCTED; 367 RTAsn1MemInitArrayAllocation(&pSignerInfo->UnauthenticatedAttributes.Allocation, 368 pSignerInfo->AuthenticatedAttributes.Allocation.pAllocator, 369 sizeof(**pSignerInfo->UnauthenticatedAttributes.papItems)); 370 } 371 348 372 int32_t iPos = RTCrPkcs7Attributes_Append(&pSignerInfo->UnauthenticatedAttributes); 349 373 if (iPos >= 0) … … 354 378 355 379 PRTCRPKCS7ATTRIBUTE pAttr = pSignerInfo->UnauthenticatedAttributes.papItems[iPos]; 356 intrc = RTAsn1ObjId_InitFromString(&pAttr->Type, RTCR_PKCS9_ID_MS_NESTED_SIGNATURE, pAttr->Allocation.pAllocator);380 rc = RTAsn1ObjId_InitFromString(&pAttr->Type, RTCR_PKCS9_ID_MS_NESTED_SIGNATURE, pAttr->Allocation.pAllocator); 357 381 if (RT_SUCCESS(rc)) 358 382 {
Note:
See TracChangeset
for help on using the changeset viewer.