Changeset 95633 in vbox for trunk/src/VBox/Runtime/tools/RTSignTool.cpp
- Timestamp:
- Jul 13, 2022 11:07:00 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/tools/RTSignTool.cpp
r95632 r95633 645 645 646 646 /** 647 * Reads and decodes PKCS\#7 signature from the given executable .647 * Reads and decodes PKCS\#7 signature from the given executable, if it has one. 648 648 * 649 649 * @returns RTEXITCODE_SUCCESS on success, RTEXITCODE_FAILURE with error message … … 653 653 * @param cVerbosity The verbosity. 654 654 * @param enmLdrArch For FAT binaries. 655 * @param fAllowUnsigned Whether to allow unsigned binaries. 655 656 */ 656 static RTEXITCODE SignToolPkcs7Exe_InitFromFile(PSIGNTOOLPKCS7EXE pThis, const char *pszFilename, 657 unsigned cVerbosity, RTLDRARCH enmLdrArch = RTLDRARCH_WHATEVER)657 static RTEXITCODE SignToolPkcs7Exe_InitFromFile(PSIGNTOOLPKCS7EXE pThis, const char *pszFilename, unsigned cVerbosity, 658 RTLDRARCH enmLdrArch = RTLDRARCH_WHATEVER, bool fAllowUnsigned = false) 658 659 { 659 660 /* … … 722 723 } 723 724 else if (RT_SUCCESS(rc)) 724 RTMsgInfo("'%s': not signed\n", pszFilename); 725 { 726 if (!fAllowUnsigned || cVerbosity >= 2) 727 RTMsgInfo("'%s': not signed\n", pszFilename); 728 if (fAllowUnsigned) 729 return RTEXITCODE_SUCCESS; 730 } 725 731 else 726 732 RTMsgError("RTLdrQueryProp/RTLDRPROP_IS_SIGNED failed on '%s': %Rrc\n", pszFilename, rc); … … 851 857 RTMsgError("Error truncating file to %#x bytes: %Rrc", pSecDir->VirtualAddress, rc); 852 858 } 853 else 859 else if (pSecDir->Size != 0 && pSecDir->VirtualAddress == 0) 854 860 rc = RTMsgErrorRc(VERR_BAD_EXE_FORMAT, "Bad security directory entry: VA=%#x Size=%#x", 855 861 pSecDir->VirtualAddress, pSecDir->Size); … … 2405 2411 /* Do the work: */ 2406 2412 SIGNTOOLPKCS7EXE Exe; 2407 /** @todo will fail if not already signed. */2408 rcExit2 = SignToolPkcs7Exe_InitFromFile(&Exe, ValueUnion.psz, cVerbosity);2413 rcExit2 = SignToolPkcs7Exe_InitFromFile(&Exe, ValueUnion.psz, cVerbosity, 2414 RTLDRARCH_WHATEVER, true /*fAllowUnsigned*/); 2409 2415 if (rcExit2 == RTEXITCODE_SUCCESS) 2410 2416 {
Note:
See TracChangeset
for help on using the changeset viewer.