OpenSSL をビルドする

Visual C++ 2008 Express Edition でビルドできた.手順は C:\openssl-0.9.8k\INSTALL.W32 に従った.気になるのは Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions で配布されているバイナリインストーラを実行した場合と生成物が違っていること.

事前にすべきこと

  • ActivePerl をインストール
  • openssl-0.9.8k.tar.gz を /source/index.html から入手し,c:\ へ展開
  • 生成物の転送先 c:\openssl の作成

コマンドプロンプトへの入力

コマンドプロンプトの出力(省略あり)

c:\>cd c:\openssl-0.9.8k

C:\openssl-0.9.8k> perl Configure VC-WIN32 --prefix=C:/openssl/
Configuring for VC-WIN32
    no-camellia     [default]  OPENSSL_NO_CAMELLIA (skip dir)
    no-capieng      [default]  OPENSSL_NO_CAPIENG (skip dir)
    no-cms          [default]  OPENSSL_NO_CMS (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-mdc2         [default]  OPENSSL_NO_MDC2 (skip dir)
    no-montasm      [default]
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-seed         [default]  OPENSSL_NO_SEED (skip dir)
    no-shared       [default]
    no-zlib         [default]
    no-zlib-dynamic [default]
IsMK1MF=1
CC            =cl
CFLAG         =-DOPENSSL_THREADS  -DDSO_WIN32
EX_LIBS       =
CPUID_OBJ     =
BN_ASM        =bn_asm.o
DES_ENC       =des_enc.o fcrypt_b.o
AES_ASM_OBJ   =aes_core.o aes_cbc.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4_enc.o rc4_skey.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =
SHA1_OBJ_ASM  =
RMD160_OBJ_ASM=
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-0.9.8k>ms\do_masm.bat
Generating x86 for MASM assember
Bignum
AES
DES
"crypt(3)"
Blowfish
CAST5
RC4
MD5
SHA1
RIPEMD160
RC5\32
CPU-ID

C:\openssl-0.9.8k>perl util\mkfiles.pl  1>MINFO

C:\openssl-0.9.8k>perl util\mk1mf.pl VC-WIN32  1>ms\nt.mak

C:\openssl-0.9.8k>perl util\mk1mf.pl dll VC-WIN32  1>ms\ntdll.mak

C:\openssl-0.9.8k>perl util\mkdef.pl 32 libeay  1>ms\libeay32.def

C:\openssl-0.9.8k>perl util\mkdef.pl 32 ssleay  1>ms\ssleay32.def

C:\openssl-0.9.8k>"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.
bat"

C:\openssl-0.9.8k>nmake -f ms\ntdll.mak
(中略)
        link /nologo /subsystem:console /opt:ref /out:out32dll\openssl.exe @C:\D
OCUME~1\username\LOCALS~1\Temp\nm2E9.tmp
   ライブラリ tmp32dll\junk.lib とオブジェクト tmp32dll\junk.exp を作成中
        IF EXIST out32dll\openssl.exe.manifest mt -nologo -manifest out32dll\ope
nssl.exe.manifest -outputresource:out32dll\openssl.exe;1

C:\openssl-0.9.8k>nmake -f ms\ntdll.mak test
(中略)
client authentication
server authentication
depth=1 /C=AU/O=Dodgy Brothers/CN=Dodgy CA
depth=0 /C=AU/O=Dodgy Brothers/CN=Brother 1/CN=Brother 2
depth=1 /C=AU/O=Dodgy Brothers/CN=Dodgy CA
depth=0 /C=AU/O=Dodgy Brothers/CN=Brother 1/CN=Brother 2
TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
1 handshakes of 256 bytes done
passed all tests

C:\openssl-0.9.8k>nmake -f ms\ntdll.mak install
(中略)
Copying: out32dll/ssleay32.dll to C:/openssl/bin/ssleay32.dll
        perl util/copy.pl "out32dll\libeay32.dll" "C:\openssl\bin"
Copying: out32dll/libeay32.dll to C:/openssl/bin/libeay32.dll
        perl util/copy.pl "out32dll\ssleay32.lib" "C:\openssl\lib"
Copying: out32dll/ssleay32.lib to C:/openssl/lib/ssleay32.lib
        perl util/copy.pl "out32dll\libeay32.lib" "C:\openssl\lib"
Copying: out32dll/libeay32.lib to C:/openssl/lib/libeay32.lib

tree c:\openssl /f

生成物一覧.

C:\OPENSSL
│  openssl.cnf
│
├─bin
│      libeay32.dll
│      openssl.exe
│      ssleay32.dll
│
├─include
│  └─openssl
│          aes.h
│          applink.c
│          asn1.h
│          asn1t.h
│          asn1_mac.h
│          bio.h
│          blowfish.h
│          bn.h
│          buffer.h
│          cast.h
│          comp.h
│          conf.h
│          conf_api.h
│          crypto.h
│          des.h
│          des_old.h
│          dh.h
│          dsa.h
│          dso.h
│          dtls1.h
│          ebcdic.h
│          ec.h
│          ecdh.h
│          ecdsa.h
│          engine.h
│          err.h
│          evp.h
│          e_os2.h
│          hmac.h
│          idea.h
│          krb5_asn.h
│          kssl.h
│          lhash.h
│          md2.h
│          md4.h
│          md5.h
│          objects.h
│          obj_mac.h
│          ocsp.h
│          opensslconf.h
│          opensslv.h
│          ossl_typ.h
│          pem.h
│          pem2.h
│          pkcs12.h
│          pkcs7.h
│          pqueue.h
│          pq_compat.h
│          rand.h
│          rc2.h
│          rc4.h
│          ripemd.h
│          rsa.h
│          safestack.h
│          sha.h
│          ssl.h
│          ssl2.h
│          ssl23.h
│          ssl3.h
│          stack.h
│          store.h
│          symhacks.h
│          tls1.h
│          tmdiff.h
│          txt_db.h
│          ui.h
│          ui_compat.h
│          x509.h
│          x509v3.h
│          x509_vfy.h
│
└─lib
        libeay32.lib
        ssleay32.lib