Commit ac4ac88a authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

rsaenh: Use helper function to release and install a key into a crypt provider.

parent e099b80a
...@@ -3065,9 +3065,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP ...@@ -3065,9 +3065,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP
if (pCryptKey) { if (pCryptKey) {
new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen); new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen);
setup_key(pCryptKey); setup_key(pCryptKey);
RSAENH_CPDestroyKey(hProv, pKeyContainer->hSignatureKeyPair); release_and_install_key(hProv, *phKey,
copy_handle(&handle_table, *phKey, RSAENH_MAGIC_KEY, &pKeyContainer->hSignatureKeyPair,
&pKeyContainer->hSignatureKeyPair); FALSE);
} }
break; break;
...@@ -3077,9 +3077,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP ...@@ -3077,9 +3077,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP
if (pCryptKey) { if (pCryptKey) {
new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen); new_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen);
setup_key(pCryptKey); setup_key(pCryptKey);
RSAENH_CPDestroyKey(hProv, pKeyContainer->hKeyExchangeKeyPair); release_and_install_key(hProv, *phKey,
copy_handle(&handle_table, *phKey, RSAENH_MAGIC_KEY, &pKeyContainer->hKeyExchangeKeyPair,
&pKeyContainer->hKeyExchangeKeyPair); FALSE);
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment