Changeset 64867 in vbox
- Timestamp:
- Dec 14, 2016 1:40:07 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/crypto/spc.h
r62474 r64867 84 84 uint8_t abHash[RTSHA512_HASH_SIZE]; 85 85 } aSha512[1]; 86 87 /** Generic view of ONE hash. */ 88 struct 89 { 90 /** The file offset. */ 91 uint32_t offFile; 92 /** Variable length hash field. */ 93 uint8_t abHash[1]; 94 } Generic; 86 95 } RTCRSPCPEIMAGEPAGEHASHES; 87 96 /** Pointer to a PE image page hash table union. */ -
trunk/src/VBox/Runtime/common/asn1/oiddb.cfg
r64816 r64867 74 74 1.2.840.113549.1.9.14 = pkcs9-ExtensionRequest 75 75 1.2.840.113549.1.9.15 = pkcs9-SMimeCapabilities 76 1.2.840.113549.1.9.25 = pkcs9-at 76 1.2.840.113549.1.9.16 = pkcs9-SMime 77 1.2.840.113549.1.9.16.1 = pkcs9-SMime-ct 78 1.2.840.113549.1.9.16.1.2 = pkcs9-ct-AuthData 79 1.2.840.113549.1.9.16.1.4 = pkcs9-ct-TimestampTokenInfo 80 1.2.840.113549.1.9.16.1.9 = pkcs9-ct-CompressedData 81 1.2.840.113549.1.9.16.1.23 = pkcs9-ct-AuthEnvelopedData 82 1.2.840.113549.1.9.16.1.31 = pkcs9-ct-TimestampedData 83 1.2.840.113549.1.9.16.2 = pkcs9-SMime-id-aa 84 1.2.840.113549.1.9.16.2.12 = pkcs9-id-aa-SigningCertificate 85 1.2.840.113549.1.9.25 = pkcs9-SMime-at 77 86 1.2.840.113549.1.9.25.1 = pkcs9-at-Pkcs15Token 78 87 1.2.840.113549.1.9.25.2 = pkcs9-at-EncryptedPrivateKeyInfo … … 88 97 1.3.6.1.4.1.311.2.1.4 = Ms-SpcIndirectDataContext 89 98 1.3.6.1.4.1.311.2.1.10 = Ms-SpcAgencyInfo 90 1.3.6.1.4.1.311.2.1.11 = Ms-SpcStatem ntType99 1.3.6.1.4.1.311.2.1.11 = Ms-SpcStatementType 91 100 1.3.6.1.4.1.311.2.1.12 = Ms-SpcOpusInfo 92 101 1.3.6.1.4.1.311.2.1.14 = Ms-CertReqExtensions -
trunk/src/VBox/Runtime/tools/RTSignTool.cpp
r64858 r64867 41 41 #include <iprt/stream.h> 42 42 #include <iprt/string.h> 43 #include <iprt/uuid.h> 43 44 #include <iprt/crypto/digest.h> 44 45 #include <iprt/crypto/x509.h> … … 659 660 660 661 662 /** 663 * Decodes the PKCS #7 blob pointed to by pThis->pbBuf. 664 * 665 * @returns IPRT status code. 666 * @param pThis The show exe instance data. 667 */ 661 668 static int HandleShowExeWorkerPkcs7Decode(PSHOWEXEPKCS7 pThis) 662 669 { … … 716 723 717 724 725 /** 726 * Display an object ID. 727 * 728 * @returns IPRT status code. 729 * @param pThis The show exe instance data. 730 * @param pObjId The object ID to display. 731 * @param pszLabel The field label (prefixed by szPrefix). 732 * @param pszPost What to print after the ID (typically newline). 733 */ 734 static void HandleShowExeWorkerDisplayObjId(PSHOWEXEPKCS7 pThis, PCRTASN1OBJID pObjId, const char *pszLabel, const char *pszPost) 735 { 736 int rc = RTAsn1QueryObjIdName(pObjId, pThis->szTmp, sizeof(pThis->szTmp)); 737 if (RT_SUCCESS(rc)) 738 { 739 if (pThis->cVerbosity > 1) 740 RTPrintf("%s%s%s (%s)%s", pThis->szPrefix, pszLabel, pThis->szTmp, pObjId->szObjId, pszPost); 741 else 742 RTPrintf("%s%s%s%s", pThis->szPrefix, pszLabel, pThis->szTmp, pszPost); 743 } 744 else 745 RTPrintf("%s%s%s%s", pThis->szPrefix, pszLabel, pObjId->szObjId, pszPost); 746 } 747 748 749 /** 750 * Display an object ID, without prefix and label 751 * 752 * @returns IPRT status code. 753 * @param pThis The show exe instance data. 754 * @param pObjId The object ID to display. 755 * @param pszPost What to print after the ID (typically newline). 756 */ 757 static void HandleShowExeWorkerDisplayObjIdSimple(PSHOWEXEPKCS7 pThis, PCRTASN1OBJID pObjId, const char *pszPost) 758 { 759 int rc = RTAsn1QueryObjIdName(pObjId, pThis->szTmp, sizeof(pThis->szTmp)); 760 if (RT_SUCCESS(rc)) 761 { 762 if (pThis->cVerbosity > 1) 763 RTPrintf("%s (%s)%s", pThis->szTmp, pObjId->szObjId, pszPost); 764 else 765 RTPrintf("%s%s", pThis->szTmp, pszPost); 766 } 767 else 768 RTPrintf("%s%s", pObjId->szObjId, pszPost); 769 } 770 771 772 /** 773 * Display a signer info attribute. 774 * 775 * @returns IPRT status code. 776 * @param pThis The show exe instance data. 777 * @param offPrefix The current prefix offset. 778 * @param pAttr The attribute to display. 779 */ 718 780 static int HandleShowExeWorkerPkcs7DisplayAttrib(PSHOWEXEPKCS7 pThis, size_t offPrefix, PCRTCRPKCS7ATTRIBUTE pAttr) 719 781 { 720 int rc = RTAsn1QueryObjIdName(&pAttr->Type, pThis->szTmp, sizeof(pThis->szTmp)); 721 if (RT_SUCCESS(rc)) 722 RTPrintf("%s%s (%s)\n", pThis->szPrefix, pThis->szTmp, pAttr->Type.szObjId); 723 else 724 RTPrintf("%s%s\n", pThis->szPrefix, pAttr->Type.szObjId); 725 726 rc = VINF_SUCCESS; 782 HandleShowExeWorkerDisplayObjId(pThis, &pAttr->Type, "", ":\n"); 783 784 int rc = VINF_SUCCESS; 727 785 switch (pAttr->enmType) 728 786 { … … 732 790 else 733 791 RTPrintf("%s %u bytes divided by %u items\n", pThis->szPrefix, pAttr->uValues.pCores->SetCore.Asn1Core.cb, pAttr->uValues.pCores->cItems); 734 for (unsigned i = 0; i < pAttr->uValues.pCores->cItems; i++) 792 break; 793 794 /* Object IDs, use pObjIds. */ 795 case RTCRPKCS7ATTRIBUTETYPE_OBJ_IDS: 796 if (pAttr->uValues.pObjIds->cItems != 1) 797 RTPrintf("%s%u object IDs:", pThis->szPrefix, pAttr->uValues.pObjIds->cItems); 798 for (unsigned i = 0; i < pAttr->uValues.pObjIds->cItems; i++) 735 799 { 736 800 if (pAttr->uValues.pObjIds->cItems == 1) 801 RTPrintf("%s ", pThis->szPrefix); 802 else 803 RTPrintf("%s ObjId[%u]: ", pThis->szPrefix, i); 804 HandleShowExeWorkerDisplayObjIdSimple(pThis, &pAttr->uValues.pObjIds->paItems[i], "\n"); 737 805 } 738 806 break; 739 807 740 /** Object IDs, use pObjIds. */ 741 case RTCRPKCS7ATTRIBUTETYPE_OBJ_IDS: 742 /** Octet strings, use pOctetStrings. */ 808 /* Sequence of object IDs, use pObjIdSeqs. */ 809 case RTCRPKCS7ATTRIBUTETYPE_MS_STATEMENT_TYPE: 810 if (pAttr->uValues.pObjIdSeqs->cItems != 1) 811 RTPrintf("%s%u object IDs:", pThis->szPrefix, pAttr->uValues.pObjIdSeqs->cItems); 812 for (unsigned i = 0; i < pAttr->uValues.pObjIdSeqs->cItems; i++) 813 { 814 uint32_t const cObjIds = pAttr->uValues.pObjIdSeqs->paItems[i].cItems; 815 for (unsigned j = 0; j < cObjIds; j++) 816 { 817 if (pAttr->uValues.pObjIdSeqs->cItems == 1) 818 RTPrintf("%s ", pThis->szPrefix); 819 else 820 RTPrintf("%s ObjIdSeq[%u]: ", pThis->szPrefix, i); 821 if (cObjIds != 1) 822 RTPrintf(" ObjId[%u]: ", j); 823 HandleShowExeWorkerDisplayObjIdSimple(pThis, &pAttr->uValues.pObjIdSeqs->paItems[i].paItems[i], "\n"); 824 } 825 } 826 break; 827 828 /* Octet strings, use pOctetStrings. */ 743 829 case RTCRPKCS7ATTRIBUTETYPE_OCTET_STRINGS: 744 /** Counter signatures (PKCS \#9), use pCounterSignatures. */ 830 if (pAttr->uValues.pOctetStrings->cItems != 1) 831 RTPrintf("%s%u octet strings:", pThis->szPrefix, pAttr->uValues.pOctetStrings->cItems); 832 for (unsigned i = 0; i < pAttr->uValues.pOctetStrings->cItems; i++) 833 { 834 PCRTASN1OCTETSTRING pOctetString = &pAttr->uValues.pOctetStrings->paItems[i]; 835 uint32_t cbContent = pOctetString->Asn1Core.cb; 836 if (cbContent > 0 && (cbContent <= 128 || pThis->cVerbosity >= 2)) 837 { 838 uint8_t const *pbContent = pOctetString->Asn1Core.uData.pu8; 839 uint32_t off = 0; 840 while (off < cbContent) 841 { 842 uint32_t cbNow = RT_MIN(cbContent - off, 16); 843 if (pAttr->uValues.pOctetStrings->cItems == 1) 844 RTPrintf("%s %#06x: %.*Rhxs\n", pThis->szPrefix, off, cbNow, &pbContent[off]); 845 else 846 RTPrintf("%s OctetString[%u]: %#06x: %.*Rhxs\n", pThis->szPrefix, i, off, cbNow, &pbContent[off]); 847 off += cbNow; 848 } 849 } 850 else 851 RTPrintf("%s: OctetString[%u]: %u bytes\n", i, pOctetString->Asn1Core.cb); 852 } 853 break; 854 855 /* Counter signatures (PKCS \#9), use pCounterSignatures. */ 745 856 case RTCRPKCS7ATTRIBUTETYPE_COUNTER_SIGNATURES: 746 /** Signing time (PKCS \#9), use pSigningTime. */ 857 RTPrintf("%sTODO: RTCRPKCS7ATTRIBUTETYPE_COUNTER_SIGNATURES! %u bytes\n", 858 pThis->szPrefix, pThis->szPrefix,pAttr->uValues.pCounterSignatures->SetCore.Asn1Core.cb); 859 break; 860 861 /* Signing time (PKCS \#9), use pSigningTime. */ 747 862 case RTCRPKCS7ATTRIBUTETYPE_SIGNING_TIME: 748 /** Microsoft timestamp info (RFC-3161) signed data, use pContentInfo. */ 863 RTPrintf("%sTODO: RTCRPKCS7ATTRIBUTETYPE_SIGNING_TIME! %u bytes\n", 864 pThis->szPrefix, pThis->szPrefix,pAttr->uValues.pSigningTime->SetCore.Asn1Core.cb); 865 break; 866 867 /* Microsoft timestamp info (RFC-3161) signed data, use pContentInfo. */ 749 868 case RTCRPKCS7ATTRIBUTETYPE_MS_TIMESTAMP: 750 869 case RTCRPKCS7ATTRIBUTETYPE_MS_NESTED_SIGNATURE: … … 762 881 PCRTCRPKCS7CONTENTINFO pContentInfo = &pAttr->uValues.pContentInfos->paItems[i]; 763 882 int rc2; 764 if (RTCrPkcs7ContentInfo_IsSignedData( &pThis->ContentInfo))883 if (RTCrPkcs7ContentInfo_IsSignedData(pContentInfo)) 765 884 rc2 = HandleShowExeWorkerPkcs7Display(pThis, pContentInfo->u.pSignedData, offPrefix2); 766 885 else … … 782 901 break; 783 902 } 784 //if (RTAsn1ObjId_CompareWithString(&pAttr->Type, ))785 //{786 //}787 903 return rc; 788 904 } 789 905 790 906 907 /** 908 * Displays a Microsoft SPC indirect data structure. 909 * 910 * @returns IPRT status code. 911 * @param pThis The show exe instance data. 912 * @param offPrefix The current prefix offset. 913 * @param pIndData The indirect data to display. 914 */ 915 static int HandleShowExeWorkerPkcs7DisplaySpcIdirectDataContent(PSHOWEXEPKCS7 pThis, size_t offPrefix, 916 PCRTCRSPCINDIRECTDATACONTENT pIndData) 917 { 918 919 /* 920 * The image hash. 921 */ 922 RTDIGESTTYPE const enmDigestType = RTCrX509AlgorithmIdentifier_QueryDigestType(&pIndData->DigestInfo.DigestAlgorithm); 923 const char *pszDigestType = RTCrDigestTypeToName(enmDigestType); 924 RTPrintf("%s Digest Type: %s", pThis->szPrefix, pszDigestType); 925 if (pThis->cVerbosity > 1) 926 RTPrintf(" (%s)\n", pIndData->DigestInfo.DigestAlgorithm.Algorithm.szObjId); 927 else 928 RTPrintf("\n"); 929 RTPrintf("%s Digest: %.*Rhxs\n", 930 pThis->szPrefix, pIndData->DigestInfo.Digest.Asn1Core.cb, pIndData->DigestInfo.Digest.Asn1Core.uData.pu8); 931 932 /* 933 * The data/file/url. 934 */ 935 switch (pIndData->Data.enmType) 936 { 937 case RTCRSPCAAOVTYPE_PE_IMAGE_DATA: 938 { 939 RTPrintf("%s Data Type: PE Image Data\n", pThis->szPrefix); 940 PRTCRSPCPEIMAGEDATA pPeImage = pIndData->Data.uValue.pPeImage; 941 /** @todo display "Flags". */ 942 943 switch (pPeImage->T0.File.enmChoice) 944 { 945 case RTCRSPCLINKCHOICE_MONIKER: 946 { 947 PRTCRSPCSERIALIZEDOBJECT pMoniker = pPeImage->T0.File.u.pMoniker; 948 if (RTCrSpcSerializedObject_IsPresent(pMoniker)) 949 { 950 if (RTUuidCompareStr(pMoniker->Uuid.Asn1Core.uData.pUuid, RTCRSPCSERIALIZEDOBJECT_UUID_STR) == 0) 951 { 952 RTPrintf("%s Moniker: SpcSerializedObject (%RTuuid)\n", 953 pThis->szPrefix, pMoniker->Uuid.Asn1Core.uData.pUuid); 954 955 PCRTCRSPCSERIALIZEDOBJECTATTRIBUTES pData = pMoniker->u.pData; 956 if (pData) 957 for (uint32_t i = 0; i < pData->cItems; i++) 958 { 959 RTStrPrintf(&pThis->szPrefix[offPrefix], sizeof(pThis->szPrefix) - offPrefix, 960 "MonikerAttrib[%u]: ", i); 961 962 switch (pData->paItems[i].enmType) 963 { 964 case RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V2: 965 case RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1: 966 { 967 PCRTCRSPCSERIALIZEDPAGEHASHES pPgHashes = pData->paItems[i].u.pPageHashes; 968 uint32_t const cbHash = pData->paItems[i].enmType 969 == RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1 970 ? 160/8 /*SHA-1*/ : 256/8 /*SHA-256*/; 971 uint32_t const cPages = pPgHashes->RawData.Asn1Core.cb / (cbHash + sizeof(uint32_t)); 972 973 RTPrintf("%sPage Hashes version %u - %u pages (%u bytes total)\n", pThis->szPrefix, 974 pData->paItems[i].enmType 975 == RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_PAGE_HASHES_V1 ? 1 : 2, 976 cPages, pPgHashes->RawData.Asn1Core.cb); 977 if (pThis->cVerbosity > 0) 978 { 979 uint32_t cbHash = RTCrDigestTypeToHashSize(enmDigestType); 980 PCRTCRSPCPEIMAGEPAGEHASHES pPg = pPgHashes->pData; 981 for (unsigned iPg = 0; iPg < cPages; iPg++) 982 { 983 uint32_t offHash = 0; 984 do 985 { 986 if (offHash == 0) 987 RTPrintf("%.*s Page#%04u/%#08x: ", 988 offPrefix, pThis->szPrefix, iPg, pPg->Generic.offFile); 989 else 990 RTPrintf("%.*s ", offPrefix, pThis->szPrefix); 991 uint32_t cbLeft = cbHash - offHash; 992 if (cbLeft > 24) 993 cbLeft = 16; 994 RTPrintf("%.*Rhxs\n", cbLeft, &pPg->Generic.abHash[offHash]); 995 offHash += cbLeft; 996 } while (offHash < cbHash); 997 pPg = (PCRTCRSPCPEIMAGEPAGEHASHES)&pPg->Generic.abHash[cbHash]; 998 } 999 1000 if (pThis->cVerbosity > 3) 1001 RTPrintf("%.*Rhxd\n", 1002 pPgHashes->RawData.Asn1Core.cb, 1003 pPgHashes->RawData.Asn1Core.uData.pu8); 1004 } 1005 break; 1006 } 1007 1008 case RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_UNKNOWN: 1009 HandleShowExeWorkerDisplayObjIdSimple(pThis, &pData->paItems[i].Type, "\n"); 1010 break; 1011 case RTCRSPCSERIALIZEDOBJECTATTRIBUTETYPE_NOT_PRESENT: 1012 RTPrintf("%sNot present!\n", pThis->szPrefix); 1013 break; 1014 default: 1015 RTPrintf("%senmType=%d!\n", pThis->szPrefix, pData->paItems[i].enmType); 1016 break; 1017 } 1018 pThis->szPrefix[offPrefix] = '\0'; 1019 } 1020 else 1021 RTPrintf("%s pData is NULL!\n"); 1022 } 1023 else 1024 RTPrintf("%s Moniker: Unknown UUID: %RTuuid\n", 1025 pThis->szPrefix, pMoniker->Uuid.Asn1Core.uData.pUuid); 1026 } 1027 else 1028 RTPrintf("%s Moniker: not present\n", pThis->szPrefix); 1029 break; 1030 } 1031 1032 case RTCRSPCLINKCHOICE_URL: 1033 { 1034 const char *pszUrl = NULL; 1035 int rc = pPeImage->T0.File.u.pUrl 1036 ? RTAsn1String_QueryUtf8(pPeImage->T0.File.u.pUrl, &pszUrl, NULL) 1037 : VERR_NOT_FOUND; 1038 if (RT_SUCCESS(rc)) 1039 RTPrintf("%s URL: '%s'\n", pThis->szPrefix, pszUrl); 1040 else 1041 RTPrintf("%s URL: rc=%Rrc\n", pThis->szPrefix, rc); 1042 break; 1043 } 1044 1045 case RTCRSPCLINKCHOICE_FILE: 1046 { 1047 const char *pszFile = NULL; 1048 int rc = pPeImage->T0.File.u.pT2 && pPeImage->T0.File.u.pT2->File.u.pAscii 1049 ? RTAsn1String_QueryUtf8(pPeImage->T0.File.u.pT2->File.u.pAscii, &pszFile, NULL) 1050 : VERR_NOT_FOUND; 1051 if (RT_SUCCESS(rc)) 1052 RTPrintf("%s File: '%s'\n", pThis->szPrefix, pszFile); 1053 else 1054 RTPrintf("%s File: rc=%Rrc\n", pThis->szPrefix, rc); 1055 break; 1056 } 1057 1058 case RTCRSPCLINKCHOICE_NOT_PRESENT: 1059 RTPrintf("%s File not present!\n", pThis->szPrefix); 1060 break; 1061 default: 1062 RTPrintf("%s enmChoice=%d!\n", pThis->szPrefix, pPeImage->T0.File.enmChoice); 1063 break; 1064 } 1065 break; 1066 } 1067 1068 case RTCRSPCAAOVTYPE_UNKNOWN: 1069 HandleShowExeWorkerDisplayObjId(pThis, &pIndData->Data.Type, " Data Type: ", "\n"); 1070 break; 1071 case RTCRSPCAAOVTYPE_NOT_PRESENT: 1072 RTPrintf("%s Data Type: Not present!\n", pThis->szPrefix); 1073 break; 1074 default: 1075 RTPrintf("%s Data Type: enmType=%d!\n", pThis->szPrefix, pIndData->Data.enmType); 1076 break; 1077 } 1078 1079 return VINF_SUCCESS; 1080 } 1081 1082 1083 1084 /** 1085 * Display an PKCS#7 signed data instance. 1086 * 1087 * @returns IPRT status code. 1088 * @param pThis The show exe instance data. 1089 * @param offPrefix The current prefix offset. 1090 * @param pSignedData The signed data to display. 1091 */ 791 1092 static int HandleShowExeWorkerPkcs7Display(PSHOWEXEPKCS7 pThis, PRTCRPKCS7SIGNEDDATA pSignedData, size_t offPrefix) 792 1093 { 793 1094 pThis->szPrefix[offPrefix] = '\0'; 794 1095 795 /* Display list of signing algorithms. */ 1096 /* 1097 * Display list of signing algorithms. 1098 */ 796 1099 RTPrintf("%sDigestAlgorithms: ", pThis->szPrefix); 797 1100 for (unsigned i = 0; i < pSignedData->DigestAlgorithms.cItems; i++) … … 802 1105 pszDigestType = pAlgoId->Algorithm.szObjId; 803 1106 RTPrintf(i == 0 ? "%s" : ", %s", pszDigestType); 1107 if (pThis->cVerbosity > 1) 1108 RTPrintf(" (%s)", pAlgoId->Algorithm.szObjId); 804 1109 } 805 1110 RTPrintf("\n"); 806 1111 807 /* Display certificates (Certificates). */ 808 809 /* Show signatures (SignerInfos). */ 1112 /* 1113 * Display the signed data content. 1114 */ 1115 if (RTAsn1ObjId_CompareWithString(&pSignedData->ContentInfo.ContentType, RTCRSPCINDIRECTDATACONTENT_OID) == 0) 1116 { 1117 RTPrintf("%s ContentType: SpcIndirectDataContent (" RTCRSPCINDIRECTDATACONTENT_OID ")\n", pThis->szPrefix); 1118 size_t offPrefix2 = RTStrPrintf(&pThis->szPrefix[offPrefix], sizeof(pThis->szPrefix) - offPrefix, " SPC Ind Data: "); 1119 HandleShowExeWorkerPkcs7DisplaySpcIdirectDataContent(pThis, offPrefix2 + offPrefix, 1120 pSignedData->ContentInfo.u.pIndirectDataContent); 1121 pThis->szPrefix[offPrefix] = '\0'; 1122 } 1123 else 1124 RTPrintf("%s ContentType: %s\n", pThis->szPrefix, pSignedData->ContentInfo.ContentType.szObjId); 1125 1126 /* 1127 * Display certificates (Certificates). 1128 */ 1129 1130 /* 1131 * Show signatures (SignerInfos). 1132 */ 1133 RTPrintf("%s SignerInfos:\n", pThis->szPrefix); 810 1134 unsigned const cSigInfos = pSignedData->SignerInfos.cItems; 811 1135 for (unsigned i = 0; i < cSigInfos; i++) … … 830 1154 if (!pszType) 831 1155 pszType = pSigInfo->DigestAlgorithm.Algorithm.szObjId; 832 RTPrintf("%s Digest Algorithm: %s\n", pThis->szPrefix, pszType); 833 834 rc = RTAsn1QueryObjIdName(&pSigInfo->DigestEncryptionAlgorithm.Algorithm, pThis->szTmp, sizeof(pThis->szTmp)); 835 if (RT_SUCCESS(rc)) 836 pszType = pThis->szTmp; 1156 RTPrintf("%s Digest Algorithm: %s", pThis->szPrefix, pszType); 1157 if (pThis->cVerbosity > 1) 1158 RTPrintf(" (%s)\n", pSigInfo->DigestAlgorithm.Algorithm.szObjId); 837 1159 else 838 pszType = pSigInfo->DigestAlgorithm.Algorithm.szObjId; 839 RTPrintf("%sDigest Encryption Algorithm: %s\n", pThis->szPrefix, pszType); 1160 RTPrintf("\n"); 1161 1162 HandleShowExeWorkerDisplayObjId(pThis, &pSigInfo->DigestEncryptionAlgorithm.Algorithm, 1163 "Digest Encryption Algorithm: ", "\n"); 840 1164 841 1165 if (pSigInfo->AuthenticatedAttributes.cItems == 0) … … 849 1173 PRTCRPKCS7ATTRIBUTE pAttr = &pSigInfo->AuthenticatedAttributes.paItems[j]; 850 1174 size_t offPrefix3 = offPrefix2 + RTStrPrintf(&pThis->szPrefix[offPrefix2], sizeof(pThis->szPrefix) - offPrefix2, 851 " AuthAttrib[%u]: ", j);1175 " AuthAttrib[%u]: ", j); 852 1176 HandleShowExeWorkerPkcs7DisplayAttrib(pThis, offPrefix3, pAttr); 853 1177 } … … 865 1189 PRTCRPKCS7ATTRIBUTE pAttr = &pSigInfo->UnauthenticatedAttributes.paItems[j]; 866 1190 size_t offPrefix3 = offPrefix2 + RTStrPrintf(&pThis->szPrefix[offPrefix2], sizeof(pThis->szPrefix) - offPrefix2, 867 " UnauthAttrib[%u]: ", j);1191 " UnauthAttrib[%u]: ", j); 868 1192 HandleShowExeWorkerPkcs7DisplayAttrib(pThis, offPrefix3, pAttr); 869 1193 } … … 871 1195 } 872 1196 873 #if 0 874 /** Authenticated attributes, optional [0]. 875 * @todo Check how other producers formats this. The microsoft one does not 876 * have explicit tags, but combines it with the SET OF. */ 877 RTCRPKCS7ATTRIBUTES AuthenticatedAttributes; 878 879 /** The encrypted digest. */ 880 RTASN1OCTETSTRING EncryptedDigest; 881 /** Unauthenticated attributes, optional [1]. 882 * @todo Check how other producers formats this. The microsoft one does not 883 * have explicit tags, but combines it with the SET OF. */ 884 RTCRPKCS7ATTRIBUTES UnauthenticatedAttributes; 885 #endif 1197 /** @todo show the encrypted stuff (EncryptedDigest)? */ 886 1198 } 887 1199 pThis->szPrefix[offPrefix] = '\0'; … … 967 1279 } 968 1280 1281 969 1282 static RTEXITCODE HandleShowExe(int cArgs, char **papszArgs) 970 1283 { … … 1008 1321 * Do it. 1009 1322 */ 1323 unsigned iFile = 0; 1010 1324 RTEXITCODE rcExit = RTEXITCODE_SUCCESS; 1011 1325 do 1012 1326 { 1327 RTPrintf(iFile == 0 ? "%s:\n" : "\n%s:\n", ValueUnion.psz); 1013 1328 RTEXITCODE rcExitThis = HandleShowExeWorker(ValueUnion.psz, cVerbose, enmLdrArch); 1014 1329 if (rcExitThis != RTEXITCODE_SUCCESS && rcExit == RTEXITCODE_SUCCESS) 1015 1330 rcExit = rcExitThis; 1331 iFile++; 1016 1332 } while ((ch = RTGetOpt(&GetState, &ValueUnion)) == VINF_GETOPT_NOT_OPTION); 1017 1333 if (ch != 0) … … 1022 1338 1023 1339 #endif /* !IPRT_IN_BUILD_TOOL */ 1024 ////1025 1340 1026 1341 /*
Note:
See TracChangeset
for help on using the changeset viewer.