Support for read-only configurations added

This commit is contained in:
2016-06-20 14:51:21 +02:00
parent 2f0948b4fd
commit e52b9a636f
28 changed files with 998 additions and 615 deletions

View File

@@ -280,7 +280,10 @@ bool eap::credentials_pass::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR
return false;
}
m_identity = cred->UserName;
if (cred->UserName)
m_identity = cred->UserName;
else
m_identity.clear();
// Decrypt the password using user's key.
string password_base64;

View File

@@ -150,7 +150,7 @@ bool eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void
vector<unsigned char, sanitizing_allocator<unsigned char> > buf(size);
memcpy(buf.data(), data, size);
if (!CryptGetKeyParam(key, KP_BLOCKLEN, dwBlockLen, 0)) dwBlockLen = 0;
buf.reserve((size + dwBlockLen - 1) / dwBlockLen * dwBlockLen);
buf.reserve(std::max<size_t>((size + dwBlockLen - 1) / dwBlockLen, 1) * dwBlockLen);
// Encrypt the data using our public key.
if (!CryptEncrypt(key, hHash, TRUE, 0, buf)) {