Commit 23791c25 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement CryptBinaryToStringA and CryptStringToBinaryA.

Implement CryptBinaryToStringA and CryptStringToBinaryA based on Kai Blin's base64 encoder/decoder.
parent 61a0799b
......@@ -8,6 +8,7 @@ IMPORTLIB = libcrypt32.$(IMPLIBEXT)
IMPORTS = user32 advapi32 kernel32 ntdll
C_SRCS = \
base64.c \
cert.c \
crl.c \
context.c \
......
......@@ -88,6 +88,10 @@
@ stdcall CertVerifyTimeValidity(ptr ptr)
@ stub CertVerifyValidityNesting
@ stub CreateFileU
@ stdcall CryptBinaryToStringA(ptr long long ptr ptr)
@ stub CryptBinaryToStringW # (ptr long long ptr ptr)
@ stdcall CryptStringToBinaryA(str long long ptr ptr ptr ptr)
@ stub CryptStringToBinaryW # (wstr long long ptr ptr ptr ptr)
@ stub CryptAcquireContextU
@ stub CryptCloseAsyncHandle
@ stub CryptCreateAsyncHandle
......
Makefile
base64.ok
cert.ok
encode.ok
main.ok
......
......@@ -6,6 +6,7 @@ TESTDLL = crypt32.dll
IMPORTS = crypt32 advapi32 kernel32
CTESTS = \
base64.c \
cert.c \
encode.c \
main.c \
......
......@@ -1968,6 +1968,21 @@ typedef struct _CRL_FIND_ISSUED_FOR_PARA
#define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT)
#define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT)
/* CryptBinaryToString/CryptStringToBinary flags */
#define CRYPT_STRING_BASE64HEADER 0x00000000
#define CRYPT_STRING_BASE64 0x00000001
#define CRYPT_STRING_BINARY 0x00000002
#define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003
#define CRYPT_STRING_HEX 0x00000004
#define CRYPT_STRING_HEXASCII 0x00000005
#define CRYPT_STRING_BASE64_ANY 0x00000006
#define CRYPT_STRING_ANY 0x00000007
#define CRYPT_STRING_HEX_ANY 0x00000008
#define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009
#define CRYPT_STRING_HEXADDR 0x0000000a
#define CRYPT_STRING_HEXASCIIADDR 0x0000000b
#define CRYPT_STRING_NOCR 0x80000000
/* OIDs */
#define szOID_RSA "1.2.840.113549"
#define szOID_PKCS "1.2.840.113549.1"
......@@ -2540,6 +2555,20 @@ LPVOID WINAPI CryptMemAlloc(ULONG cbSize);
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize);
VOID WINAPI CryptMemFree(LPVOID pv);
BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary,
DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString);
BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary,
DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString);
#define CryptBinaryToString WINELIB_NAME_AW(CryptBinaryToString)
BOOL WINAPI CryptStringToBinaryA(LPCSTR pszString,
DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
DWORD *pdwSkip, DWORD *pdwFlags);
BOOL WINAPI CryptStringToBinaryW(LPCWSTR pszString,
DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
DWORD *pdwSkip, DWORD *pdwFlags);
#define CryptStringToBinary WINELIB_NAME_AW(CryptStringToBinary)
BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD,LPCSTR,DWORD,LPCWSTR);
BOOL WINAPI CryptRegisterOIDFunction(DWORD,LPCSTR,LPCSTR,LPCWSTR,LPCSTR);
BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
......
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