2020年3月21日土曜日

OpenSSL1.1.1c(TLS.1.3対応版)のビルド(VisualStudio 2017版)

【ビルド環境】
Visual Studio Pro 2017

【準備】
1)「Visual Studio 2017 Professional」をインストールする。
1-1)
VisualStudioインストーラを起動(vs_professional__515800772.1574310941.exe)
1-2)
インストールコンソールから、「C++によるデスクトップ開発」を選択
1-3)
「全部ダウンロードしてから、インストールする」を選択
1-4)
インストールパッケージを30分程度でダウンロードする
1-5)
ダウンロード後、60分程度でインストールを実行する

2)Perlインストール
2-1) Perlをインストールする。選択肢はデフォルトで実施。
link:https://www.activestate.com/activeperl/downloads

5.26より新しいのActiivePerlは、VC-WIN32をサポートしていない。
そのため、ActivePerlを使う場合は、5.26以前のActivePerlを使う必要がある。

2-2)コマンドプロンプト上でバージョン確認。
perl --version

3)NASMインストール
3-1)NASMをインストールする。
link:http://www.nasm.us/
3-2)nasmのzipをダウンロードし、解凍する。
※openSSLビルド環境構築先が、Win10x64なので、nasm-2.14.02-win64.zipをダウンロード。
3-3)NASMのインストール先フォルダを、環境変数の「Path」に追加する。
3-4)コマンドプロンプト上でバージョン確認。
nasm --version

4)OpenSSL
3-1)OpenSSLのソースコードをダウンロードする。
link:https://www.openssl.org/source

3-2) OpenSSLのソースコードを解凍する。
解凍先例:C:\build_openssl\openssl-1.1.1c

3-3)OpenSSLコンパイル生成先フォルダを作成する。
例:C:\build_openssl\output\openssl_v1.1.1c\win\x86

【ビルド手順】
1) スタートメニューから「VS 2017 用 x64_x86 Cross Tools コマンド プロンプト」を起動する。
2) cdコマンドでOpenSSLのソースコードのフォルダへ移動する。
コマンド例)cd C:\build_openssl\openssl-1.1.1c

3) perlのコマンドを実行する。
コマンド例)perl Configure VC-WIN32 --prefix=C:/build_openssl/output/openssl_v1.1.1c/win/x86 --openssldir="C:/build_openssl/output/openssl_v1.1.1c/win/x86/SSL"
→Configure VC-WIN32:Windwos32ビット版OpenSSLがビルドする。今回はWindwos32ビット版のOpenSSLが必要だったので、こっちを指定する。
→--prefix:OpenSSLビルド生成物の格納先を指定する。
→--openssldir:後述のエラーメッセージ2対応方法参照。

蛇足だが、Visual C++ランタイムを静的リンクする際は、以下のコマンドでできるみたい。
コマンド例)perl Configure VC-WIN32 --prefix=C:/build_openssl/output/openssl_v1.1.1c/win/x86 --openssldir="C:/build_openssl/output/openssl_v1.1.1c/win/x86/SSL" "CFLAGS=/W3 /wd4090 /nologo /O2 /WX /MT"

"CFLAGS=/MT"の指定は、C:\build_openssl\openssl-1.1.1c\makefileのCFLAGSの設定になるみたい。

以下のエラーメッセージが出た場合。
>It looks like you don't have either nmake.exe or dmake.exe on your PATH,
>so you will not be able to execute the commands from a Makefile.  You can
>install dmake.exe with the Perl Package Manager by running:
>    ppm install dmake

ppm install dmakeを実行する。

4) nmake installを実行する。

■エラーメッセージ1
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional>cd C:\build_openssl\openssl-1.1.1c
C:\build_openssl\openssl-1.1.1c>perl Configure VC-WIN32 --prefix=C:/build_openssl/output/openssl_v1.1.1c/win/x86 "CFLAGS=/W3 /wd4090 /nologo /O2 /WX /MT"
Configuring OpenSSL version 1.1.1c (0x1010103fL) for VC-WIN32
Using os-specific seed configuration
Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: C:/build_openssl/openssl-1.1.1c/util/perl C:/Perl64/site/lib C:/Perl64/lib) at C:/Perl64/lib/ActivePerl/Config.pm line 400.
Compilation failed in require at C:/Perl64/site/lib/ExtUtils/MakeMaker.pm line 9.
BEGIN failed--compilation aborted at C:/Perl64/site/lib/ExtUtils/MakeMaker.pm line 9.
Compilation failed in require at C:/Perl64/site/lib/IPC/Cmd.pm line 235.

■エラーメッセージ1対応方法
https://qiita.com/takehiakihiro@github/items/97b1b1b9f28a563cc920

[対応方法1]
5.26より新しいのActiivePerlは、VC-WIN32をサポートしていない。
そのため、ActivePerlを使う場合は、5.26以前のActivePerlを使う必要がある。

[対応方法2]
ActivePerlを使えない場合、Strawberry Perlに切り替え

■エラーメッセージ2
*** Installing runtime programs
Copying: apps//openssl.exe to C:/build_openssl/output/openssl_v1.1.1c/win/x86/bin/openssl.exe
Copying: apps//openssl.pdb to C:/build_openssl/output/openssl_v1.1.1c/win/x86/bin/openssl.pdb
Copying: ./tools/c_rehash.pl to C:/build_openssl/output/openssl_v1.1.1c/win/x86/bin/c_rehash.pl
Cannot create directory C:/Program Files (x86)/Common Files/SSL: No such file or directory
NMAKE : fatal error U1077: 'C:\Perl64\bin\perl.exe' : リターン コード '0x2'
Stop.

■エラーメッセージ2対応方法
https://github.com/openssl/openssl/issues/6072
回避策は--openssldir="D:\target\dir\SSL"、perl.exeコマンドを呼び出すときにパラメーターを追加することです。
perl Configure VC-WIN32 --prefix=C:/build_openssl/output/openssl_v1.1.1c/win/x86 "CFLAGS=/W3 /wd4090 /nologo /O2 /WX /MT"
↓(修正後)
perl Configure VC-WIN32 --prefix=C:/build_openssl/output/openssl_v1.1.1c/win/x86 --openssldir="C:/build_openssl/output/openssl_v1.1.1c/win/x86/SSL" "CFLAGS=/W3 /wd4090 /nologo /O2 /WX /MT"

【参考サイト】
ビルド時のコマンド
https://www.sumirelab.com/docs/tech/windows-%E3%81%A7-openssl-%E3%81%AE%E3%83%93%E3%83%AB%E3%83%89%E3%83%A1%E3%83%A2/

生成物について
http://lfsbookja.osdn.jp/svn-sysdja/chapter06/openssl.html

Visual C++ランタイムの静的リンク
https://www.picolix.jp/blog/2018/12/openssl-111a-tls-13-smail-tls-13.html

【その他】
OpenSSLに使ったビルドツール
https://drive.google.com/drive/folders/1FMBJtZEL_90vF4XXDgXYxaUjxVDJdYLx

2020年3月9日月曜日

<仕事・備忘録>委託プロジェクト実績報告書の発見欠陥数

仕事で2度忘れていた。備忘録する。

発見欠陥数はαを計上すること

■指摘事項分類
α 欠陥(障害ARになるもの)であり、修正が必要なもの
β (障害ARになる)欠陥ではないが修正が必要なもの
γ 修正不要、または修正は作成者の判断に委ねるもの

2020年3月7日土曜日

実績のつけ方

.実績の算出
→設計書:ページ数
 →Word文書:変更があるページ数
  →例えば、あるページの1行を変更した場合、1ページと換算する
 →Excel文書:変更があるシート数
  →例えば、あるシートの1行を変更した場合、シートを1ページと換算する
→ソースコード:ステップ数
  →新規ステップ数+変更ステップ数+削除ステップ
  →かぞえちぇおで修正前と修正後の差分(新規・変更・削除)のステップ数がでる
         →かぞえちゃお
            新規:新規ステップ数
            変更:修正ステップ数
            削除:削除ステップ数

参考
https://qiita.com/bremen/items/ba5b671cb33fe6029cf5




2020年3月5日木曜日

VisualStudio2008でboostv1.72.0をビルドしてみた(途中)

VisualStudio2008によるboostV1.72.0の ビルド手順を記載する。

■前提

・Windwos10 Pro
・VisualStudio2009 Pro版SP無し
・boostv1.72.0をダウンロードする
   https://www.boost.org/users/download/


■手順
1.bootstrap.batの実行
以下手順で、コマンドプロンプトを起動する
スタート > Microsoft Visual Studio 2008 > Visual Studio 2008 コマンド プロンプト

2.> cd <解凍したディレクトリ>


3.以下のコマンドを実行する

bootstrap.bat

以下のエラーメッセージが表示される
-----------------------------------------------------------------------------
Building Boost.Build engine
ファイルが見つかりません

Failed to build Boost.Build engine.


Please consult bootstrap.log for further diagnostics.
------------------------------------------------------------------------------

4.bootstrap.batの同階層フォロダにbootstrap.logが生成される。

  bootstrap.logに以下、error1,error2,error3が出力される。

error1

------------------------------------------------------------------------------
c:\build_trial\boost_1_72_0\tools\build\src\engine\sysinfo.h(41) : error C2864: 'b2::system_info::cpu_core_count_' : static const int データ メンバ以外をクラス内で初期化することはできません
------------------------------------------------------------------------------

error2

------------------------------------------------------------------------------
c:\build_trial\boost_1_72_0\tools\build\src\engine\sysinfo.h(42) : error C2864: 'b2::system_info::cpu_thread_count_' : static const int データ メンバ以外をクラス内で初期化することはできません
------------------------------------------------------------------------------

error3

------------------------------------------------------------------------------
sysinfo.cpp(10) : fatal error C1083: include ファイルを開けません。'thread': No such file or directory

------------------------------------------------------------------------------ 


error1・error2の直し方

boost_1_72_0\tools\build\src\engine\sysinfo.h
sysinfo.h
[before]
------------------------------------------------------------------------------

        unsigned int cpu_core_count_ = 0;

        unsigned int cpu_thread_count_ = 0;


------------------------------------------------------------------------------

[after]

------------------------------------------------------------------------------

        unsigned int cpu_core_count_;

        unsigned int cpu_thread_count_;


------------------------------------------------------------------------------


boost_1_72_0\tools\build\src\engine\sysinfo.cpp
sysinfo.cpp
[before]
------------------------------------------------------------------------------

b2::system_info::system_info()
{
}




------------------------------------------------------------------------------

[after]

------------------------------------------------------------------------------

b2::system_info::system_info()

{

    cpu_core_count_ = 0;

    cpu_thread_count_ = 0;

}

------------------------------------------------------------------------------

error3の直し方
[before]
------------------------------------------------------------------------------

#include
...(省略)
    unsigned int std_thread_hardware_concurrency()
    {
        return std::thread::hardware_concurrency();
    }
------------------------------------------------------------------------------


[after]
------------------------------------------------------------------------------

// #include 
...(省略)
    unsigned int std_thread_hardware_concurrency()
    {
        //return std::thread::hardware_concurrency();
        return 0;//この値は処理系のスレット上限になるみたい
    }
------------------------------------------------------------------------------


■補足
Visual Studo2008にてBoost1.72.0のコンパイルに失敗するケースがある。
要因はboostのバグ。

修正差分コード

2020年3月1日日曜日

ff14 侍

■Level25の戦い方
刃風→陣風→結果:与ダーメジUpバッフ
刃風→士風→結果:攻撃間隔短Upバッフ

遠距離攻撃:燕飛

■Level25の戦い方
刃風→陣風→月光→結果:「月」の閃が付与

前提:「月」の閃
「抜刀術」→「彼岸花」

範囲攻撃:風雅
※敵が3体以上の時連続して使う

■Level45の戦い方
刃風→陣風→花車→結果:「花」の閃が付与

前提:「月」「花」の閃
「抜刀術」→「天下五剣」

敵が3体以上の時使う。
風雅→満月→結果:「月」の閃が付与
風雅→桜花→結果:「花」の閃が付与

■Level50の戦い方
雪風→結果:「雪」の閃が付与

明鏡止水
→コンボ状態に関係なく、月光、花車、雪風の発動時に閃を付与。

乱れ雪月花
→「月」「花」「雪」の閃が溜まった状態で発動可能。

■Level50のスキル回し
刃風→士風→花車
刃風→陣風→月光
明鏡止水→雪風→乱れ雪月花
月光→彼岸花→月光
刃風→士風→花車
刃風→雪風→乱れ雪月花
刃風→陣風→月光
刃風→雪風
刃風→士風→花車
乱れ雪月花
刃風→陣風→月光
刃風→雪風
刃風→士風→花車
乱れ雪月花
明鏡止水→雪風
彼岸花
月光→花車
刃風→雪風→乱れ雪月花