黒翼猫はWin9x で動くOpenSSL 1.1.0を作れるか?その6
黒翼猫はWin9x で動くOpenSSL 1.1.0を作れるか?その1
黒翼猫はWin9x で動くOpenSSL 1.1.0を作れるか?その5
bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); buffer = rand_pool_add_begin(pool, bytes_needed); if (buffer != NULL) { size_t bytes = 0; /* poll the CryptoAPI PRNG */ if (CryptAcquireContextA(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT) != 0) { if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0) bytes = bytes_needed; else printf("W95:ABE3[%0x]\n",GetLastError()); CryptReleaseContext(hProvider, 0); rand_pool_add_end(pool, bytes, 8 * bytes); |
エラー原因を突き止めるために、色々出力してみた・ω・
W95:p0 W95:ABE4[80090009] W95:AB1[0] W95:ABE1[80090019] W95:AB4[0] W95:entropylen:32<0<32 W95:p0 W95:pT[48][dc0a00] W95:p0 W95:ABE4[80090009] |
CRYPT_SILENT
The application requests that the CSP not display any user interface (UI) for this context. If the CSP must display the UI to operate, the call fails and the NTE_SILENT_CONTEXT error code is set as the last error. In addition, if calls are made to CryptGenKey with the CRYPT_USER_PROTECTED flag with a context that has been acquired with the CRYPT_SILENT flag, the calls fail and the CSP sets NTE_SILENT_CONTEXT. |
if (CryptAcquireContextA(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT) != 0) { if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0) bytes = bytes_needed; CryptReleaseContext(hProvider, 0); CryptReleaseContext(hProvider, 0); |
C:\WINNT\Profiles\デスクトップ\opssl>openssl s_client -connect hogehoge.com:443 CONNECTED(000000B0) depth=2 C = JP, O = "SECOM Trust Systems CO.,LTD.", OU = Security Communication RootCA2 verify error:num=20:unable to get local issuer certificate verify return:1 depth=1 C = JP, O = "SECOM Trust Systems CO.,LTD.", CN = FujiSSL Public Validation Authority - G3 verify return:1 depth=0 CN = hogehoge.com verify return:1 --- Certificate chain 0 s:CN = hogehoge.com i:C = JP, O = "SECOM Trust Systems CO.,LTD.", CN = FujiSSL Public Validation Authority - G3 1 s:C = JP, O = "SECOM Trust Systems CO.,LTD.", CN = FujiSSL Public Validation Authority - G3 i:C = JP, O = "SECOM Trust Systems CO.,LTD.", OU = Security Communication RootCA2 2 s:C = JP, O = "SECOM Trust Systems CO.,LTD.", OU = Security Communication RootCA2 i:C = JP, O = SECOM Trust.net, OU = Security Communication RootCA1 --- Server certificate -----BEGIN CERTIFICATE----- : : -----END CERTIFICATE----- subject=CN = hogehoge.com issuer=C = JP, O = "SECOM Trust Systems CO.,LTD.", CN = FujiSSL Public Validation Authority - G3 --- Session-ID-ctx: Start Time: 1567572887 |
繋がりました・ω・
Comments