Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.0 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM crypto.cmd - DanGriff
  4. @REM Applies MAC and signature to a list of crypto components
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. sub Usage { print<<USAGE; exit(1) }
  19. crypto [-l <language>]
  20. Applies MAC and signature to a list of crypto components
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. # *** TEMPLATE CODE ***
  24. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  25. __END__
  26. @:CPCBegin
  27. @set _CPCMAGIC=
  28. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  29. @if not defined DEBUG echo off
  30. @REM *** CMD SCRIPT BELOW ***
  31. REM
  32. REM Based on the postbuild environment, determine the appropriate
  33. REM signature processing to be done.
  34. REM
  35. if "1" == "%vaultsign%" (
  36. REM Check for binplaced marker file to verify that
  37. REM advapi32.dll was built to require Vault Signatures.
  38. if not exist %_NTPOSTBLD%\dump\advapi_vaultsign.txt (
  39. call errmsg "VAULTSIGN is set, but advapi32.dll was not built with that option."
  40. goto :EOF
  41. )
  42. )
  43. set CERT_FILE=%RazzleToolPath%\driver.pfx
  44. set CSP_SIGN_CMD=signtool sign /sha1 83E06454938FC9248845CB2C4E4E73CF8CCC6E65
  45. REM MS Software CSPs
  46. call :SignFile dssenh.dll
  47. call :SignFile rsaenh.dll
  48. REM Smart Card CSPs
  49. call :SignFile gpkcsp.dll
  50. call :SignFile slbcsp.dll
  51. call :SignFile sccbase.dll
  52. goto :EOF
  53. :SignFile
  54. set image=%_NTPOSTBLD%\%1
  55. REM imagecfg can't be called with ExecuteCmd since it does not set error values
  56. call logmsg "Executing imagecfg -n %Image%"
  57. imagecfg -n %Image%
  58. call logmsg "Executing %CSP_SIGN_EXE% on %Image%"
  59. %CSP_SIGN_CMD% %Image%
  60. if not "%errorlevel%" == "0" (
  61. call errmsg "%CSP_SIGN_EXE% failed on %Image%"
  62. )
  63. :end