mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 18:42:14 +00:00
[RSAENH] Sync with Wine Staging 2.9. CORE-13362
e705dfc rsaenh: Don't import a public key to a key container. svn path=/trunk/; revision=74843
This commit is contained in:
parent
3a2d3f54c7
commit
81bce5b365
2 changed files with 5 additions and 18 deletions
|
@ -2826,15 +2826,14 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat
|
|||
/******************************************************************************
|
||||
* import_public_key [Internal]
|
||||
*
|
||||
* Import a BLOB'ed public key into a key container.
|
||||
* Import a BLOB'ed public key.
|
||||
*
|
||||
* PARAMS
|
||||
* hProv [I] Key container into which the public key is to be imported.
|
||||
* hProv [I] A CSP.
|
||||
* pbData [I] Pointer to a buffer which holds the public key BLOB.
|
||||
* dwDataLen [I] Length of data in buffer at pbData.
|
||||
* dwFlags [I] One of:
|
||||
* CRYPT_EXPORTABLE: the imported key is marked exportable
|
||||
* fStoreKey [I] If TRUE, the imported key is stored to the registry.
|
||||
* phKey [O] Handle to the imported key.
|
||||
*
|
||||
*
|
||||
|
@ -2847,9 +2846,8 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat
|
|||
* Failure: FALSE.
|
||||
*/
|
||||
static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen,
|
||||
DWORD dwFlags, BOOL fStoreKey, HCRYPTKEY *phKey)
|
||||
DWORD dwFlags, HCRYPTKEY *phKey)
|
||||
{
|
||||
KEYCONTAINER *pKeyContainer;
|
||||
CRYPTKEY *pCryptKey;
|
||||
const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData;
|
||||
const RSAPUBKEY *pRSAPubKey = (const RSAPUBKEY*)(pBlobHeader+1);
|
||||
|
@ -2862,8 +2860,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData
|
|||
SetLastError(NTE_BAD_FLAGS);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(pKeyContainer = get_key_container(hProv)))
|
||||
return FALSE;
|
||||
|
||||
if ((dwDataLen < sizeof(BLOBHEADER) + sizeof(RSAPUBKEY)) ||
|
||||
(pRSAPubKey->magic != RSAENH_MAGIC_RSA1) ||
|
||||
|
@ -2885,15 +2881,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData
|
|||
if (ret) {
|
||||
if (dwFlags & CRYPT_EXPORTABLE)
|
||||
pCryptKey->dwPermissions |= CRYPT_EXPORT;
|
||||
switch (pBlobHeader->aiKeyAlg)
|
||||
{
|
||||
case AT_KEYEXCHANGE:
|
||||
case CALG_RSA_KEYX:
|
||||
TRACE("installing public key\n");
|
||||
release_and_install_key(hProv, *phKey, &pKeyContainer->hKeyExchangeKeyPair,
|
||||
fStoreKey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -3107,7 +3094,7 @@ static BOOL import_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HC
|
|||
|
||||
case PUBLICKEYBLOB:
|
||||
return import_public_key(hProv, pbData, dwDataLen, dwFlags,
|
||||
fStoreKey, phKey);
|
||||
phKey);
|
||||
|
||||
case SIMPLEBLOB:
|
||||
return import_symmetric_key(hProv, pbData, dwDataLen, hPubKey,
|
||||
|
|
|
@ -162,7 +162,7 @@ reactos/dll/win32/riched20 # Synced to WineStaging-2.9
|
|||
reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.2
|
||||
reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/rsaenh # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/rsaenh # Synced to WineStaging-2.9
|
||||
reactos/dll/win32/sccbase # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/schannel # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/scrrun # Synced to WineStaging-2.2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue