[RSAENH] Sync with Wine Staging 2.9. CORE-13362
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:38:03 +0000 (22:38 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:38:03 +0000 (22:38 +0000)
e705dfc rsaenh: Don't import a public key to a key container.

svn path=/trunk/; revision=74843

reactos/dll/win32/rsaenh/rsaenh.c
reactos/media/doc/README.WINE

index f6ae505..bb28c99 100644 (file)
@@ -2826,15 +2826,14 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat
 /******************************************************************************
  * import_public_key [Internal]
  *
 /******************************************************************************
  * import_public_key [Internal]
  *
- * Import a BLOB'ed public key into a key container.
+ * Import a BLOB'ed public key.
  *
  * PARAMS
  *
  * 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
  *  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.
  *
  *
  *  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,
  *  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);
     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;
     }
         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) ||
 
     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;
     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;
 }
     }
     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,
                 
         case PUBLICKEYBLOB:
             return import_public_key(hProv, pbData, dwDataLen, dwFlags,
-                                     fStoreKey, phKey);
+                                     phKey);
                 
         case SIMPLEBLOB:
             return import_symmetric_key(hProv, pbData, dwDataLen, hPubKey,
                 
         case SIMPLEBLOB:
             return import_symmetric_key(hProv, pbData, dwDataLen, hPubKey,
index b63e99a..74f7811 100644 (file)
@@ -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/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
 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