From 66716376b1c48c7aef8f173cac13d1f3b775959d Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Sat, 13 Jun 2020 17:48:02 +0900 Subject: [PATCH] Azure App Service requires CRYPT_MACHINE_KEYSET --- include/cybozu/random_generator.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cybozu/random_generator.hpp b/include/cybozu/random_generator.hpp index 375db06..d0627f8 100644 --- a/include/cybozu/random_generator.hpp +++ b/include/cybozu/random_generator.hpp @@ -34,8 +34,8 @@ public: : prov_(0) , pos_(bufSize) { - DWORD flagTbl[] = { 0, CRYPT_NEWKEYSET }; - for (int i = 0; i < 2; i++) { + DWORD flagTbl[] = { 0, CRYPT_NEWKEYSET, CRYPT_MACHINE_KEYSET }; + for (int i = 0; i < 3; i++) { if (CryptAcquireContext(&prov_, NULL, NULL, PROV_RSA_FULL, flagTbl[i]) != 0) return; } #ifdef CYBOZU_DONT_USE_EXCEPTION