do_fips.bat 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. @echo off
  2. SET ASM=%1
  3. if NOT X%PROCESSOR_ARCHITECTURE% == X goto defined
  4. echo Processor Architecture Undefined: defaulting to X86
  5. goto X86
  6. :defined
  7. if %PROCESSOR_ARCHITECTURE% == x86 goto X86
  8. if %PROCESSOR_ARCHITECTURE% == IA64 goto IA64
  9. if %PROCESSOR_ARCHITECTURE% == AMD64 goto AMD64
  10. echo Processor Architecture Unrecognized: defaulting to X86
  11. :X86
  12. echo Auto Configuring for X86
  13. SET TARGET=VC-WIN32
  14. if x%ASM% == xno-asm goto compile
  15. echo Generating x86 for NASM assember
  16. SET ASM=nasm
  17. SET ASMOPTS=-DOPENSSL_IA32_SSE2
  18. echo Bignum
  19. cd crypto\bn\asm
  20. perl bn-586.pl win32n %ASMOPTS% > bn_win32.asm
  21. if ERRORLEVEL 1 goto error
  22. perl co-586.pl win32n %ASMOPTS% > co_win32.asm
  23. if ERRORLEVEL 1 goto error
  24. perl x86-mont.pl win32n %ASMOPTS% > mt_win32.asm
  25. if ERRORLEVEL 1 goto error
  26. cd ..\..\..
  27. echo AES
  28. cd crypto\aes\asm
  29. perl aes-586.pl win32n %ASMOPTS% > a_win32.asm
  30. if ERRORLEVEL 1 goto error
  31. cd ..\..\..
  32. echo DES
  33. cd crypto\des\asm
  34. perl des-586.pl win32n %ASMOPTS% > d_win32.asm
  35. if ERRORLEVEL 1 goto error
  36. cd ..\..\..
  37. echo "crypt(3)"
  38. cd crypto\des\asm
  39. perl crypt586.pl win32n %ASMOPTS% > y_win32.asm
  40. if ERRORLEVEL 1 goto error
  41. cd ..\..\..
  42. echo Blowfish
  43. cd crypto\bf\asm
  44. perl bf-586.pl win32n %ASMOPTS% > b_win32.asm
  45. if ERRORLEVEL 1 goto error
  46. cd ..\..\..
  47. echo CAST5
  48. cd crypto\cast\asm
  49. perl cast-586.pl win32n %ASMOPTS% > c_win32.asm
  50. if ERRORLEVEL 1 goto error
  51. cd ..\..\..
  52. echo RC4
  53. cd crypto\rc4\asm
  54. perl rc4-586.pl win32n %ASMOPTS% > r4_win32.asm
  55. if ERRORLEVEL 1 goto error
  56. cd ..\..\..
  57. echo MD5
  58. cd crypto\md5\asm
  59. perl md5-586.pl win32n %ASMOPTS% > m5_win32.asm
  60. if ERRORLEVEL 1 goto error
  61. cd ..\..\..
  62. echo SHA1
  63. cd crypto\sha\asm
  64. perl sha1-586.pl win32n %ASMOPTS% > s1_win32.asm
  65. if ERRORLEVEL 1 goto error
  66. perl sha512-sse2.pl win32n %ASMOPTS% > sha512-sse2.asm
  67. if ERRORLEVEL 1 goto error
  68. cd ..\..\..
  69. echo RIPEMD160
  70. cd crypto\ripemd\asm
  71. perl rmd-586.pl win32n %ASMOPTS% > rm_win32.asm
  72. if ERRORLEVEL 1 goto error
  73. cd ..\..\..
  74. echo RC5\32
  75. cd crypto\rc5\asm
  76. perl rc5-586.pl win32n %ASMOPTS% > r5_win32.asm
  77. if ERRORLEVEL 1 goto error
  78. cd ..\..\..
  79. echo CPU-ID
  80. cd crypto
  81. perl x86cpuid.pl win32n %ASMOPTS% > cpu_win32.asm
  82. if ERRORLEVEL 1 goto error
  83. cd ..
  84. goto compile
  85. :IA64
  86. echo Auto Configuring for IA64
  87. SET TARGET=VC-WIN64I
  88. perl ms\uplink.pl win64i > ms\uptable.asm
  89. if ERRORLEVEL 1 goto error
  90. ias -o ms\uptable.obj ms\uptable.asm
  91. if ERRORLEVEL 1 goto error
  92. goto compile
  93. :AMD64
  94. echo Auto Configuring for AMD64
  95. SET TARGET=VC-WIN64A
  96. perl ms\uplink.pl win64a > ms\uptable.asm
  97. if ERRORLEVEL 1 goto error
  98. ml64 -c -Foms\uptable.obj ms\uptable.asm
  99. if ERRORLEVEL 1 goto error
  100. if x%ASM% == xno-asm goto compile
  101. echo Generating x86_64 for ML64 assember
  102. SET ASM=ml64
  103. echo Bignum
  104. cd crypto\bn\asm
  105. perl x86_64-mont.pl x86_64-mont.asm
  106. if ERRORLEVEL 1 goto error
  107. cd ..\..\..
  108. echo AES
  109. cd crypto\aes\asm
  110. perl aes-x86_64.pl aes-x86_64.asm
  111. if ERRORLEVEL 1 goto error
  112. cd ..\..\..
  113. echo SHA
  114. cd crypto\sha\asm
  115. perl sha1-x86_64.pl sha1-x86_64.asm
  116. if ERRORLEVEL 1 goto error
  117. perl sha512-x86_64.pl sha256-x86_64.asm
  118. if ERRORLEVEL 1 goto error
  119. perl sha512-x86_64.pl sha512-x86_64.asm
  120. if ERRORLEVEL 1 goto error
  121. cd ..\..\..
  122. echo CPU-ID
  123. cd crypto
  124. perl x86_64cpuid.pl cpuid-x86_64.asm
  125. if ERRORLEVEL 1 goto error
  126. cd ..
  127. :compile
  128. perl Configure %TARGET% fipscanisterbuild
  129. pause
  130. echo on
  131. perl util\mkfiles.pl >MINFO
  132. @if ERRORLEVEL 1 goto error
  133. perl util\mk1mf.pl dll %ASM% %TARGET% >ms\ntdll.mak
  134. @if ERRORLEVEL 1 goto error
  135. perl util\mkdef.pl 32 libeay > ms\libeay32.def
  136. @if ERRORLEVEL 1 goto error
  137. perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
  138. @if ERRORLEVEL 1 goto error
  139. nmake -f ms\ntdll.mak clean
  140. nmake -f ms\ntdll.mak
  141. @if ERRORLEVEL 1 goto error
  142. @echo.
  143. @echo.
  144. @echo.
  145. @echo ***************************
  146. @echo ****FIPS BUILD SUCCESS*****
  147. @echo ***************************
  148. @goto end
  149. :error
  150. @echo.
  151. @echo.
  152. @echo.
  153. @echo ***************************
  154. @echo ****FIPS BUILD FAILURE*****
  155. @echo ***************************
  156. :end