Commit 64dce8a5 authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard

Implemented a substantial part of rsaenh.dll.

parent 8ce698e2
......@@ -1174,6 +1174,11 @@ AC_CHECK_HEADERS(\
netinet/in_systm.h \
netinet/tcp.h \
netinet/tcp_fsm.h \
openssl/des.h \
openssl/md2.h \
openssl/rc2.h \
openssl/rc4.h \
openssl/rsa.h \
openssl/ssl.h \
process.h \
pthread.h \
......@@ -1686,6 +1691,8 @@ dlls/rpcrt4/Makefile
dlls/rpcrt4/tests/Makefile
dlls/rsabase/Makefile
dlls/rsabase/tests/Makefile
dlls/rsaenh/Makefile
dlls/rsaenh/tests/Makefile
dlls/secur32/Makefile
dlls/serialui/Makefile
dlls/setupapi/Makefile
......
......@@ -110,6 +110,7 @@ BASEDIRS = \
richedit \
rpcrt4 \
rsabase \
rsaenh \
secur32 \
serialui \
setupapi \
......@@ -348,6 +349,7 @@ SYMLINKS_SO = \
riched32.dll.so \
rpcrt4.dll.so \
rsabase.dll.so \
rsaenh.dll.so \
secur32.dll.so \
serialui.dll.so \
setupapi.dll.so \
......@@ -777,6 +779,9 @@ rpcrt4.dll.so: rpcrt4/rpcrt4.dll.so
rsabase.dll.so: rsabase/rsabase.dll.so
$(RM) $@ && $(LN_S) rsabase/rsabase.dll.so $@
rsaenh.dll.so: rsaenh/rsaenh.dll.so
$(RM) $@ && $(LN_S) rsaenh/rsaenh.dll.so $@
secur32.dll.so: secur32/secur32.dll.so
$(RM) $@ && $(LN_S) secur32/secur32.dll.so $@
......@@ -1069,6 +1074,7 @@ IMPORT_LIBS = \
libriched32.$(IMPLIBEXT) \
librpcrt4.$(IMPLIBEXT) \
librsabase.$(IMPLIBEXT) \
librsaenh.$(IMPLIBEXT) \
libsecur32.$(IMPLIBEXT) \
libserialui.$(IMPLIBEXT) \
libsetupapi.$(IMPLIBEXT) \
......@@ -1571,6 +1577,11 @@ librsabase.def: rsabase/rsabase.spec.def
librsabase.a: rsabase/rsabase.spec.def
$(DLLTOOL) -k -l $@ -d rsabase/rsabase.spec.def
librsaenh.def: rsaenh/rsaenh.spec.def
$(RM) $@ && $(LN_S) rsaenh/rsaenh.spec.def $@
librsaenh.a: rsaenh/rsaenh.spec.def
$(DLLTOOL) -k -l $@ -d rsaenh/rsaenh.spec.def
libsecur32.def: secur32/secur32.spec.def
$(RM) $@ && $(LN_S) secur32/secur32.spec.def $@
libsecur32.a: secur32/secur32.spec.def
......@@ -1833,6 +1844,7 @@ rasapi32/rasapi32.spec.def: $(WINEBUILD)
richedit/riched32.spec.def: $(WINEBUILD)
rpcrt4/rpcrt4.spec.def: $(WINEBUILD)
rsabase/rsabase.spec.def: $(WINEBUILD)
rsaenh/rsaenh.spec.def: $(WINEBUILD)
secur32/secur32.spec.def: $(WINEBUILD)
serialui/serialui.spec.def: $(WINEBUILD)
setupapi/setupapi.spec.def: $(WINEBUILD)
......@@ -1981,6 +1993,7 @@ rasapi32/rasapi32.dll.so: rasapi32
richedit/riched32.dll.so: richedit
rpcrt4/rpcrt4.dll.so: rpcrt4
rsabase/rsabase.dll.so: rsabase
rsaenh/rsaenh.dll.so: rsaenh
secur32/secur32.dll.so: secur32
serialui/serialui.dll.so: serialui
setupapi/setupapi.dll.so: setupapi
......
Makefile
rsaenh.dll.dbg.c
rsaenh.spec.def
EXTRADEFS = -DCOM_NO_WINDOWS_H
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = rsaenh.dll
IMPORTS = advapi32 kernel32
C_SRCS = \
handle.c \
implossl.c \
rsaenh.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
/*
* dlls/rsaenh/handle.h
* Support code to manage HANDLE tables.
*
* Copyright 1998 Alexandre Julliard
* Copyright 2002-2004 Mike McCormack for CodeWeavers
* Copyright 2004 Michael Jung
*
* 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 __WINE_HANDLE_H
#define __WINE_HANDLE_H
#ifdef __cplusplus
extern "C" {
#endif
#define TABLE_SIZE_INCREMENT 32
struct tagOBJECTHDR;
typedef struct tagOBJECTHDR OBJECTHDR;
typedef void (*DESTRUCTOR)(OBJECTHDR *object);
struct tagOBJECTHDR
{
DWORD dwType;
UINT refcount;
DESTRUCTOR destructor;
};
typedef struct tagHANDLETABLEENTRY
{
OBJECTHDR *pObject;
unsigned int iNextFree;
} HANDLETABLEENTRY;
typedef struct tagHANDLETABLE
{
unsigned int iEntries;
unsigned int iFirstFree;
HANDLETABLEENTRY *paEntries;
CRITICAL_SECTION mutex;
} HANDLETABLE;
int alloc_handle_table (HANDLETABLE **lplpTable);
void init_handle_table (HANDLETABLE *lpTable);
void release_all_handles (HANDLETABLE *lpTable);
int release_handle_table(HANDLETABLE *lpTable);
void destroy_handle_table(HANDLETABLE *lpTable);
int alloc_handle (HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int *lpHandle);
int release_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType);
int copy_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType, unsigned int *copy);
int lookup_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType, OBJECTHDR **lplpObject);
int is_valid_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType);
unsigned int new_object (HANDLETABLE *lpTable, size_t cbSize, DWORD dwType, DESTRUCTOR destructor,
OBJECTHDR **ppObject);
#ifdef __cplusplus
}
#endif
#endif /* __WINE_HANDLE_H */
/*
* dlls/rsaenh/implossl.h
* Encapsulating the OpenSSL dependend parts of RSABASE
*
* Copyright (c) 2004 Michael Jung
*
* based on code by Mike McCormack and David Hammerton
*
* 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 __WINE_IMPLOSSL_H
#define __WINE_IMPLOSSL_H
#ifdef HAVE_OPENSSL_MD2_H
#include <openssl/md2.h>
#endif
#ifdef HAVE_OPENSSL_RC2_H
#include <openssl/rc2.h>
#endif
#ifdef HAVE_OPENSSL_RC4_H
#include <openssl/rc4.h>
#endif
#ifdef HAVE_OPENSSL_DES_H
#include <openssl/des.h>
#endif
#ifdef HAVE_OPENSSL_RSA_H
#include <openssl/rsa.h>
#endif
/* Next typedef copied from dlls/advapi32/crypt_md4.c */
typedef struct tagMD4_CTX {
unsigned int buf[4];
unsigned int i[2];
unsigned char in[64];
unsigned char digest[16];
} MD4_CTX;
/* Next typedef copied from dlls/advapi32/crypt_md5.c */
typedef struct tagMD5_CTX
{
unsigned int i[2];
unsigned int buf[4];
unsigned char in[64];
unsigned char digest[16];
} MD5_CTX;
/* Next typedef copied form dlls/advapi32/crypt_sha.c */
typedef struct tagSHA_CTX
{
ULONG Unknown[6];
ULONG State[5];
ULONG Count[2];
UCHAR Buffer[64];
} SHA_CTX, *PSHA_CTX;
typedef union tagHASH_CONTEXT {
#ifdef HAVE_OPENSSL_MD2_H
MD2_CTX md2;
#endif
MD4_CTX md4;
MD5_CTX md5;
SHA_CTX sha;
} HASH_CONTEXT;
typedef union tagKEY_CONTEXT {
#ifdef HAVE_OPENSSL_RC2_H
RC2_KEY rc2;
#endif
#ifdef HAVE_OPENSSL_RC4_H
RC4_KEY rc4;
#endif
#ifdef HAVE_OPENSSL_DES_H
DES_key_schedule des[3];
#endif
#ifdef HAVE_OPENSSL_RSA_H
RSA *rsa;
#endif
DWORD dwDummy;
} KEY_CONTEXT;
BOOL load_lib(void);
BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext);
BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, CONST BYTE *pbData,
DWORD dwDataLen);
BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue);
BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext,
HASH_CONTEXT *pDestHashContext);
BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen);
BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext);
BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwSaltLen,
BYTE *abKeyValue);
BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext,
KEY_CONTEXT *pDestKeyContext);
BOOL encrypt_block_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, CONST BYTE *pbIn, BYTE *pbOut,
DWORD enc);
BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen);
BOOL export_public_key_impl(BYTE *pbDest, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
DWORD *pdwPubExp);
BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
DWORD dwPubExp);
BOOL export_private_key_impl(BYTE *pbDest, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
DWORD *pdwPubExp);
BOOL import_private_key_impl(CONST BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
DWORD dwPubExp);
BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen);
#endif /* __WINE_IMPLOSSL_H */
@ stdcall CPAcquireContext(ptr str long ptr) RSAENH_CPAcquireContext
@ stdcall CPCreateHash(long long ptr long ptr) RSAENH_CPCreateHash
@ stdcall CPDecrypt(long long long long long ptr ptr) RSAENH_CPDecrypt
@ stdcall CPDeriveKey(long long long long ptr) RSAENH_CPDeriveKey
@ stdcall CPDestroyHash(long long) RSAENH_CPDestroyHash
@ stdcall CPDestroyKey(long long) RSAENH_CPDestroyKey
@ stdcall CPDuplicateHash(long long ptr long ptr) RSAENH_CPDuplicateHash
@ stdcall CPDuplicateKey(long long ptr long ptr) RSAENH_CPDuplicateKey
@ stdcall CPEncrypt(long long long long long ptr ptr long) RSAENH_CPEncrypt
@ stdcall CPExportKey(long long long long long ptr ptr) RSAENH_CPExportKey
@ stdcall CPGenKey(long long long ptr) RSAENH_CPGenKey
@ stdcall CPGenRandom(long long ptr) RSAENH_CPGenRandom
@ stdcall CPGetHashParam(long long long ptr ptr long) RSAENH_CPGetHashParam
@ stdcall CPGetKeyParam(long long long ptr ptr long) RSAENH_CPGetKeyParam
@ stdcall CPGetProvParam(long long ptr ptr long) RSAENH_CPGetProvParam
@ stdcall CPGetUserKey(long long ptr) RSAENH_CPGetUserKey
@ stdcall CPHashData(long long ptr long long) RSAENH_CPHashData
@ stdcall CPHashSessionKey(long long long long) RSAENH_CPHashSessionKey
@ stdcall CPImportKey(long ptr long long long ptr) RSAENH_CPImportKey
@ stdcall CPReleaseContext(long long) RSAENH_CPReleaseContext
@ stdcall CPSetHashParam(long long long ptr long) RSAENH_CPSetHashParam
@ stdcall CPSetKeyParam(long long long ptr long) RSAENH_CPSetKeyParam
@ stdcall CPSetProvParam(long long ptr long) RSAENH_CPSetProvParam
@ stdcall CPSignHash(long long long wstr long ptr ptr) RSAENH_CPSignHash
@ stdcall CPVerifySignature(long long ptr long long wstr long) RSAENH_CPVerifySignature
@ stdcall -private DllRegisterServer() RSAENH_DllRegisterServer
@ stdcall -private DllUnregisterServer() RSAENH_DllUnregisterServer
Makefile
rsaenh.ok
testlist.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = rsaenh.dll
IMPORTS = advapi32 kernel32
CTESTS = \
rsaenh.c
@MAKE_TEST_RULES@
### Dependencies:
......@@ -431,6 +431,21 @@
/* Define if OpenGL is present on the system */
#undef HAVE_OPENGL
/* Define to 1 if you have the <openssl/des.h> header file. */
#undef HAVE_OPENSSL_DES_H
/* Define to 1 if you have the <openssl/md2.h> header file. */
#undef HAVE_OPENSSL_MD2_H
/* Define to 1 if you have the <openssl/rc2.h> header file. */
#undef HAVE_OPENSSL_RC2_H
/* Define to 1 if you have the <openssl/rc4.h> header file. */
#undef HAVE_OPENSSL_RC4_H
/* Define to 1 if you have the <openssl/rsa.h> header file. */
#undef HAVE_OPENSSL_RSA_H
/* Define to 1 if you have the <openssl/ssl.h> header file. */
#undef HAVE_OPENSSL_SSL_H
......
......@@ -2005,7 +2005,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,ole32.dll,1
11,,oleaut32.dll,1
11,,quartz.dll,1
11,,rsabase.dll,1
11,,rsaenh.dll,1
11,,shdocvw.dll,1
11,,shell32.dll,1
11,,urlmon.dll,1
......
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