return NULL;
}
ret = CryptAcquireContext(&info->hCryptProv,
- NULL,
+ L"MSTSC",
MS_ENHANCED_PROV,
PROV_RSA_FULL,
0);
if (!ret)
+ {
+ dwErr = GetLastError();
+ if (dwErr == NTE_BAD_KEYSET)
+ {
+ ret = CryptAcquireContext(&info->hCryptProv,
+ L"MSTSC",
+ MS_ENHANCED_PROV,
+ PROV_RSA_FULL,
+ CRYPT_NEWKEYSET);
+ }
+ }
+ if (!ret)
{
dwErr = GetLastError();
error("CryptAcquireContext failed with %lx\n", dwErr);
return NULL;
}
ret = CryptAcquireContext(&info->hCryptProv,
- NULL,
+ L"MSTSC",
MS_ENHANCED_PROV,
PROV_RSA_FULL,
0);
if (!ret)
+ {
+ dwErr = GetLastError();
+ if (dwErr == NTE_BAD_KEYSET)
+ {
+ ret = CryptAcquireContext(&info->hCryptProv,
+ L"MSTSC",
+ MS_ENHANCED_PROV,
+ PROV_RSA_FULL,
+ CRYPT_NEWKEYSET);
+ }
+ }
+ if (!ret)
{
dwErr = GetLastError();
g_free(info);
return;
}
ret = CryptAcquireContext(&hCryptProv,
- NULL,
+ L"MSTSC",
MS_ENHANCED_PROV,
PROV_RSA_FULL,
0);
if (!ret)
+ {
+ dwErr = GetLastError();
+ if (dwErr == NTE_BAD_KEYSET)
+ {
+ ret = CryptAcquireContext(&hCryptProv,
+ L"MSTSC",
+ MS_ENHANCED_PROV,
+ PROV_RSA_FULL,
+ CRYPT_NEWKEYSET);
+ }
+ }
+ if (!ret)
{
dwErr = GetLastError();
g_free(blob);
{
return 1;
}
+ md5 = rdssl_md5_info_create();
+ if (!md5)
+ {
+ return 1;
+ }
key = (char*)xmalloc(176);
md5_final = (char*)xmalloc(64);
- md5 = rdssl_md5_info_create();
// copy the test key
memcpy(key, testkey, 176);
// replace e and n