CryptGenRandom() return status check added

This commit is contained in:
Simon Rozman 2016-08-14 16:22:59 +02:00
parent f9c5f608d0
commit 956ef9bd4e

View File

@ -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(),