Changeset 74716 in vbox for trunk/src/VBox
- Timestamp:
- Oct 9, 2018 11:59:42 AM (6 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/pkcs7-template.h
r69111 r74716 65 65 RTASN1TMPL_MEMBER_DYN( uValues, pObjIdSeqs, RTASN1SETOFOBJIDSEQS, RTAsn1SetOfObjIdSeqs, Allocation, 66 66 enmType, RTCRPKCS7ATTRIBUTETYPE_MS_STATEMENT_TYPE, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_MS_STATEMENT_TYPE) == 0); 67 RTASN1TMPL_MEMBER_DYN( uValues, pOctetStrings, RTASN1SETOFOCTETSTRINGS, RTAsn1SetOfOctetStrings, Allocation, 68 enmType, RTCRPKCS7ATTRIBUTETYPE_APPLE_MULTI_CD_PLIST, RTAsn1ObjId_CompareWithString(&pThis->Type, RTCR_PKCS9_ID_APPLE_MULTI_CD_PLIST) == 0); 67 69 RTASN1TMPL_MEMBER_DYN_DEFAULT( uValues, pCores, RTASN1SETOFCORES, RTAsn1SetOfCores, Allocation, 68 70 enmType, RTCRPKCS7ATTRIBUTETYPE_UNKNOWN); -
trunk/src/VBox/Runtime/tools/RTSignTool.cpp
r74707 r74716 1789 1789 break; 1790 1790 1791 case RTCRPKCS7ATTRIBUTETYPE_APPLE_MULTI_CD_PLIST: 1792 if (pAttr->uValues.pContentInfos->cItems != 1) 1793 RTPrintf("%s%u plists, expected only 1.\n", pThis->szPrefix, pAttr->uValues.pOctetStrings->cItems); 1794 for (unsigned i = 0; i < pAttr->uValues.pOctetStrings->cItems; i++) 1795 { 1796 PCRTASN1OCTETSTRING pOctetString = pAttr->uValues.pOctetStrings->papItems[i]; 1797 size_t cbContent = pOctetString->Asn1Core.cb; 1798 char const *pchContent = pOctetString->Asn1Core.uData.pch; 1799 rc = RTStrValidateEncodingEx(pchContent, cbContent, RTSTR_VALIDATE_ENCODING_EXACT_LENGTH); 1800 if (RT_SUCCESS(rc)) 1801 { 1802 while (cbContent > 0) 1803 { 1804 const char *pchNewLine = (const char *)memchr(pchContent, '\n', cbContent); 1805 size_t cchToWrite = pchNewLine ? pchNewLine - pchContent : cbContent; 1806 if (pAttr->uValues.pOctetStrings->cItems == 1) 1807 RTPrintf("%s %.*s\n", pThis->szPrefix, cchToWrite, pchContent); 1808 else 1809 RTPrintf("%s plist[%u]: %.*s\n", pThis->szPrefix, i, cchToWrite, pchContent); 1810 if (!pchNewLine) 1811 break; 1812 pchContent = pchNewLine + 1; 1813 cbContent -= cchToWrite + 1; 1814 } 1815 } 1816 else 1817 { 1818 if (pAttr->uValues.pContentInfos->cItems != 1) 1819 RTPrintf("%s: plist[%u]: Invalid UTF-8: %Rrc\n", pThis->szPrefix, i, rc); 1820 else 1821 RTPrintf("%s: Invalid UTF-8: %Rrc\n", pThis->szPrefix, rc); 1822 for (uint32_t off = 0; off < cbContent; off += 16) 1823 { 1824 size_t cbNow = RT_MIN(cbContent - off, 16); 1825 if (pAttr->uValues.pOctetStrings->cItems == 1) 1826 RTPrintf("%s %#06x: %.*Rhxs\n", pThis->szPrefix, off, cbNow, &pchContent[off]); 1827 else 1828 RTPrintf("%s plist[%u]: %#06x: %.*Rhxs\n", pThis->szPrefix, i, off, cbNow, &pchContent[off]); 1829 } 1830 } 1831 } 1832 break; 1833 1791 1834 case RTCRPKCS7ATTRIBUTETYPE_INVALID: 1792 1835 RTPrintf("%sINVALID!\n", pThis->szPrefix);
Note:
See TracChangeset
for help on using the changeset viewer.