Commit 7f3c35db authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dssenh: Enable compilation with long types.

parent f72d53fc
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = dssenh.dll MODULE = dssenh.dll
IMPORTS = bcrypt crypt32 advapi32 IMPORTS = bcrypt crypt32 advapi32
......
...@@ -131,7 +131,7 @@ static const WCHAR *map_keyspec_to_keypair_name( DWORD keyspec ) ...@@ -131,7 +131,7 @@ static const WCHAR *map_keyspec_to_keypair_name( DWORD keyspec )
name = L"SignatureKeyPair"; name = L"SignatureKeyPair";
break; break;
default: default:
ERR( "invalid key spec %u\n", keyspec ); ERR( "invalid key spec %lu\n", keyspec );
return NULL; return NULL;
} }
return name; return name;
...@@ -267,7 +267,7 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags ...@@ -267,7 +267,7 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags
struct container *ret; struct container *ret;
char name[MAX_PATH]; char name[MAX_PATH];
TRACE( "%p, %s, %08x, %p\n", ret_prov, debugstr_a(container), flags, vtable ); TRACE( "%p, %s, %08lx, %p\n", ret_prov, debugstr_a(container), flags, vtable );
if (container && *container) if (container && *container)
{ {
...@@ -311,7 +311,7 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags ...@@ -311,7 +311,7 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags
return TRUE; return TRUE;
default: default:
FIXME( "unsupported flags %08x\n", flags ); FIXME( "unsupported flags %08lx\n", flags );
return FALSE; return FALSE;
} }
...@@ -324,7 +324,7 @@ BOOL WINAPI CPReleaseContext( HCRYPTPROV hprov, DWORD flags ) ...@@ -324,7 +324,7 @@ BOOL WINAPI CPReleaseContext( HCRYPTPROV hprov, DWORD flags )
{ {
struct container *container = (struct container *)hprov; struct container *container = (struct container *)hprov;
TRACE( "%p, %08x\n", (void *)hprov, flags ); TRACE( "%p, %08lx\n", (void *)hprov, flags );
if (container->magic != MAGIC_CONTAINER) return FALSE; if (container->magic != MAGIC_CONTAINER) return FALSE;
destroy_container( container ); destroy_container( container );
...@@ -407,13 +407,13 @@ static BOOL generate_key( struct container *container, ALG_ID algid, DWORD bitle ...@@ -407,13 +407,13 @@ static BOOL generate_key( struct container *container, ALG_ID algid, DWORD bitle
if ((status = BCryptGenerateKeyPair( key->alg_handle, &key->handle, bitlen, 0 ))) if ((status = BCryptGenerateKeyPair( key->alg_handle, &key->handle, bitlen, 0 )))
{ {
ERR( "failed to generate key %08x\n", status ); ERR( "failed to generate key %08lx\n", status );
destroy_key( key ); destroy_key( key );
return FALSE; return FALSE;
} }
if ((status = BCryptFinalizeKeyPair( key->handle, 0 ))) if ((status = BCryptFinalizeKeyPair( key->handle, 0 )))
{ {
ERR( "failed to finalize key %08x\n", status ); ERR( "failed to finalize key %08lx\n", status );
destroy_key( key ); destroy_key( key );
return FALSE; return FALSE;
} }
...@@ -448,7 +448,7 @@ BOOL WINAPI CPGenKey( HCRYPTPROV hprov, ALG_ID algid, DWORD flags, HCRYPTKEY *re ...@@ -448,7 +448,7 @@ BOOL WINAPI CPGenKey( HCRYPTPROV hprov, ALG_ID algid, DWORD flags, HCRYPTKEY *re
struct container *container = (struct container *)hprov; struct container *container = (struct container *)hprov;
ULONG i, bitlen = HIWORD(flags) ? HIWORD(flags) : 1024; ULONG i, bitlen = HIWORD(flags) ? HIWORD(flags) : 1024;
TRACE( "%p, %08x, %08x, %p\n", (void *)hprov, algid, flags, ret_key ); TRACE( "%p, %08x, %08lx, %p\n", (void *)hprov, algid, flags, ret_key );
if (container->magic != MAGIC_CONTAINER) return FALSE; if (container->magic != MAGIC_CONTAINER) return FALSE;
...@@ -512,7 +512,7 @@ static BOOL import_key_dss2( struct container *container, ALG_ID algid, const BY ...@@ -512,7 +512,7 @@ static BOOL import_key_dss2( struct container *container, ALG_ID algid, const BY
break; break;
default: default:
FIXME( "unsupported key magic %08x\n", pubkey->magic ); FIXME( "unsupported key magic %08lx\n", pubkey->magic );
return FALSE; return FALSE;
} }
...@@ -520,7 +520,7 @@ static BOOL import_key_dss2( struct container *container, ALG_ID algid, const BY ...@@ -520,7 +520,7 @@ static BOOL import_key_dss2( struct container *container, ALG_ID algid, const BY
if ((status = BCryptImportKeyPair( key->alg_handle, NULL, type, &key->handle, (UCHAR *)data, len, 0 ))) if ((status = BCryptImportKeyPair( key->alg_handle, NULL, type, &key->handle, (UCHAR *)data, len, 0 )))
{ {
TRACE( "failed to import key %08x\n", status ); TRACE( "failed to import key %08lx\n", status );
destroy_key( key ); destroy_key( key );
return FALSE; return FALSE;
} }
...@@ -583,7 +583,7 @@ static BOOL import_key_dss3( struct container *container, ALG_ID algid, const BY ...@@ -583,7 +583,7 @@ static BOOL import_key_dss3( struct container *container, ALG_ID algid, const BY
break; break;
default: default:
FIXME( "unsupported key magic %08x\n", pubkey->magic ); FIXME( "unsupported key magic %08lx\n", pubkey->magic );
return FALSE; return FALSE;
} }
...@@ -628,7 +628,7 @@ static BOOL import_key_dss3( struct container *container, ALG_ID algid, const BY ...@@ -628,7 +628,7 @@ static BOOL import_key_dss3( struct container *container, ALG_ID algid, const BY
if ((status = BCryptImportKeyPair( key->alg_handle, NULL, BCRYPT_DSA_PUBLIC_BLOB, &key->handle, (UCHAR *)blob, if ((status = BCryptImportKeyPair( key->alg_handle, NULL, BCRYPT_DSA_PUBLIC_BLOB, &key->handle, (UCHAR *)blob,
size, 0 ))) size, 0 )))
{ {
WARN( "failed to import key %08x\n", status ); WARN( "failed to import key %08lx\n", status );
destroy_key( key ); destroy_key( key );
heap_free( blob ); heap_free( blob );
return FALSE; return FALSE;
...@@ -646,7 +646,7 @@ BOOL WINAPI CPImportKey( HCRYPTPROV hprov, const BYTE *data, DWORD len, HCRYPTKE ...@@ -646,7 +646,7 @@ BOOL WINAPI CPImportKey( HCRYPTPROV hprov, const BYTE *data, DWORD len, HCRYPTKE
const BLOBHEADER *hdr; const BLOBHEADER *hdr;
BOOL ret; BOOL ret;
TRACE( "%p, %p, %u, %p, %08x, %p\n", (void *)hprov, data, len, (void *)hpubkey, flags, ret_key ); TRACE( "%p, %p, %lu, %p, %08lx, %p\n", (void *)hprov, data, len, (void *)hpubkey, flags, ret_key );
if (container->magic != MAGIC_CONTAINER) return FALSE; if (container->magic != MAGIC_CONTAINER) return FALSE;
if (len < sizeof(*hdr)) return FALSE; if (len < sizeof(*hdr)) return FALSE;
...@@ -682,7 +682,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW ...@@ -682,7 +682,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW
struct key *key = (struct key *)hkey; struct key *key = (struct key *)hkey;
const WCHAR *type; const WCHAR *type;
TRACE( "%p, %p, %p, %08x, %08x, %p, %p\n", (void *)hprov, (void *)hkey, (void *)hexpkey, blobtype, flags, TRACE( "%p, %p, %p, %08lx, %08lx, %p, %p\n", (void *)hprov, (void *)hkey, (void *)hexpkey, blobtype, flags,
data, len ); data, len );
if (key->magic != MAGIC_KEY) return FALSE; if (key->magic != MAGIC_KEY) return FALSE;
...@@ -693,7 +693,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW ...@@ -693,7 +693,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW
} }
if (flags) if (flags)
{ {
FIXME( "flags %08x not supported\n", flags ); FIXME( "flags %08lx not supported\n", flags );
return FALSE; return FALSE;
} }
...@@ -708,7 +708,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW ...@@ -708,7 +708,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW
break; break;
default: default:
FIXME( "blob type %u not supported\n", blobtype ); FIXME( "blob type %lu not supported\n", blobtype );
return FALSE; return FALSE;
} }
...@@ -719,7 +719,7 @@ BOOL WINAPI CPDuplicateKey( HCRYPTPROV hprov, HCRYPTKEY hkey, DWORD *reserved, D ...@@ -719,7 +719,7 @@ BOOL WINAPI CPDuplicateKey( HCRYPTPROV hprov, HCRYPTKEY hkey, DWORD *reserved, D
{ {
struct key *key = (struct key *)hkey, *ret; struct key *key = (struct key *)hkey, *ret;
TRACE( "%p, %p, %p, %08x, %p\n", (void *)hprov, (void *)hkey, reserved, flags, ret_key ); TRACE( "%p, %p, %p, %08lx, %p\n", (void *)hprov, (void *)hkey, reserved, flags, ret_key );
if (key->magic != MAGIC_KEY) return FALSE; if (key->magic != MAGIC_KEY) return FALSE;
...@@ -733,7 +733,7 @@ BOOL WINAPI CPGetUserKey( HCRYPTPROV hprov, DWORD keyspec, HCRYPTKEY *ret_key ) ...@@ -733,7 +733,7 @@ BOOL WINAPI CPGetUserKey( HCRYPTPROV hprov, DWORD keyspec, HCRYPTKEY *ret_key )
struct container *container = (struct container *)hprov; struct container *container = (struct container *)hprov;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE( "%p, %08x, %p\n", (void *)hprov, keyspec, ret_key ); TRACE( "%p, %08lx, %p\n", (void *)hprov, keyspec, ret_key );
if (container->magic != MAGIC_CONTAINER) return FALSE; if (container->magic != MAGIC_CONTAINER) return FALSE;
...@@ -761,7 +761,7 @@ BOOL WINAPI CPGenRandom( HCRYPTPROV hprov, DWORD len, BYTE *buffer ) ...@@ -761,7 +761,7 @@ BOOL WINAPI CPGenRandom( HCRYPTPROV hprov, DWORD len, BYTE *buffer )
{ {
struct container *container = (struct container *)hprov; struct container *container = (struct container *)hprov;
TRACE( "%p, %u, %p\n", (void *)hprov, len, buffer ); TRACE( "%p, %lu, %p\n", (void *)hprov, len, buffer );
if (container->magic != MAGIC_CONTAINER) return FALSE; if (container->magic != MAGIC_CONTAINER) return FALSE;
...@@ -816,7 +816,7 @@ BOOL WINAPI CPCreateHash( HCRYPTPROV hprov, ALG_ID algid, HCRYPTKEY hkey, DWORD ...@@ -816,7 +816,7 @@ BOOL WINAPI CPCreateHash( HCRYPTPROV hprov, ALG_ID algid, HCRYPTKEY hkey, DWORD
{ {
struct hash *hash; struct hash *hash;
TRACE( "%p, %08x, %p, %08x, %p\n", (void *)hprov, algid, (void *)hkey, flags, ret_hash ); TRACE( "%p, %08x, %p, %08lx, %p\n", (void *)hprov, algid, (void *)hkey, flags, ret_hash );
switch (algid) switch (algid)
{ {
...@@ -882,7 +882,7 @@ BOOL WINAPI CPDuplicateHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD *reserved ...@@ -882,7 +882,7 @@ BOOL WINAPI CPDuplicateHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD *reserved
{ {
struct hash *hash = (struct hash *)hhash, *ret; struct hash *hash = (struct hash *)hhash, *ret;
TRACE( "%p, %p, %p, %08x, %p\n", (void *)hprov, (void *)hhash, reserved, flags, ret_hash ); TRACE( "%p, %p, %p, %08lx, %p\n", (void *)hprov, (void *)hhash, reserved, flags, ret_hash );
if (hash->magic != MAGIC_HASH) return FALSE; if (hash->magic != MAGIC_HASH) return FALSE;
...@@ -895,7 +895,7 @@ BOOL WINAPI CPHashData( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *data, DW ...@@ -895,7 +895,7 @@ BOOL WINAPI CPHashData( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *data, DW
{ {
struct hash *hash = (struct hash *)hhash; struct hash *hash = (struct hash *)hhash;
TRACE("%p, %p, %p, %u, %08x\n", (void *)hprov, (void *)hhash, data, len, flags ); TRACE("%p, %p, %p, %lu, %08lx\n", (void *)hprov, (void *)hhash, data, len, flags );
if (hash->magic != MAGIC_HASH) return FALSE; if (hash->magic != MAGIC_HASH) return FALSE;
...@@ -911,7 +911,7 @@ BOOL WINAPI CPGetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, BYT ...@@ -911,7 +911,7 @@ BOOL WINAPI CPGetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, BYT
{ {
struct hash *hash = (struct hash *)hhash; struct hash *hash = (struct hash *)hhash;
TRACE( "%p, %p, %08x, %p, %p, %08x\n", (void *)hprov, (void *)hhash, param, data, len, flags ); TRACE( "%p, %p, %08lx, %p, %p, %08lx\n", (void *)hprov, (void *)hhash, param, data, len, flags );
if (hash->magic != MAGIC_HASH) return FALSE; if (hash->magic != MAGIC_HASH) return FALSE;
...@@ -954,7 +954,7 @@ BOOL WINAPI CPSetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, con ...@@ -954,7 +954,7 @@ BOOL WINAPI CPSetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, con
{ {
struct hash *hash = (struct hash *)hhash; struct hash *hash = (struct hash *)hhash;
TRACE( "%p, %p, %08x, %p, %08x\n", (void *)hprov, (void *)hhash, param, data, flags ); TRACE( "%p, %p, %08lx, %p, %08lx\n", (void *)hprov, (void *)hhash, param, data, flags );
if (hash->magic != MAGIC_HASH) return FALSE; if (hash->magic != MAGIC_HASH) return FALSE;
...@@ -965,7 +965,7 @@ BOOL WINAPI CPSetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, con ...@@ -965,7 +965,7 @@ BOOL WINAPI CPSetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, con
return TRUE; return TRUE;
default: default:
FIXME( "param %u not supported\n", param ); FIXME( "param %lu not supported\n", param );
SetLastError( NTE_BAD_TYPE ); SetLastError( NTE_BAD_TYPE );
return FALSE; return FALSE;
} }
...@@ -983,7 +983,7 @@ static DWORD get_signature_length( DWORD algid ) ...@@ -983,7 +983,7 @@ static DWORD get_signature_length( DWORD algid )
case AT_SIGNATURE: case AT_SIGNATURE:
case CALG_DSS_SIGN: return 40; case CALG_DSS_SIGN: return 40;
default: default:
FIXME( "unhandled algorithm %u\n", algid ); FIXME( "unhandled algorithm %lu\n", algid );
return 0; return 0;
} }
} }
...@@ -996,7 +996,7 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const ...@@ -996,7 +996,7 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const
struct hash *hash = (struct hash *)hhash; struct hash *hash = (struct hash *)hhash;
ULONG len; ULONG len;
TRACE( "%p, %p, %u, %s, %08x, %p, %p\n", (void *)hprov, (void *)hhash, keyspec, debugstr_w(desc), flags, sig, TRACE( "%p, %p, %lu, %s, %08lx, %p, %p\n", (void *)hprov, (void *)hhash, keyspec, debugstr_w(desc), flags, sig,
siglen ); siglen );
if (container->magic != MAGIC_CONTAINER || !container->sign_key) return FALSE; if (container->magic != MAGIC_CONTAINER || !container->sign_key) return FALSE;
...@@ -1018,13 +1018,13 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s ...@@ -1018,13 +1018,13 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s
struct hash *hash = (struct hash *)hhash; struct hash *hash = (struct hash *)hhash;
struct key *key = (struct key *)hpubkey; struct key *key = (struct key *)hpubkey;
TRACE( "%p, %p, %p, %u %p, %s, %08x\n", (void *)hprov, (void *)hhash, sig, siglen, (void *)hpubkey, TRACE( "%p, %p, %p, %lu %p, %s, %08lx\n", (void *)hprov, (void *)hhash, sig, siglen, (void *)hpubkey,
debugstr_w(desc), flags ); debugstr_w(desc), flags );
if (hash->magic != MAGIC_HASH || key->magic != MAGIC_KEY) return FALSE; if (hash->magic != MAGIC_HASH || key->magic != MAGIC_KEY) return FALSE;
if (flags) if (flags)
{ {
FIXME( "flags %08x not supported\n", flags ); FIXME( "flags %08lx not supported\n", flags );
return FALSE; return FALSE;
} }
......
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