From 956ef9bd4ed740c1de657d2e2429cab1fb47ca87 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 14 Aug 2016 16:22:59 +0200 Subject: [PATCH] CryptGenRandom() return status check added --- lib/TTLS/src/Method.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/TTLS/src/Method.cpp b/lib/TTLS/src/Method.cpp index 1637776..98017e0 100644 --- a/lib/TTLS/src/Method.cpp +++ b/lib/TTLS/src/Method.cpp @@ -155,7 +155,8 @@ eap::sanitizing_blob eap::method_ttls::make_pap_client() const WideCharToMultiByte(CP_UTF8, 0, cred->m_password.c_str(), (int)cred->m_password.length(), password_utf8, NULL, NULL); unsigned char rnd; - CryptGenRandom(m_cp, sizeof(rnd), &rnd); + if (!CryptGenRandom(m_cp, sizeof(rnd), &rnd)) + rnd = 0; size_t size_identity = identity_utf8.length(),