mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
Wine-0_9_1 vendor import. Changes for ReactOS by cwittich
svn path=/trunk/; revision=19310
This commit is contained in:
parent
fb3d16f5b7
commit
5f23f01a75
10 changed files with 10771 additions and 0 deletions
3315
reactos/lib/crypt32/cert.c
Normal file
3315
reactos/lib/crypt32/cert.c
Normal file
File diff suppressed because it is too large
Load diff
36
reactos/lib/crypt32/crypt32.def
Normal file
36
reactos/lib/crypt32/crypt32.def
Normal file
|
@ -0,0 +1,36 @@
|
|||
LIBRARY CRYPT32.DLL
|
||||
EXPORTS
|
||||
|
||||
CertAlgIdToOID@4 @1030
|
||||
|
||||
CertOIDToAlgId@4 @1095
|
||||
|
||||
CryptMemAlloc@4 @1175
|
||||
CryptMemFree@4 @1176
|
||||
CryptMemRealloc@8 @1177
|
||||
|
||||
CryptProtectData@28 @1193
|
||||
|
||||
CryptRegisterDefaultOIDFunction@16 @1195
|
||||
CryptSIPAddProvider@4 @1198
|
||||
|
||||
CryptSIPLoad@12 @1201
|
||||
CryptSIPRemoveProvider@4 @1203
|
||||
|
||||
CryptSIPRetrieveSubjectGuid@12 @1205
|
||||
|
||||
CryptUnprotectData@28 @1221
|
||||
|
||||
I_CryptCreateLruCache@8 @1240
|
||||
|
||||
I_CryptDetachTls@4 @1242
|
||||
|
||||
I_CryptFindLruEntryData@4 @1247
|
||||
|
||||
I_CryptFlushLruCache@4 @1249
|
||||
I_CryptFreeLruCache@4 @1250
|
||||
I_CryptFreeTls@8 @1251
|
||||
|
||||
I_CryptGetTls@4 @1260
|
||||
|
||||
I_CryptSetTls@8 @1268
|
7
reactos/lib/crypt32/crypt32.rc
Normal file
7
reactos/lib/crypt32/crypt32.rc
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* $Id$ */
|
||||
|
||||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Crypt\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "crypt32\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "crypt32.dll\0"
|
||||
#include <reactos/version.rc>
|
195
reactos/lib/crypt32/crypt32.spec
Normal file
195
reactos/lib/crypt32/crypt32.spec
Normal file
|
@ -0,0 +1,195 @@
|
|||
@ stdcall CertAddCRLContextToStore(long ptr long ptr)
|
||||
@ stdcall CertAddCTLContextToStore(long ptr long ptr)
|
||||
@ stdcall CertAddCertificateContextToStore(long ptr long ptr)
|
||||
@ stdcall CertAddEncodedCRLToStore(long long ptr long long ptr)
|
||||
@ stdcall CertAddEncodedCTLToStore(long long ptr long long ptr)
|
||||
@ stdcall CertAddEncodedCertificateToStore(long long ptr long long ptr)
|
||||
@ stub CertAddEncodedCertificateToSystemStoreA
|
||||
@ stub CertAddEncodedCertificateToSystemStoreW
|
||||
@ stub CertAddEnhancedKeyUsageIdentifier
|
||||
@ stdcall CertAddSerializedElementToStore(ptr ptr long long long long ptr ptr)
|
||||
@ stdcall CertAddStoreToCollection(ptr ptr long long)
|
||||
@ stdcall CertAlgIdToOID(long)
|
||||
@ stdcall CertCloseStore(ptr long)
|
||||
@ stub CertCompareCertificate
|
||||
@ stub CertCompareCertificateName
|
||||
@ stub CertCompareIntegerBlob
|
||||
@ stub CertComparePublicKeyInfo
|
||||
@ stdcall CertControlStore(long long long ptr)
|
||||
@ stdcall CertCreateCRLContext(long ptr long)
|
||||
@ stdcall CertCreateCTLContext(long ptr long)
|
||||
@ stub CertCreateCertificateChainEngine
|
||||
@ stdcall CertCreateCertificateContext(long ptr long)
|
||||
@ stdcall CertDeleteCRLFromStore(ptr)
|
||||
@ stdcall CertDeleteCTLFromStore(ptr)
|
||||
@ stdcall CertDeleteCertificateFromStore(ptr)
|
||||
@ stub CertDuplicateCRLContext
|
||||
@ stub CertDuplicateCTLContext
|
||||
@ stdcall CertDuplicateCertificateContext(ptr)
|
||||
@ stub CertDuplicateStore
|
||||
@ stub CertEnumCRLContextProperties
|
||||
@ stdcall CertEnumCRLsInStore(ptr ptr)
|
||||
@ stub CertEnumCTLContextProperties
|
||||
@ stdcall CertEnumCTLsInStore(ptr ptr)
|
||||
@ stdcall CertEnumCertificateContextProperties(ptr long)
|
||||
@ stdcall CertEnumCertificatesInStore(long ptr)
|
||||
@ stdcall CertFindAttribute(str long ptr)
|
||||
@ stub CertFindCTLInStore
|
||||
@ stdcall CertFindCertificateInStore(long long long long ptr ptr)
|
||||
@ stdcall CertFindExtension(str long ptr)
|
||||
@ stdcall CertFindRDNAttr(str ptr)
|
||||
@ stub CertFindSubjectInCTL
|
||||
@ stdcall CertFreeCRLContext(ptr)
|
||||
@ stdcall CertFreeCTLContext(ptr)
|
||||
@ stub CertFreeCertificateChain
|
||||
@ stub CertFreeCertificateChainEngine
|
||||
@ stdcall CertFreeCertificateContext(ptr)
|
||||
@ stdcall CertGetCRLContextProperty(ptr long ptr ptr)
|
||||
@ stub CertGetCRLFromStore
|
||||
@ stdcall CertGetCTLContextProperty(ptr long ptr ptr)
|
||||
@ stub CertGetCertificateChain
|
||||
@ stdcall CertGetCertificateContextProperty(ptr long ptr ptr)
|
||||
@ stub CertGetEnhancedKeyUsage
|
||||
@ stub CertGetIntendedKeyUsage
|
||||
@ stub CertGetIssuerCertificateFromStore
|
||||
@ stub CertGetPublicKeyLength
|
||||
@ stub CertGetSubjectCertificateFromStore
|
||||
@ stub CertIsRDNAttrsInCertificateName
|
||||
@ stub CertNameToStrA
|
||||
@ stub CertNameToStrW
|
||||
@ stdcall CertOIDToAlgId(str)
|
||||
@ stdcall CertOpenStore(str long long long ptr)
|
||||
@ stdcall CertOpenSystemStoreA(long str)
|
||||
@ stdcall CertOpenSystemStoreW(long wstr)
|
||||
@ stub CertRDNValueToStrA
|
||||
@ stub CertRDNValueToStrW
|
||||
@ stub CertRemoveEnhancedKeyUsageIdentifier
|
||||
@ stdcall CertRemoveStoreFromCollection(long long)
|
||||
@ stdcall CertSaveStore(long long long long ptr long)
|
||||
@ stdcall CertSerializeCRLStoreElement(ptr long ptr ptr)
|
||||
@ stdcall CertSerializeCTLStoreElement(ptr long ptr ptr)
|
||||
@ stdcall CertSerializeCertificateStoreElement(ptr long ptr ptr)
|
||||
@ stdcall CertSetCRLContextProperty(ptr long long ptr)
|
||||
@ stdcall CertSetCTLContextProperty(ptr long long ptr)
|
||||
@ stdcall CertSetCertificateContextProperty(ptr long long ptr)
|
||||
@ stub CertSetEnhancedKeyUsage
|
||||
@ stub CertStrToNameA
|
||||
@ stub CertStrToNameW
|
||||
@ stub CertVerifyCRLRevocation
|
||||
@ stub CertVerifyCRLTimeValidity
|
||||
@ stub CertVerifyCTLUsage
|
||||
@ stub CertVerifyRevocation
|
||||
@ stub CertVerifySubjectCertificateContext
|
||||
@ stdcall CertVerifyTimeValidity(ptr ptr)
|
||||
@ stub CertVerifyValidityNesting
|
||||
@ stub CreateFileU
|
||||
@ stub CryptAcquireContextU
|
||||
@ stub CryptCloseAsyncHandle
|
||||
@ stub CryptCreateAsyncHandle
|
||||
@ stub CryptDecodeMessage
|
||||
@ stdcall CryptDecodeObject(long str ptr long long ptr ptr)
|
||||
@ stdcall CryptDecodeObjectEx(long str ptr long long ptr ptr ptr)
|
||||
@ stub CryptDecryptAndVerifyMessageSignature
|
||||
@ stub CryptDecryptMessage
|
||||
@ stdcall CryptEncodeObject(long str ptr ptr ptr)
|
||||
@ stdcall CryptEncodeObjectEx(long str ptr long ptr ptr ptr)
|
||||
@ stub CryptEncryptMessage
|
||||
@ stub CryptEnumOIDFunction
|
||||
@ stub CryptEnumOIDInfo
|
||||
@ stub CryptEnumProvidersU
|
||||
@ stub CryptExportPKCS8
|
||||
@ stdcall CryptExportPublicKeyInfo(long long long ptr ptr)
|
||||
@ stdcall CryptExportPublicKeyInfoEx(long long long str long ptr ptr ptr)
|
||||
@ stub CryptFindOIDInfo
|
||||
@ stub CryptFormatObject
|
||||
@ stub CryptFreeOIDFunctionAddress
|
||||
@ stub CryptGetAsyncParam
|
||||
@ stub CryptGetDefaultOIDDllList
|
||||
@ stub CryptGetDefaultOIDFunctionAddress
|
||||
@ stub CryptGetMessageCertificates
|
||||
@ stub CryptGetMessageSignerCount
|
||||
@ stub CryptGetOIDFunctionAddress
|
||||
@ stdcall CryptGetOIDFunctionValue(long str str wstr ptr ptr ptr)
|
||||
@ stdcall CryptHashCertificate(long long long ptr long ptr ptr)
|
||||
@ stub CryptHashMessage
|
||||
@ stub CryptHashPublicKeyInfo
|
||||
@ stub CryptHashToBeSigned
|
||||
@ stub CryptImportPKCS8
|
||||
@ stdcall CryptImportPublicKeyInfo(long long ptr ptr)
|
||||
@ stdcall CryptImportPublicKeyInfoEx(long long ptr long long ptr ptr)
|
||||
@ stdcall CryptInitOIDFunctionSet(str long)
|
||||
@ stub CryptInstallOIDFunctionAddress
|
||||
@ stub CryptLoadSip
|
||||
@ stdcall CryptMemAlloc(long)
|
||||
@ stdcall CryptMemFree(ptr)
|
||||
@ stdcall CryptMemRealloc(ptr long)
|
||||
@ stub CryptMsgCalculateEncodedLength
|
||||
@ stub CryptMsgClose
|
||||
@ stub CryptMsgControl
|
||||
@ stub CryptMsgCountersign
|
||||
@ stub CryptMsgCountersignEncoded
|
||||
@ stub CryptMsgEncodeAndSignCTL
|
||||
@ stub CryptMsgGetAndVerifySigner
|
||||
@ stub CryptMsgGetParam
|
||||
@ stub CryptMsgOpenToDecode
|
||||
@ stub CryptMsgOpenToEncode
|
||||
@ stub CryptMsgSignCTL
|
||||
@ stub CryptMsgUpdate
|
||||
@ stub CryptMsgVerifyCountersignatureEncoded
|
||||
@ stdcall CryptProtectData(ptr wstr ptr ptr ptr long ptr)
|
||||
@ stdcall CryptRegisterDefaultOIDFunction(long str long wstr)
|
||||
@ stdcall CryptRegisterOIDFunction(long str str wstr str)
|
||||
@ stub CryptRegisterOIDInfo
|
||||
@ stdcall CryptSIPAddProvider(ptr)
|
||||
@ stdcall CryptSIPLoad(ptr long ptr)
|
||||
@ stdcall CryptSIPRemoveProvider(ptr)
|
||||
@ stdcall CryptSIPRetrieveSubjectGuid(wstr long ptr)
|
||||
@ stub CryptSetAsyncParam
|
||||
@ stdcall CryptSetOIDFunctionValue(long str str wstr long ptr long)
|
||||
@ stub CryptSetProviderU
|
||||
@ stub CryptSignAndEncodeCertificate
|
||||
@ stub CryptSignAndEncryptMessage
|
||||
@ stdcall CryptSignCertificate(long long long ptr long ptr ptr ptr ptr)
|
||||
@ stub CryptSignHashU
|
||||
@ stub CryptSignMessage
|
||||
@ stub CryptSignMessageWithKey
|
||||
@ stdcall CryptUnprotectData(ptr ptr ptr ptr ptr long ptr)
|
||||
@ stdcall CryptUnregisterDefaultOIDFunction(long str wstr)
|
||||
@ stdcall CryptUnregisterOIDFunction(long str str)
|
||||
@ stub CryptUnregisterOIDInfo
|
||||
@ stdcall CryptVerifyCertificateSignature(long long ptr long ptr)
|
||||
@ stdcall CryptVerifyCertificateSignatureEx(long long long ptr long ptr long ptr)
|
||||
@ stub CryptVerifyDetachedMessageHash
|
||||
@ stub CryptVerifyDetachedMessageSignature
|
||||
@ stub CryptVerifyMessageHash
|
||||
@ stub CryptVerifyMessageSignature
|
||||
@ stub CryptVerifyMessageSignatureWithKey
|
||||
@ stub CryptVerifySignatureU
|
||||
@ stdcall I_CryptAllocTls()
|
||||
@ stdcall I_CryptCreateLruCache(long long)
|
||||
@ stub I_CryptCreateLruEntry
|
||||
@ stdcall I_CryptDetachTls(long)
|
||||
@ stdcall I_CryptFindLruEntryData(long)
|
||||
@ stdcall I_CryptFlushLruCache(long)
|
||||
@ stdcall I_CryptFreeLruCache(long)
|
||||
@ stdcall I_CryptFreeTls(long long)
|
||||
@ stub I_CryptGetDefaultCryptProv
|
||||
@ stub I_CryptGetDefaultCryptProvForEncrypt
|
||||
@ stub I_CryptGetOssGlobal
|
||||
@ stdcall I_CryptGetTls(long)
|
||||
@ stub I_CryptInsertLruEntry
|
||||
@ stub I_CryptInstallOssGlobal
|
||||
@ stub I_CryptReleaseLruEntry
|
||||
@ stdcall I_CryptSetTls(long ptr)
|
||||
@ stub I_CryptUninstallOssGlobal
|
||||
@ stub PFXExportCertStore
|
||||
@ stub PFXImportCertStore
|
||||
@ stub RegCreateHKCUKeyExU
|
||||
@ stub RegCreateKeyExU
|
||||
@ stub RegDeleteValueU
|
||||
@ stub RegEnumValueU
|
||||
@ stub RegOpenHKCUKeyExU
|
||||
@ stub RegOpenKeyExU
|
||||
@ stub RegQueryInfoKeyU
|
||||
@ stub RegQueryValueExU
|
||||
@ stub RegSetValueExU
|
14
reactos/lib/crypt32/crypt32.xml
Normal file
14
reactos/lib/crypt32/crypt32.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<module name="crypt32" type="win32dll" baseaddress="${BASEADDRESS_CRYPT32}" installbase="system32" installname="crypt32.dll">
|
||||
<importlibrary definition="crypt32.def" />
|
||||
<include base="crypt32">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>ntdll</library>
|
||||
<library>kernel32</library>
|
||||
<library>wine</library>
|
||||
<library>advapi32</library>
|
||||
<file>main.c</file>
|
||||
<file>protectdata.c</file>
|
||||
<file>crypt32.rc</file>
|
||||
<pch>precomp.h</pch>
|
||||
</module>
|
27
reactos/lib/crypt32/crypt32_private.h
Normal file
27
reactos/lib/crypt32/crypt32_private.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright 2005 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __CRYPT32_PRIVATE_H__
|
||||
#define __CRYPT32_PRIVATE_H__
|
||||
|
||||
/* Returns a handle to the default crypto provider; loads it if necessary.
|
||||
* Returns NULL on failure.
|
||||
*/
|
||||
HCRYPTPROV CRYPT_GetDefaultProvider(void);
|
||||
|
||||
#endif
|
5688
reactos/lib/crypt32/encode.c
Normal file
5688
reactos/lib/crypt32/encode.c
Normal file
File diff suppressed because it is too large
Load diff
341
reactos/lib/crypt32/main.c
Normal file
341
reactos/lib/crypt32/main.c
Normal file
|
@ -0,0 +1,341 @@
|
|||
/*
|
||||
* Copyright 2002 Mike McCormack for CodeWeavers
|
||||
* Copyright 2005 Juan Lang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
|
||||
|
||||
static HCRYPTPROV hDefProv;
|
||||
|
||||
struct OIDToAlgID
|
||||
{
|
||||
LPCSTR oid;
|
||||
DWORD algID;
|
||||
};
|
||||
|
||||
static const struct OIDToAlgID oidToAlgID[] = {
|
||||
{ szOID_RSA_RSA, CALG_RSA_KEYX },
|
||||
{ szOID_RSA_MD2RSA, CALG_MD2 },
|
||||
{ szOID_RSA_MD4RSA, CALG_MD4 },
|
||||
{ szOID_RSA_MD5RSA, CALG_MD5 },
|
||||
{ szOID_RSA_SHA1RSA, CALG_SHA },
|
||||
{ szOID_RSA_DH, CALG_DH_SF },
|
||||
{ szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
|
||||
{ szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES },
|
||||
{ szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2 },
|
||||
{ szOID_RSA_MD2, CALG_MD2 },
|
||||
{ szOID_RSA_MD4, CALG_MD4 },
|
||||
{ szOID_RSA_MD5, CALG_MD5 },
|
||||
{ szOID_RSA_RC2CBC, CALG_RC2 },
|
||||
{ szOID_RSA_RC4, CALG_RC4 },
|
||||
{ szOID_RSA_DES_EDE3_CBC, CALG_3DES },
|
||||
{ szOID_ANSI_X942_DH, CALG_DH_SF },
|
||||
{ szOID_X957_DSA, CALG_DSS_SIGN },
|
||||
{ szOID_X957_SHA1DSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_md4RSA, CALG_MD4 },
|
||||
{ szOID_OIWSEC_md5RSA, CALG_MD5 },
|
||||
{ szOID_OIWSEC_md4RSA2, CALG_MD4 },
|
||||
{ szOID_OIWSEC_desCBC, CALG_DES },
|
||||
{ szOID_OIWSEC_dsa, CALG_DSS_SIGN },
|
||||
{ szOID_OIWSEC_shaDSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_shaRSA, CALG_SHA },
|
||||
{ szOID_OIWSEC_sha, CALG_SHA },
|
||||
{ szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX },
|
||||
{ szOID_OIWSEC_sha1, CALG_SHA },
|
||||
{ szOID_OIWSEC_dsaSHA1, CALG_SHA },
|
||||
{ szOID_OIWSEC_sha1RSASign, CALG_SHA },
|
||||
{ szOID_OIWDIR_md2RSA, CALG_MD2 },
|
||||
{ szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA },
|
||||
{ szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN },
|
||||
};
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
|
||||
{
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_DETACH:
|
||||
if (hDefProv) CryptReleaseContext(hDefProv, 0);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HCRYPTPROV CRYPT_GetDefaultProvider(void)
|
||||
{
|
||||
if (!hDefProv)
|
||||
CryptAcquireContextW(&hDefProv, NULL, MS_ENHANCED_PROV_W,
|
||||
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
|
||||
return hDefProv;
|
||||
}
|
||||
|
||||
/* this function is called by Internet Explorer when it is about to verify a downloaded component */
|
||||
BOOL WINAPI I_CryptCreateLruCache(DWORD x, DWORD y)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* these functions all have an unknown number of args */
|
||||
BOOL WINAPI I_CryptFindLruEntryData(DWORD x)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI I_CryptFlushLruCache(DWORD x)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI I_CryptFreeLruCache(DWORD x)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptSIPRemoveProvider(GUID *pgProv)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* convert a guid to a wide character string */
|
||||
static void CRYPT_guid2wstr( LPGUID guid, LPWSTR wstr )
|
||||
{
|
||||
char str[40];
|
||||
|
||||
sprintf(str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
|
||||
guid->Data1, guid->Data2, guid->Data3,
|
||||
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
|
||||
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
|
||||
MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, 40 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper for CryptSIPAddProvider
|
||||
*
|
||||
* Add a registry key containing a dll name and function under
|
||||
* "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\<func>\\<guid>"
|
||||
*/
|
||||
static LONG CRYPT_SIPWriteFunction( LPGUID guid, LPCWSTR szKey,
|
||||
LPCWSTR szDll, LPCWSTR szFunction )
|
||||
{
|
||||
static const WCHAR szOID[] = {
|
||||
'S','o','f','t','w','a','r','e','\\',
|
||||
'M','i','c','r','o','s','o','f','t','\\',
|
||||
'C','r','y','p','t','o','g','r','a','p','h','y','\\',
|
||||
'O','I','D','\\',
|
||||
'E','n','c','o','d','i','n','g','T','y','p','e',' ','0','\\',
|
||||
'C','r','y','p','t','S','I','P','D','l','l', 0 };
|
||||
static const WCHAR szBackSlash[] = { '\\', 0 };
|
||||
static const WCHAR szDllName[] = { 'D','l','l',0 };
|
||||
static const WCHAR szFuncName[] = { 'F','u','n','c','N','a','m','e',0 };
|
||||
WCHAR szFullKey[ 0x100 ];
|
||||
LONG r;
|
||||
HKEY hKey;
|
||||
|
||||
if( !szFunction )
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
/* max length of szFullKey depends on our code only, so we won't overrun */
|
||||
lstrcpyW( szFullKey, szOID );
|
||||
lstrcatW( szFullKey, szKey );
|
||||
lstrcatW( szFullKey, szBackSlash );
|
||||
CRYPT_guid2wstr( guid, &szFullKey[ lstrlenW( szFullKey ) ] );
|
||||
lstrcatW( szFullKey, szBackSlash );
|
||||
|
||||
TRACE("key is %s\n", debugstr_w( szFullKey ) );
|
||||
|
||||
r = RegCreateKeyW( HKEY_LOCAL_MACHINE, szFullKey, &hKey );
|
||||
if( r != ERROR_SUCCESS )
|
||||
return r;
|
||||
|
||||
/* write the values */
|
||||
RegSetValueExW( hKey, szFuncName, 0, REG_SZ, (const BYTE*) szFunction,
|
||||
( lstrlenW( szFunction ) + 1 ) * sizeof (WCHAR) );
|
||||
RegSetValueExW( hKey, szDllName, 0, REG_SZ, (const BYTE*) szDll,
|
||||
( lstrlenW( szDll ) + 1) * sizeof (WCHAR) );
|
||||
|
||||
RegCloseKey( hKey );
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptSIPAddProvider(SIP_ADD_NEWPROVIDER *psNewProv)
|
||||
{
|
||||
static const WCHAR szCreate[] = {
|
||||
'C','r','e','a','t','e',
|
||||
'I','n','d','i','r','e','c','t','D','a','t','a',0};
|
||||
static const WCHAR szGetSigned[] = {
|
||||
'G','e','t','S','i','g','n','e','d','D','a','t','a','M','s','g',0};
|
||||
static const WCHAR szIsMyFile[] = {
|
||||
'I','s','M','y','F','i','l','e','T','y','p','e', 0 };
|
||||
static const WCHAR szPutSigned[] = {
|
||||
'P','u','t','S','i','g','n','e','d','D','a','t','a','M','s','g',0};
|
||||
static const WCHAR szRemoveSigned[] = {
|
||||
'R','e','m','o','v','e',
|
||||
'S','i','g','n','e','d','D','a','t','a','M','s','g',0};
|
||||
static const WCHAR szVerify[] = {
|
||||
'V','e','r','i','f','y',
|
||||
'I','n','d','i','r','e','c','t','D','a','t','a',0};
|
||||
|
||||
TRACE("%p\n", psNewProv);
|
||||
|
||||
if( !psNewProv )
|
||||
return FALSE;
|
||||
|
||||
TRACE("%s %s %s %s\n",
|
||||
debugstr_guid( psNewProv->pgSubject ),
|
||||
debugstr_w( psNewProv->pwszDLLFileName ),
|
||||
debugstr_w( psNewProv->pwszMagicNumber ),
|
||||
debugstr_w( psNewProv->pwszIsFunctionName ) );
|
||||
|
||||
#define CRYPT_SIPADDPROV( key, field ) \
|
||||
CRYPT_SIPWriteFunction( psNewProv->pgSubject, key, \
|
||||
psNewProv->pwszDLLFileName, psNewProv->field)
|
||||
|
||||
CRYPT_SIPADDPROV( szGetSigned, pwszGetFuncName );
|
||||
CRYPT_SIPADDPROV( szPutSigned, pwszPutFuncName );
|
||||
CRYPT_SIPADDPROV( szCreate, pwszCreateFuncName );
|
||||
CRYPT_SIPADDPROV( szVerify, pwszVerifyFuncName );
|
||||
CRYPT_SIPADDPROV( szRemoveSigned, pwszRemoveFuncName );
|
||||
CRYPT_SIPADDPROV( szIsMyFile, pwszIsFunctionNameFmt2 );
|
||||
|
||||
#undef CRYPT_SIPADDPROV
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptSIPRetrieveSubjectGuid
|
||||
(LPCWSTR FileName, HANDLE hFileIn, GUID *pgSubject)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptSIPLoad
|
||||
(const GUID *pgSubject, DWORD dwFlags, SIP_DISPATCH_INFO *pSipDispatch)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD dwEncodingType,
|
||||
LPCSTR pszFuncName, DWORD dwIndex,
|
||||
LPCWSTR pwszDll)
|
||||
{
|
||||
FIXME("(%lx,%s,%lx,%s) stub!\n", dwEncodingType, pszFuncName, dwIndex,
|
||||
debugstr_w(pwszDll));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
|
||||
{
|
||||
switch (dwAlgId)
|
||||
{
|
||||
case CALG_RSA_KEYX:
|
||||
return szOID_RSA_RSA;
|
||||
case CALG_DH_EPHEM:
|
||||
return szOID_RSA_SMIMEalgESDH;
|
||||
case CALG_MD2:
|
||||
return szOID_RSA_MD2;
|
||||
case CALG_MD4:
|
||||
return szOID_RSA_MD4;
|
||||
case CALG_MD5:
|
||||
return szOID_RSA_MD5;
|
||||
case CALG_RC2:
|
||||
return szOID_RSA_RC2CBC;
|
||||
case CALG_RC4:
|
||||
return szOID_RSA_RC4;
|
||||
case CALG_3DES:
|
||||
return szOID_RSA_DES_EDE3_CBC;
|
||||
case CALG_DH_SF:
|
||||
return szOID_ANSI_X942_DH;
|
||||
case CALG_DSS_SIGN:
|
||||
return szOID_X957_DSA;
|
||||
case CALG_DES:
|
||||
return szOID_OIWSEC_desCBC;
|
||||
case CALG_SHA:
|
||||
return szOID_OIWSEC_sha1;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (pszObjId)
|
||||
{
|
||||
for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++)
|
||||
{
|
||||
if (!strcmp(pszObjId, oidToAlgID[i].oid))
|
||||
return oidToAlgID[i].algID;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, cbSize);
|
||||
}
|
||||
|
||||
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize)
|
||||
{
|
||||
return HeapReAlloc(GetProcessHeap(), 0, pv, cbSize);
|
||||
}
|
||||
|
||||
VOID WINAPI CryptMemFree(LPVOID pv)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pv);
|
||||
}
|
||||
|
||||
DWORD WINAPI I_CryptAllocTls(void)
|
||||
{
|
||||
return TlsAlloc();
|
||||
}
|
||||
|
||||
LPVOID WINAPI I_CryptDetachTls(DWORD dwTlsIndex)
|
||||
{
|
||||
LPVOID ret;
|
||||
|
||||
ret = TlsGetValue(dwTlsIndex);
|
||||
|
||||
TlsSetValue(dwTlsIndex, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
LPVOID WINAPI I_CryptGetTls(DWORD dwTlsIndex)
|
||||
{
|
||||
return TlsGetValue(dwTlsIndex);
|
||||
}
|
||||
|
||||
BOOL WINAPI I_CryptSetTls(DWORD dwTlsIndex, LPVOID lpTlsValue)
|
||||
{
|
||||
return TlsSetValue(dwTlsIndex, lpTlsValue);
|
||||
}
|
||||
|
||||
BOOL WINAPI I_CryptFreeTls(DWORD dwTlsIndex, DWORD unknown)
|
||||
{
|
||||
TRACE("(%ld, %ld)\n", dwTlsIndex, unknown);
|
||||
return TlsFree(dwTlsIndex);
|
||||
}
|
20
reactos/lib/crypt32/precomp.h
Normal file
20
reactos/lib/crypt32/precomp.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wincrypt.h"
|
||||
#include "winreg.h"
|
||||
#include "snmp.h"
|
||||
#include "winnls.h"
|
||||
#include "mssip.h"
|
||||
#include "crypt32_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/ntndk.h>
|
1128
reactos/lib/crypt32/protectdata.c
Normal file
1128
reactos/lib/crypt32/protectdata.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue