title: Building 32 bit OpenSSL FIPS (nmake f ms\ntdll.mak): Illegal Character in macro
body: <p>My goal is to build the OpenSSL (openssl-1.0.2n) shared libraries (DLLs) in 32 bit with FIPS enabled. Per the procedure pescribed by openssl.org  (<a href="https://www.openssl.org/docs/fips/UserGuide-2.0.pdf" rel="nofollow noreferrer">https://www.openssl.org/docs/fips/UserGuide-2.0.pdf</a>), after building the FIPS canister I did:</p>
  
  <ol>
  <li>perl Configure VC-WIN32 fips --with-fipslibdir=C:\usr\local\ssl\fips-2.0</li>
  <li>ms\do_nasm</li>
  <li>nmake ­f ms\ntdll.mak</li>
  </ol>
  
  <p>The last (nmake f ms\ntdll.msk) throws this error:</p>
  
  <p>makefile(243) : fatal error U1001: syntax error : illegal character '{' in macro Stop.</p>
  
  <p>Guidance? This is tricky because the OpenSSL FIPS instructions are very specific about not modifying MAKE files to stay FIPS compliant. Kind of hamstrings me.</p>
  
  <p>Full listing from x86 VS2017 Command Prompt (run in admin mode):</p>
  
  <pre><code>**********************************************************************
  ** Visual Studio 2017 Developer Command Prompt v15.4.5
  ** Copyright (c) 2017 Microsoft Corporation
  **********************************************************************
  [vcvarsall.bat] Environment initialized for: 'x86'
  
  C:\Users\jlaird\source&gt;cd C:\OpenSSL_Source\32bit\openssl-1.0.2n
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl Configure VC-WIN32 fips --with-fipslibdir=C:\usr\local\ssl\fips-2.0
  Configuring for VC-WIN32
      no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
      no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
      no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
      no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
      no-libunbound   [experimental] OPENSSL_NO_LIBUNBOUND (skip dir)
      no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
      no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
      no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
      no-rsax         [forced]   OPENSSL_NO_RSAX (skip dir)
      no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
      no-shared       [default]
      no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE (skip dir)
      no-ssl2         [default]  OPENSSL_NO_SSL2 (skip dir)
      no-store        [experimental] OPENSSL_NO_STORE (skip dir)
      no-unit-test    [default]  OPENSSL_NO_UNIT_TEST (skip dir)
      no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
      no-zlib         [default]
      no-zlib-dynamic [default]
  IsMK1MF=1
  CC            =cl
  CFLAG         =-DOPENSSL_THREADS  -DDSO_WIN32 -W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -I$(FIPSDIR)/include -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
  EX_LIBS       =
  CPUID_OBJ     =x86cpuid.o
  BN_ASM        =bn-586.o co-586.o x86-mont.o x86-gf2m.o
  EC_ASM        =
  DES_ENC       =des-586.o crypt586.o
  AES_ENC       =aes-586.o vpaes-x86.o aesni-x86.o
  BF_ENC        =bf-586.o
  CAST_ENC      =cast-586.o
  RC4_ENC       =rc4-586.o
  RC5_ENC       =rc5-586.o
  MD5_OBJ_ASM   =md5-586.o
  SHA1_OBJ_ASM  =sha1-586.o sha256-586.o sha512-586.o
  RMD160_OBJ_ASM=rmd-586.o
  CMLL_ENC      =cmll-x86.o
  MODES_OBJ     =ghash-x86.o
  ENGINES_OBJ   =
  PROCESSOR     =
  RANLIB        =true
  ARFLAGS       =
  PERL          =perl
  THIRTY_TWO_BIT mode
  BN_LLONG mode
  RC4_INDEX mode
  RC4_CHUNK is undefined
  
  Configured for VC-WIN32.
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;ms\do_nasm
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mkfiles.pl  1&gt;MINFO
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mk1mf.pl nasm VC-WIN32  1&gt;ms\nt.mak
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mk1mf.pl dll nasm VC-WIN32  1&gt;ms\ntdll.mak
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mk1mf.pl nasm BC-NT  1&gt;ms\bcb.mak
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mkdef.pl 32 libeay  1&gt;ms\libeay32.def
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;perl util\mkdef.pl 32 ssleay  1&gt;ms\ssleay32.def
  
  C:\OpenSSL_Source\32bit\openssl-1.0.2n&gt;nmake ­f ms\ntdll.mak
  
  Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  makefile(243) : fatal error U1001: syntax error : illegal character '{' in macro
  Stop.
  </code></pre>
  
  <p>Looks like this was noted in a previous version of OpenSSL on GitHub but there was no posted resolution...issue just got closed, I have no idea what to do:
  <a href="https://github.com/openssl/openssl/issues/4352" rel="nofollow noreferrer">https://github.com/openssl/openssl/issues/4352</a></p>
  
  <p>I uploaded the ntdll.mak file to google drive here:
  <a href="https://drive.google.com/file/d/1B2GIWJjdyOXR6ycCLq8OpV4Skhg2N8ob/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1B2GIWJjdyOXR6ycCLq8OpV4Skhg2N8ob/view?usp=sharing</a></p>
  
  <p>Line 243 (not real helpful but here it is):</p>
  
  <pre><code>$(OBJ_D)\ecb3_enc.obj $(OBJ_D)\cfb64enc.obj $(OBJ_D)\cfb64ede.obj \
  </code></pre>