From 81bce5b3659ad48e71a78ede0f16efec912062e5 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 3 Jun 2017 22:38:03 +0000 Subject: [PATCH] [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 --- reactos/dll/win32/rsaenh/rsaenh.c | 21 ++++----------------- reactos/media/doc/README.WINE | 2 +- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/reactos/dll/win32/rsaenh/rsaenh.c b/reactos/dll/win32/rsaenh/rsaenh.c index f6ae5057e2e..bb28c999ae6 100644 --- a/reactos/dll/win32/rsaenh/rsaenh.c +++ b/reactos/dll/win32/rsaenh/rsaenh.c @@ -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, diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index b63e99a0d8b..74f7811464a 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -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 -- 2.17.1