Rebase against f2cb86decb334fc72ff5422122ba190bc9b6046e

This commit is contained in:
Alistair Leslie-Hughes 2018-03-22 09:20:17 +11:00
parent e38104d365
commit 3d050ca9b9
45 changed files with 341 additions and 1942 deletions

View File

@ -1,200 +0,0 @@
From d056be40dd9cd96ec2ef6efa85fe9a630948a305 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 07:46:57 +0100
Subject: [PATCH 17/36] bcrypt: Implement BCryptEncrypt for AES GCM mode.
---
dlls/bcrypt/bcrypt_main.c | 60 +++++++++++++++++++++++++++++++++++++++-------
dlls/bcrypt/tests/bcrypt.c | 18 +++++++-------
2 files changed, 61 insertions(+), 17 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index fa80318..dfdb7b2 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -63,6 +63,12 @@ MAKE_FUNCPTR(gnutls_global_set_log_level);
MAKE_FUNCPTR(gnutls_perror);
#undef MAKE_FUNCPTR
+#if GNUTLS_VERSION_MAJOR < 3
+#define GNUTLS_CIPHER_AES_192_CBC 92
+#define GNUTLS_CIPHER_AES_128_GCM 93
+#define GNUTLS_CIPHER_AES_256_GCM 94
+#endif
+
static void gnutls_log( int level, const char *msg )
{
TRACE( "<%d> %s", level, msg );
@@ -848,6 +854,7 @@ struct key
{
struct object hdr;
enum alg_id alg_id;
+ enum mode_id mode;
ULONG block_size;
gnutls_cipher_hd_t handle;
UCHAR *secret;
@@ -858,6 +865,7 @@ struct key
{
struct object hdr;
enum alg_id alg_id;
+ enum mode_id mode;
ULONG block_size;
CCCryptorRef ref_encrypt;
CCCryptorRef ref_decrypt;
@@ -868,6 +876,7 @@ struct key
struct key
{
struct object hdr;
+ enum mode_id mode;
ULONG block_size;
};
#endif
@@ -923,6 +932,7 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
memcpy( buffer, secret, secret_len );
key->alg_id = alg->id;
+ key->mode = alg->mode;
key->handle = 0; /* initialized on first use */
key->secret = buffer;
key->secret_len = secret_len;
@@ -935,9 +945,13 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
switch (key->alg_id)
{
case ALG_ID_AES:
- FIXME( "handle block size and chaining mode\n" );
- return GNUTLS_CIPHER_AES_128_CBC;
-
+ WARN( "handle block size\n" );
+ switch (key->mode)
+ {
+ case MODE_ID_GCM: return GNUTLS_CIPHER_AES_128_GCM;
+ case MODE_ID_CBC:
+ default: return GNUTLS_CIPHER_AES_128_CBC;
+ }
default:
FIXME( "algorithm %u not supported\n", key->alg_id );
return GNUTLS_CIPHER_UNKNOWN;
@@ -1019,6 +1033,14 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
switch (alg->id)
{
case ALG_ID_AES:
+ switch (alg->mode)
+ {
+ case MODE_ID_CBC:
+ break;
+ default:
+ FIXME( "mode %u not supported\n", alg->mode );
+ return STATUS_NOT_SUPPORTED;
+ }
break;
default:
@@ -1031,6 +1053,7 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
memcpy( buffer, secret, secret_len );
key->alg_id = alg->id;
+ key->mode = alg->mode;
key->ref_encrypt = NULL; /* initialized on first use */
key->ref_decrypt = NULL;
key->secret = buffer;
@@ -1112,6 +1135,7 @@ static NTSTATUS key_destroy( struct key *key )
static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
{
ERR( "support for keys not available at build time\n" );
+ key->mode = MODE_ID_CBC;
return STATUS_NOT_IMPLEMENTED;
}
@@ -1260,17 +1284,37 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
padding, iv, iv_len, output, output_len, ret_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
- if (padding)
- {
- FIXME( "padding info not implemented\n" );
- return STATUS_NOT_IMPLEMENTED;
- }
if (flags & ~BCRYPT_BLOCK_PADDING)
{
FIXME( "flags %08x not implemented\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
+ if (key->mode == MODE_ID_GCM)
+ {
+ BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
+
+ if (!auth_info) return STATUS_INVALID_PARAMETER;
+ if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
+ if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
+ if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
+ if (auth_info->dwFlags & BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG)
+ FIXME( "call chaining not implemented\n" );
+
+ if ((status = key_set_params( key, auth_info->pbNonce, auth_info->cbNonce )))
+ return status;
+
+ *ret_len = input_len;
+ if (flags & BCRYPT_BLOCK_PADDING) return STATUS_INVALID_PARAMETER;
+ if (!output) return STATUS_SUCCESS;
+ if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
+
+ if ((status = key_encrypt( key, input, input_len, output, output_len )))
+ return status;
+
+ return STATUS_SUCCESS;
+ }
+
if ((status = key_set_params( key, iv, iv_len ))) return status;
*ret_len = input_len;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 70d9e0c..355a414 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -751,12 +751,12 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = pBCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0);
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- todo_wine ok(size == 32, "got %u\n", size);
- todo_wine ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(size == 32, "got %u\n", size);
+ ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
todo_wine ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
for (i = 0; i < 32; i++)
- todo_wine ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
todo_wine ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
@@ -766,12 +766,12 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = pBCryptEncrypt(key, data2, 24, &auth_info, ivbuf, 16, ciphertext, 24, &size, 0);
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- todo_wine ok(size == 24, "got %u\n", size);
- todo_wine ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(size == 24, "got %u\n", size);
+ ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
todo_wine ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
for (i = 0; i < 24; i++)
- todo_wine ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
todo_wine ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
@@ -784,7 +784,7 @@ static void test_BCryptEncrypt(void)
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = pBCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
- todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
ret = pBCryptDestroyKey(key);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
--
2.7.4

View File

@ -1,83 +0,0 @@
From 4ec53bd02df73020b29b0a9fed5b0915d95a66e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 07:53:10 +0100
Subject: [PATCH 18/36] bcrypt: Implement BCryptDecrypt for AES GCM mode.
---
dlls/bcrypt/bcrypt_main.c | 28 +++++++++++++++++++++++-----
dlls/bcrypt/tests/bcrypt.c | 8 ++++----
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 387f448516..17cc92dded 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1352,17 +1352,35 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
padding, iv, iv_len, output, output_len, ret_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
- if (padding)
- {
- FIXME( "padding info not implemented\n" );
- return STATUS_NOT_IMPLEMENTED;
- }
if (flags & ~BCRYPT_BLOCK_PADDING)
{
FIXME( "flags %08x not supported\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
+ if (key->mode == MODE_ID_GCM)
+ {
+ BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
+
+ if (!auth_info) return STATUS_INVALID_PARAMETER;
+ if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
+ if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
+ if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
+
+ if ((status = key_set_params( key, auth_info->pbNonce, auth_info->cbNonce )))
+ return status;
+
+ *ret_len = input_len;
+ if (flags & BCRYPT_BLOCK_PADDING) return STATUS_INVALID_PARAMETER;
+ if (!output) return STATUS_SUCCESS;
+ if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
+
+ if ((status = key_decrypt( key, input, input_len, output, output_len )))
+ return status;
+
+ return STATUS_SUCCESS;
+ }
+
if ((status = key_set_params( key, iv, iv_len ))) return status;
*ret_len = input_len;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 355a414bca..89a3c40850 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -969,16 +969,16 @@ static void test_BCryptDecrypt(void)
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- todo_wine ok(size == 32, "got %u\n", size);
- todo_wine ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(size == 32, "got %u\n", size);
+ ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
/* test with wrong tag */
memcpy(ivbuf, iv, sizeof(iv));
auth_info.pbTag = iv; /* wrong tag */
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
todo_wine ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
- todo_wine ok(size == 32, "got %u\n", size);
+ ok(size == 32, "got %u\n", size);
ret = pBCryptDestroyKey(key);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
--
2.16.1

View File

@ -1,168 +0,0 @@
From a511e42c71c2c04ee257f78cece073d08a51d32d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 08:02:36 +0100
Subject: [PATCH 19/36] bcrypt: Add support for computing/comparing cipher tag.
---
dlls/bcrypt/bcrypt_main.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-
dlls/bcrypt/tests/bcrypt.c | 10 +++++-----
2 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 02a0106..5daddff 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -50,6 +50,9 @@ static HINSTANCE instance;
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
WINE_DECLARE_DEBUG_CHANNEL(winediag);
+/* Not present in gnutls version < 3.0 */
+static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t handle, void * tag, size_t tag_size);
+
static void *libgnutls_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR(gnutls_cipher_decrypt2);
@@ -69,6 +72,11 @@ MAKE_FUNCPTR(gnutls_perror);
#define GNUTLS_CIPHER_AES_256_GCM 94
#endif
+static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void * tag, size_t tag_size)
+{
+ return GNUTLS_E_UNKNOWN_CIPHER_TYPE;
+}
+
static void gnutls_log( int level, const char *msg )
{
TRACE( "<%d> %s", level, msg );
@@ -102,6 +110,12 @@ static BOOL gnutls_initialize(void)
LOAD_FUNCPTR(gnutls_perror)
#undef LOAD_FUNCPTR
+ if (!(pgnutls_cipher_tag = wine_dlsym( libgnutls_handle, "gnutls_cipher_tag", NULL, 0 )))
+ {
+ WARN("gnutls_cipher_tag not found\n");
+ pgnutls_cipher_tag = compat_gnutls_cipher_tag;
+ }
+
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
{
pgnutls_perror( ret );
@@ -1018,6 +1032,19 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_SUCCESS;
}
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
+{
+ int ret;
+
+ if ((ret = pgnutls_cipher_tag( key->handle, tag, len )))
+ {
+ pgnutls_perror( ret );
+ return STATUS_INTERNAL_ERROR;
+ }
+
+ return STATUS_SUCCESS;
+}
+
static NTSTATUS key_destroy( struct key *key )
{
if (key->handle) pgnutls_cipher_deinit( key->handle );
@@ -1123,6 +1150,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_SUCCESS;
}
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
+{
+ FIXME( "not implemented on Mac\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static NTSTATUS key_destroy( struct key *key )
{
if (key->ref_encrypt) CCCryptorRelease( key->ref_encrypt );
@@ -1159,6 +1192,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
+{
+ ERR( "support for keys not available at build time\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static NTSTATUS key_destroy( struct key *key )
{
ERR( "support for keys not available at build time\n" );
@@ -1312,7 +1351,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if ((status = key_encrypt( key, input, input_len, output, output_len )))
return status;
- return STATUS_SUCCESS;
+ return key_get_tag( key, auth_info->pbTag, auth_info->cbTag );
}
if ((status = key_set_params( key, iv, iv_len ))) return status;
@@ -1371,6 +1410,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if (key->mode == MODE_ID_GCM)
{
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
+ UCHAR tag[16];
if (!auth_info) return STATUS_INVALID_PARAMETER;
if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
@@ -1388,6 +1428,11 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if ((status = key_decrypt( key, input, input_len, output, output_len )))
return status;
+ if ((status = key_get_tag( key, tag, sizeof(tag) )))
+ return status;
+ if (memcmp( tag, auth_info->pbTag, auth_info->cbTag ))
+ return STATUS_AUTH_TAG_MISMATCH;
+
return STATUS_SUCCESS;
}
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 89a3c40..18cd2a2 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -754,11 +754,11 @@ static void test_BCryptEncrypt(void)
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
ok(size == 32, "got %u\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
- todo_wine ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
+ ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
for (i = 0; i < 32; i++)
ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- todo_wine ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
+ ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
/* input size is not multiple of block size */
size = 0;
@@ -769,11 +769,11 @@ static void test_BCryptEncrypt(void)
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
ok(size == 24, "got %u\n", size);
ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
- todo_wine ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
+ ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
for (i = 0; i < 24; i++)
ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- todo_wine ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
+ ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
/* test with padding */
memcpy(ivbuf, iv, sizeof(iv));
@@ -977,7 +977,7 @@ static void test_BCryptDecrypt(void)
memcpy(ivbuf, iv, sizeof(iv));
auth_info.pbTag = iv; /* wrong tag */
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
- todo_wine ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
+ ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
ok(size == 32, "got %u\n", size);
ret = pBCryptDestroyKey(key);
--
2.7.4

View File

@ -1,7 +1,7 @@
From 622e4b47bdabcdae3deab7347a73d0b3ea804fca Mon Sep 17 00:00:00 2001
From 392198981958d9d2c76e22e27c1b704c7763971b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 08:28:24 +0100
Subject: [PATCH 20/36] bcrypt: Implement BCryptDuplicateKey.
Subject: [PATCH] bcrypt: Implement BCryptDuplicateKey.
---
dlls/bcrypt/bcrypt.spec | 2 +-
@ -23,11 +23,11 @@ index 21b54b4..28c2394 100644
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)
@ stub BCryptEnumContextFunctionProviders
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 5daddff..e72a8fd 100644
index cd44bdf..0d321d2 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -954,6 +954,24 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
return STATUS_SUCCESS;
@@ -953,6 +953,24 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@ -51,8 +51,8 @@ index 5daddff..e72a8fd 100644
static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
{
switch (key->alg_id)
@@ -1089,6 +1107,25 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
return STATUS_SUCCESS;
@@ -1094,6 +1112,25 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@ -77,7 +77,7 @@ index 5daddff..e72a8fd 100644
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
{
CCCryptorStatus status;
@@ -1172,6 +1209,13 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
@@ -1182,6 +1219,13 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
@ -91,7 +91,7 @@ index 5daddff..e72a8fd 100644
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
{
ERR( "support for keys not available at build time\n" );
@@ -1300,6 +1344,30 @@ NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
@@ -1310,6 +1354,30 @@ NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
return key_export( key, type, output, output_len, size );
}
@ -136,5 +136,5 @@ index 5d5fae0..d0f0f56 100644
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
@ stub BCryptEnumContextFunctionProviders
--
2.7.4
1.9.1

View File

@ -1,111 +0,0 @@
From b41fdf5830cdaf31108cbdf82585f130882a0fb7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 08:41:31 +0100
Subject: [PATCH 22/36] bcrypt: Allow to call BCryptSetProperty on key objects.
---
dlls/bcrypt/bcrypt_main.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
dlls/bcrypt/tests/bcrypt.c | 4 ++++
2 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index e72a8fd..f027eea 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -246,6 +246,9 @@ struct algorithm
BOOL hmac;
};
+struct key;
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags );
+
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG count, ULONG flags)
{
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
@@ -696,8 +699,8 @@ NTSTATUS WINAPI BCryptSetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHA
}
case MAGIC_KEY:
{
- FIXME( "keys not implemented yet\n" );
- return STATUS_NOT_IMPLEMENTED;
+ struct key *key = (struct key *)object;
+ return set_key_property( key, prop, value, size, flags );
}
default:
WARN( "unknown magic %08x\n", object->magic );
@@ -972,6 +975,31 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
return STATUS_SUCCESS;
}
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
+{
+ if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
+ {
+ if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
+ {
+ key->mode = MODE_ID_CBC;
+ return STATUS_SUCCESS;
+ }
+ else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
+ {
+ key->mode = MODE_ID_GCM;
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
+ return STATUS_NOT_IMPLEMENTED;
+ }
+ }
+
+ FIXME( "unsupported key property %s\n", debugstr_w(prop) );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
{
switch (key->alg_id)
@@ -1126,6 +1154,12 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
return STATUS_SUCCESS;
}
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
+{
+ FIXME( "not implemented on Mac\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
{
CCCryptorStatus status;
@@ -1216,6 +1250,12 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
+{
+ ERR( "support for keys not available at build time\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
{
ERR( "support for keys not available at build time\n" );
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 6ec429e..baf5b63 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -526,6 +526,10 @@ static void test_BCryptGenerateSymmetricKey(void)
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
+ sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
+
size = 0xdeadbeef;
ret = pBCryptEncrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
--
2.7.4

View File

@ -1,7 +1,7 @@
From da83888b40c6a37740e3ff3ba1b0f2d3e2b9008c Mon Sep 17 00:00:00 2001
From 6bd98b26d6448c2a0cddd934f91bad42fe0fc9a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 13 Aug 2017 05:04:21 +0200
Subject: [PATCH 28/36] bcrypt: Add support for 192 and 256 bit aes keys.
Subject: [PATCH] bcrypt: Add support for 192 and 256 bit aes keys.
---
dlls/bcrypt/bcrypt_main.c | 14 ++++++++++++--
@ -9,10 +9,10 @@ Subject: [PATCH 28/36] bcrypt: Add support for 192 and 256 bit aes keys.
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index dbd8152..227c007 100644
index 9fb2268..2e6ed8b 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1031,11 +1031,21 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
@@ -1002,11 +1002,21 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
WARN( "handle block size\n" );
switch (key->mode)
{
@ -37,7 +37,7 @@ index dbd8152..227c007 100644
FIXME( "algorithm %u not supported\n", key->alg_id );
return GNUTLS_CIPHER_UNKNOWN;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 2381fdf..2bf8b1b 100644
index 30fdb60..ac5fc36 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -615,6 +615,9 @@ static void test_BCryptEncrypt(void)
@ -94,5 +94,5 @@ index 2381fdf..2bf8b1b 100644
* AES - GCM mode *
******************/
--
2.7.4
1.9.1

View File

@ -1,16 +1,25 @@
From d4255af99adc2fb09940feae4a7836fdd7e45a8e Mon Sep 17 00:00:00 2001
From 70501f83e7effe724e09263791e99c494ecfbe3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 18:31:55 +0200
Subject: [PATCH 29/36] bcrypt: Preparation for asymmetric keys.
Subject: [PATCH] bcrypt: Preparation for asymmetric keys.
---
dlls/bcrypt/bcrypt_main.c | 368 ++++++++++++++++++++++++++++------------------
1 file changed, 227 insertions(+), 141 deletions(-)
dlls/bcrypt/bcrypt_main.c | 367 ++++++++++++++++++++++++++++------------------
1 file changed, 226 insertions(+), 141 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 227c007..9b1ac80 100644
index 2e6ed8b..0791cf3 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -19,7 +19,7 @@
#include "config.h"
#include "wine/port.h"
-
+#undef HAVE_GNUTLS_CIPHER_INIT
#include <stdarg.h>
#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
#include <AvailabilityMacros.h>
@@ -238,16 +238,17 @@ static const struct {
ULONG hash_length;
ULONG block_bits;
@ -38,7 +47,7 @@ index 227c007..9b1ac80 100644
};
struct algorithm
@@ -885,21 +886,28 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
@@ -856,21 +857,28 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
}
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
@ -73,7 +82,7 @@ index 227c007..9b1ac80 100644
enum mode_id mode;
ULONG block_size;
CCCryptorRef ref_encrypt;
@@ -907,16 +915,56 @@ struct key
@@ -878,16 +886,56 @@ struct key
UCHAR *secret;
ULONG secret_len;
};
@ -132,7 +141,7 @@ index 227c007..9b1ac80 100644
static ULONG get_block_size( struct algorithm *alg )
{
ULONG ret = 0, size = sizeof(ret);
@@ -928,25 +976,43 @@ static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, U
@@ -899,25 +947,43 @@ static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, U
if (!strcmpW( type, BCRYPT_KEY_DATA_BLOB ))
{
BCRYPT_KEY_DATA_BLOB_HEADER *header = (BCRYPT_KEY_DATA_BLOB_HEADER *)output;
@ -180,7 +189,7 @@ index 227c007..9b1ac80 100644
{
UCHAR *buffer;
@@ -962,15 +1028,15 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
@@ -933,15 +999,15 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
return STATUS_NOT_SUPPORTED;
}
@ -202,7 +211,28 @@ index 227c007..9b1ac80 100644
return STATUS_SUCCESS;
}
@@ -979,16 +1045,24 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@@ -952,17 +1018,17 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
{
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
{
- key->mode = MODE_ID_ECB;
+ key->u.s.mode = MODE_ID_ECB;
return STATUS_SUCCESS;
}
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
{
- key->mode = MODE_ID_CBC;
+ key->u.s.mode = MODE_ID_CBC;
return STATUS_SUCCESS;
}
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
{
- key->mode = MODE_ID_GCM;
+ key->u.s.mode = MODE_ID_GCM;
return STATUS_SUCCESS;
}
else
@@ -980,16 +1046,24 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
UCHAR *buffer;
@ -236,28 +266,7 @@ index 227c007..9b1ac80 100644
return STATUS_SUCCESS;
}
@@ -999,17 +1073,17 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
{
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
{
- key->mode = MODE_ID_ECB;
+ key->u.s.mode = MODE_ID_ECB;
return STATUS_SUCCESS;
}
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
{
- key->mode = MODE_ID_CBC;
+ key->u.s.mode = MODE_ID_CBC;
return STATUS_SUCCESS;
}
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
{
- key->mode = MODE_ID_GCM;
+ key->u.s.mode = MODE_ID_GCM;
return STATUS_SUCCESS;
}
else
@@ -1029,22 +1103,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
@@ -1000,22 +1074,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
{
case ALG_ID_AES:
WARN( "handle block size\n" );
@ -287,7 +296,7 @@ index 227c007..9b1ac80 100644
return GNUTLS_CIPHER_UNKNOWN;
default:
FIXME( "algorithm %u not supported\n", key->alg_id );
@@ -1052,17 +1126,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
@@ -1023,17 +1097,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
}
}
@ -309,7 +318,7 @@ index 227c007..9b1ac80 100644
}
if ((cipher = get_gnutls_cipher( key )) == GNUTLS_CIPHER_UNKNOWN)
@@ -1074,12 +1148,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
@@ -1045,12 +1119,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
iv_len = sizeof(zero_iv);
}
@ -325,7 +334,7 @@ index 227c007..9b1ac80 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1088,11 +1162,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
@@ -1059,11 +1133,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
return STATUS_SUCCESS;
}
@ -339,7 +348,7 @@ index 227c007..9b1ac80 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1101,12 +1175,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
@@ -1072,12 +1146,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
return STATUS_SUCCESS;
}
@ -354,7 +363,7 @@ index 227c007..9b1ac80 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1120,7 +1194,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -1091,7 +1165,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
{
int ret;
@ -363,7 +372,7 @@ index 227c007..9b1ac80 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1133,7 +1207,7 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1104,7 +1178,7 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
{
int ret;
@ -372,7 +381,7 @@ index 227c007..9b1ac80 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1144,13 +1218,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1115,13 +1189,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
static NTSTATUS key_destroy( struct key *key )
{
@ -389,7 +398,7 @@ index 227c007..9b1ac80 100644
{
UCHAR *buffer;
@@ -1172,16 +1246,16 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
@@ -1143,16 +1217,16 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
return STATUS_NOT_SUPPORTED;
}
@ -413,7 +422,7 @@ index 227c007..9b1ac80 100644
return STATUS_SUCCESS;
}
@@ -1190,17 +1264,17 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@@ -1167,66 +1241,66 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
UCHAR *buffer;
@ -441,9 +450,6 @@ index 227c007..9b1ac80 100644
return STATUS_SUCCESS;
}
@@ -1211,51 +1285,51 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
-static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
+static NTSTATUS key_symmetric_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
@ -507,7 +513,7 @@ index 227c007..9b1ac80 100644
{
WARN( "CCCryptorUpdate failed %d\n", status );
return STATUS_INTERNAL_ERROR;
@@ -1269,7 +1343,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -1240,7 +1314,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
{
CCCryptorStatus status;
@ -516,14 +522,14 @@ index 227c007..9b1ac80 100644
{
WARN( "CCCryptorUpdate failed %d\n", status );
return STATUS_INTERNAL_ERROR;
@@ -1286,24 +1360,24 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1257,14 +1331,14 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
static NTSTATUS key_destroy( struct key *key )
{
- if (key->ref_encrypt) CCCryptorRelease( key->ref_encrypt );
- if (key->ref_decrypt) CCCryptorRelease( key->ref_decrypt );
- heap_free( key->secret );
+ if (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
+ iif (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
+ if (key->u.s.ref_decrypt) CCCryptorRelease( key->u.s.ref_decrypt );
+ heap_free( key->u.s.secret );
heap_free( key );
@ -534,20 +540,12 @@ index 227c007..9b1ac80 100644
+static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
{
ERR( "support for keys not available at build time\n" );
- key->mode = MODE_ID_CBC;
+ key->u.s.mode = MODE_ID_CBC;
return STATUS_NOT_IMPLEMENTED;
}
@@ -1279,23 +1353,22 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
ERR( "support for keys not available at build time\n" );
- key_copy->mode = MODE_ID_CBC;
+ key_copy->u.s.mode = MODE_ID_CBC;
return STATUS_NOT_IMPLEMENTED;
}
@@ -1313,19 +1387,19 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
@ -570,7 +568,7 @@ index 227c007..9b1ac80 100644
ULONG output_len )
{
ERR( "support for keys not available at build time\n" );
@@ -1380,7 +1454,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
@@ -1350,7 +1423,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
key->hdr.magic = MAGIC_KEY;
@ -579,7 +577,7 @@ index 227c007..9b1ac80 100644
{
heap_free( key );
*handle = NULL;
@@ -1499,19 +1573,30 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1469,19 +1542,30 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
struct key *key = handle;
ULONG bytes_left = input_len;
UCHAR *buf, *src, *dst;
@ -611,7 +609,7 @@ index 227c007..9b1ac80 100644
{
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
@@ -1522,7 +1607,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1492,7 +1576,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if (auth_info->dwFlags & BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG)
FIXME( "call chaining not implemented\n" );
@ -620,7 +618,7 @@ index 227c007..9b1ac80 100644
return status;
*ret_len = input_len;
@@ -1530,46 +1615,47 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1500,46 +1584,47 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if (input && !output) return STATUS_SUCCESS;
if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
@ -683,7 +681,7 @@ index 227c007..9b1ac80 100644
heap_free( buf );
}
@@ -1595,7 +1681,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1565,7 +1650,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
return STATUS_NOT_IMPLEMENTED;
}
@ -692,7 +690,7 @@ index 227c007..9b1ac80 100644
{
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
UCHAR tag[16];
@@ -1605,7 +1691,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1575,7 +1660,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
@ -701,7 +699,7 @@ index 227c007..9b1ac80 100644
return status;
*ret_len = input_len;
@@ -1613,7 +1699,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1583,7 +1668,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
if (!output) return STATUS_SUCCESS;
if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
@ -710,7 +708,7 @@ index 227c007..9b1ac80 100644
return status;
if ((status = key_decrypt( key, input, input_len, output, output_len )))
return status;
@@ -1626,44 +1712,44 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1596,44 +1681,44 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
return STATUS_SUCCESS;
}
@ -773,5 +771,5 @@ index 227c007..9b1ac80 100644
else
status = STATUS_UNSUCCESSFUL; /* FIXME: invalid padding */
--
2.7.4
1.9.1

View File

@ -1,73 +0,0 @@
From 9f12175593de82371bbd40c51f1cf4ea09378590 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 18:49:09 +0200
Subject: [PATCH] include: Add ecdsa and asymmetric key related
bcrypt definitions.
---
include/bcrypt.h | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/include/bcrypt.h b/include/bcrypt.h
index d0b29c7..bf47576 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -61,6 +61,8 @@ typedef LONG NTSTATUS;
#define BCRYPT_OPAQUE_KEY_BLOB (const WCHAR []){'O','p','a','q','u','e','K','e','y','B','l','o','b',0}
#define BCRYPT_KEY_DATA_BLOB (const WCHAR []){'K','e','y','D','a','t','a','B','l','o','b',0}
#define BCRYPT_AES_WRAP_KEY_BLOB (const WCHAR []){'R','f','c','3','5','6','5','K','e','y','W','r','a','p','B','l','o','b',0}
+#define BCRYPT_ECCPUBLIC_BLOB (const WCHAR []){'E','C','C','P','U','B','L','I','C','B','L','O','B',0}
+#define BCRYPT_ECCPRIVATE_BLOB (const WCHAR []){'E','C','C','P','R','I','V','A','T','E','B','L','O','B',0}
#define MS_PRIMITIVE_PROVIDER (const WCHAR [])\
{'M','i','c','r','o','s','o','f','t',' ','P','r','i','m','i','t','i','v','e',' ','P','r','o','v','i','d','e','r',0}
@@ -76,6 +78,9 @@ typedef LONG NTSTATUS;
#define BCRYPT_SHA256_ALGORITHM (const WCHAR []){'S','H','A','2','5','6',0}
#define BCRYPT_SHA384_ALGORITHM (const WCHAR []){'S','H','A','3','8','4',0}
#define BCRYPT_SHA512_ALGORITHM (const WCHAR []){'S','H','A','5','1','2',0}
+#define BCRYPT_ECDSA_P256_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','2','5','6',0}
+#define BCRYPT_ECDSA_P384_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','3','8','4',0}
+#define BCRYPT_ECDSA_P521_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','5','2','1',0}
#define BCRYPT_CHAIN_MODE_NA (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','N','/','A',0}
#define BCRYPT_CHAIN_MODE_CBC (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','B','C',0}
@@ -84,6 +89,13 @@ typedef LONG NTSTATUS;
#define BCRYPT_CHAIN_MODE_CCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','C','M',0}
#define BCRYPT_CHAIN_MODE_GCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','G','C','M',0}
+#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345
+#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC 0x32534345
+#define BCRYPT_ECDSA_PUBLIC_P384_MAGIC 0x33534345
+#define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345
+#define BCRYPT_ECDSA_PUBLIC_P521_MAGIC 0x35534345
+#define BCRYPT_ECDSA_PRIVATE_P521_MAGIC 0x36534345
+
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
{
LPWSTR pszName;
@@ -115,6 +127,22 @@ typedef struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
ULONG dwFlags;
} BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO, *PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO;
+typedef struct _BCRYPT_ECCKEY_BLOB
+{
+ ULONG dwMagic;
+ ULONG cbKey;
+} BCRYPT_ECCKEY_BLOB, *PBCRYPT_ECCKEY_BLOB;
+
+typedef struct _BCRYPT_PKCS1_PADDING_INFO
+{
+ LPCWSTR pszAlgId;
+} BCRYPT_PKCS1_PADDING_INFO;
+
+#define BCRYPT_PAD_NONE 0x00000001
+#define BCRYPT_PAD_PKCS1 0x00000002
+#define BCRYPT_PAD_OAEP 0x00000004
+#define BCRYPT_PAD_PSS 0x00000008
+
#define BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION 1
#define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
--
1.9.1

View File

@ -1,14 +1,14 @@
From 4bdabbed491daddcfe5b29c61843f18fb08f0d0c Mon Sep 17 00:00:00 2001
From 095c654875966c29472ceb56be564f689ad4f22c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 18:50:04 +0200
Subject: [PATCH 31/36] bcrypt/tests: Add basic test for ecdsa.
Subject: [PATCH] bcrypt/tests: Add basic test for ecdsa.
---
dlls/bcrypt/tests/bcrypt.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index a0906e9904..9b04f62df2 100644
index ac5fc36..22a0ffe 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -50,6 +50,8 @@ static NTSTATUS (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE);
@ -105,5 +105,5 @@ index a0906e9904..9b04f62df2 100644
if (pBCryptHash) /* >= Win 10 */
test_BcryptHash();
--
2.16.1
1.9.1

View File

@ -1,7 +1,7 @@
From 6bd5e33916b76195ecf5ce743de346bb9874295b Mon Sep 17 00:00:00 2001
From a1c152388920e9a6b3cafc840df1e28822f52180 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 19:18:58 +0200
Subject: [PATCH 32/36] bcrypt: Implement importing of ecdsa keys.
Subject: [PATCH] bcrypt: Implement importing of ecdsa keys.
---
dlls/bcrypt/bcrypt.spec | 4 +-
@ -33,7 +33,7 @@ index 28c2394..78824d7 100644
@ stub GetCipherInterface
@ stub GetHashInterface
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 9b1ac80..9efa132 100644
index 0791cf3..c1a5114 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -220,7 +220,9 @@ enum alg_id
@ -58,7 +58,7 @@ index 9b1ac80..9efa132 100644
};
struct algorithm
@@ -327,6 +331,8 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
@@ -324,6 +328,8 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
else if (!strcmpW( id, BCRYPT_SHA512_ALGORITHM )) alg_id = ALG_ID_SHA512;
@ -67,7 +67,7 @@ index 9b1ac80..9efa132 100644
else
{
FIXME( "algorithm %s not supported\n", debugstr_w(id) );
@@ -895,6 +901,12 @@ struct key_symmetric
@@ -866,6 +872,12 @@ struct key_symmetric
ULONG secret_len;
};
@ -80,7 +80,7 @@ index 9b1ac80..9efa132 100644
struct key
{
struct object hdr;
@@ -902,6 +914,7 @@ struct key
@@ -873,6 +885,7 @@ struct key
union
{
struct key_symmetric s;
@ -88,7 +88,7 @@ index 9b1ac80..9efa132 100644
} u;
};
@@ -916,6 +929,12 @@ struct key_symmetric
@@ -887,6 +900,12 @@ struct key_symmetric
ULONG secret_len;
};
@ -101,7 +101,7 @@ index 9b1ac80..9efa132 100644
struct key
{
struct object hdr;
@@ -923,6 +942,7 @@ struct key
@@ -894,6 +913,7 @@ struct key
union
{
struct key_symmetric s;
@ -109,7 +109,7 @@ index 9b1ac80..9efa132 100644
} u;
};
#else
@@ -998,6 +1018,12 @@ static inline BOOL key_is_symmetric( struct key *key )
@@ -969,6 +989,12 @@ static inline BOOL key_is_symmetric( struct key *key )
return FALSE;
}
@ -122,8 +122,8 @@ index 9b1ac80..9efa132 100644
static NTSTATUS key_symmetric_get_mode( struct key *key, enum mode_id *mode )
{
*mode = key->u.s.mode;
@@ -1041,6 +1067,33 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
return STATUS_SUCCESS;
@@ -1042,6 +1068,33 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
@ -156,7 +156,7 @@ index 9b1ac80..9efa132 100644
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
UCHAR *buffer;
@@ -1061,7 +1114,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@@ -1062,7 +1115,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
}
else
{
@ -171,7 +171,7 @@ index 9b1ac80..9efa132 100644
}
return STATUS_SUCCESS;
@@ -1218,8 +1277,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1189,8 +1248,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
static NTSTATUS key_destroy( struct key *key )
{
@ -187,8 +187,8 @@ index 9b1ac80..9efa132 100644
heap_free( key );
return STATUS_SUCCESS;
}
@@ -1260,6 +1324,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
return STATUS_SUCCESS;
@@ -1237,6 +1301,12 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
@ -200,7 +200,7 @@ index 9b1ac80..9efa132 100644
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
UCHAR *buffer;
@@ -1374,6 +1444,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
@@ -1350,6 +1420,12 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
@ -213,7 +213,7 @@ index 9b1ac80..9efa132 100644
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
ERR( "support for keys not available at build time\n" );
@@ -1556,6 +1632,88 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
@@ -1525,6 +1601,88 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
return STATUS_SUCCESS;
}
@ -303,7 +303,7 @@ index 9b1ac80..9efa132 100644
{
struct key *key = handle;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 1c2700d..aaa187e 100644
index 22a0ffe..73d3325 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1404,7 +1404,7 @@ static void test_ECDSA(void)
@ -329,10 +329,10 @@ index 1c2700d..aaa187e 100644
pBCryptDestroyKey(key);
pBCryptCloseAlgorithmProvider(alg, 0);
diff --git a/include/bcrypt.h b/include/bcrypt.h
index bf47576..6804f2b 100644
index 717d77c..f28b0d3 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -210,8 +210,10 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
@@ -211,8 +211,10 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG);
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
@ -344,5 +344,5 @@ index bf47576..6804f2b 100644
#endif /* __WINE_BCRYPT_H */
--
2.7.4
1.9.1

View File

@ -1,8 +1,7 @@
From d10899e701ce7fd4463b30c90ad8c2656a6adead Mon Sep 17 00:00:00 2001
From 6b19309d0496fef0d87553b074bd80a487d9cac1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 20:31:00 +0200
Subject: [PATCH 33/36] bcrypt: Implement BCryptVerifySignature for ecdsa
signatures.
Subject: [PATCH] bcrypt: Implement BCryptVerifySignature for ecdsa signatures.
---
dlls/bcrypt/bcrypt_main.c | 343 +++++++++++++++++++++++++++++++++++++++++++--
@ -10,7 +9,7 @@ Subject: [PATCH 33/36] bcrypt: Implement BCryptVerifySignature for ecdsa
2 files changed, 337 insertions(+), 10 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 9efa132..082474b 100644
index c1a5114..057a27d 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -27,6 +27,7 @@
@ -126,7 +125,7 @@ index 9efa132..082474b 100644
if (TRACE_ON( bcrypt ))
{
@@ -1275,6 +1329,264 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1246,6 +1300,264 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_SUCCESS;
}
@ -391,7 +390,7 @@ index 9efa132..082474b 100644
static NTSTATUS key_destroy( struct key *key )
{
if(key_is_symmetric(key))
@@ -1428,6 +1740,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1399,6 +1711,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_NOT_IMPLEMENTED;
}
@ -404,8 +403,8 @@ index 9efa132..082474b 100644
+
static NTSTATUS key_destroy( struct key *key )
{
if (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
@@ -1495,6 +1814,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
iif (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
@@ -1464,6 +1783,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_NOT_IMPLEMENTED;
}
@ -419,7 +418,7 @@ index 9efa132..082474b 100644
static NTSTATUS key_destroy( struct key *key )
{
ERR( "support for keys not available at build time\n" );
@@ -1705,13 +2031,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
@@ -1674,13 +2000,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
{
struct key *key = handle;
@ -437,7 +436,7 @@ index 9efa132..082474b 100644
NTSTATUS WINAPI BCryptDestroyKey( BCRYPT_KEY_HANDLE handle )
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index aaa187e..6b62fb3 100644
index 73d3325..d0bc52d 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1420,10 +1420,10 @@ static void test_ECDSA(void)
@ -454,5 +453,5 @@ index aaa187e..6b62fb3 100644
pBCryptDestroyKey(key);
pBCryptCloseAlgorithmProvider(alg, 0);
--
2.7.4
1.9.1

View File

@ -1,7 +1,7 @@
From d9e0c414c53eb664791de70e5eb2b03e2c8ccb66 Mon Sep 17 00:00:00 2001
From 53cb3911bc744414e3f0dce3e33ccad2bbd507e7 Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Tue, 10 Oct 2017 16:40:41 +0300
Subject: [PATCH 34/36] bcrypt: Initial implementation for RSA key import and
Subject: [PATCH] bcrypt: Initial implementation for RSA key import and
signature verification.
---
@ -10,7 +10,7 @@ Subject: [PATCH 34/36] bcrypt: Initial implementation for RSA key import and
2 files changed, 135 insertions(+), 10 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index d7a6435581..4f7e7636ca 100644
index 057a27d..f858bec 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -77,6 +77,9 @@ static int (*pgnutls_pubkey_verify_hash2)(gnutls_pubkey_t key, gnutls_sign_algor
@ -35,7 +35,7 @@ index d7a6435581..4f7e7636ca 100644
static void gnutls_log( int level, const char *msg )
{
TRACE( "<%d> %s", level, msg );
@@ -181,6 +189,11 @@ static BOOL gnutls_initialize(void)
@@ -186,6 +194,11 @@ static BOOL gnutls_initialize(void)
WARN("gnutls_pubkey_verify_hash2 not found\n");
pgnutls_pubkey_verify_hash2 = compat_gnutls_pubkey_verify_hash2;
}
@ -47,7 +47,7 @@ index d7a6435581..4f7e7636ca 100644
if (TRACE_ON( bcrypt ))
{
@@ -276,6 +289,7 @@ enum alg_id
@@ -271,6 +284,7 @@ enum alg_id
ALG_ID_MD4,
ALG_ID_MD5,
ALG_ID_RNG,
@ -55,7 +55,7 @@ index d7a6435581..4f7e7636ca 100644
ALG_ID_SHA1,
ALG_ID_SHA256,
ALG_ID_SHA384,
@@ -306,6 +320,7 @@ static const struct {
@@ -301,6 +315,7 @@ static const struct {
/* ALG_ID_MD4 */ { 270, 16, 512, BCRYPT_MD4_ALGORITHM, FALSE },
/* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM, FALSE },
/* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM, FALSE },
@ -63,7 +63,7 @@ index d7a6435581..4f7e7636ca 100644
/* ALG_ID_SHA1 */ { 278, 20, 512, BCRYPT_SHA1_ALGORITHM, FALSE },
/* ALG_ID_SHA256 */ { 286, 32, 512, BCRYPT_SHA256_ALGORITHM, FALSE },
/* ALG_ID_SHA384 */ { 382, 48, 1024, BCRYPT_SHA384_ALGORITHM, FALSE },
@@ -386,6 +401,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
@@ -378,6 +393,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
else if (!strcmpW( id, BCRYPT_MD4_ALGORITHM )) alg_id = ALG_ID_MD4;
else if (!strcmpW( id, BCRYPT_MD5_ALGORITHM )) alg_id = ALG_ID_MD5;
else if (!strcmpW( id, BCRYPT_RNG_ALGORITHM )) alg_id = ALG_ID_RNG;
@ -71,7 +71,7 @@ index d7a6435581..4f7e7636ca 100644
else if (!strcmpW( id, BCRYPT_SHA1_ALGORITHM )) alg_id = ALG_ID_SHA1;
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
@@ -1074,6 +1090,7 @@ static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, con
@@ -1132,6 +1148,7 @@ static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, con
{
case ALG_ID_ECDSA_P256:
case ALG_ID_ECDSA_P384:
@ -79,7 +79,7 @@ index d7a6435581..4f7e7636ca 100644
break;
default:
@@ -1449,6 +1466,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
@@ -1446,6 +1463,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
return STATUS_SUCCESS;
}
@ -114,7 +114,7 @@ index d7a6435581..4f7e7636ca 100644
static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_key)
{
switch (key->alg_id)
@@ -1456,6 +1501,8 @@ static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_
@@ -1453,6 +1498,8 @@ static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_
case ALG_ID_ECDSA_P256:
case ALG_ID_ECDSA_P384:
return import_gnutls_pubkey_ecc( key, gnutls_key );
@ -123,7 +123,7 @@ index d7a6435581..4f7e7636ca 100644
default:
FIXME("Algorithm %d not yet supported\n", key->alg_id);
@@ -1485,6 +1532,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
@@ -1482,6 +1529,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
return STATUS_SUCCESS;
}
@ -138,7 +138,7 @@ index d7a6435581..4f7e7636ca 100644
static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULONG signature_len,
gnutls_datum_t *gnutls_signature )
{
@@ -1493,6 +1548,8 @@ static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULO
@@ -1490,6 +1545,8 @@ static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULO
case ALG_ID_ECDSA_P256:
case ALG_ID_ECDSA_P384:
return prepare_gnutls_signature_ecc( key, signature, signature_len, gnutls_signature );
@ -147,7 +147,7 @@ index d7a6435581..4f7e7636ca 100644
default:
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
@@ -1511,18 +1568,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1508,18 +1565,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
NTSTATUS status;
int ret;
@ -195,7 +195,7 @@ index d7a6435581..4f7e7636ca 100644
}
switch (key->alg_id)
@@ -1531,6 +1608,9 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1528,6 +1605,9 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
case ALG_ID_ECDSA_P384:
pk_algo = GNUTLS_PK_ECC;
break;
@ -205,7 +205,7 @@ index d7a6435581..4f7e7636ca 100644
default:
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
@@ -1556,7 +1636,8 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1553,7 +1633,8 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
gnutls_hash.size = hash_len;
ret = pgnutls_pubkey_verify_hash2( gnutls_key, sign_algo, 0, &gnutls_hash, &gnutls_signature );
@ -215,7 +215,7 @@ index d7a6435581..4f7e7636ca 100644
pgnutls_pubkey_deinit( gnutls_key );
return (ret < 0) ? STATUS_INVALID_SIGNATURE : STATUS_SUCCESS;
}
@@ -1938,6 +2019,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
@@ -1990,6 +2071,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
*ret_key = key;
return STATUS_SUCCESS;
}
@ -250,7 +250,7 @@ index d7a6435581..4f7e7636ca 100644
FIXME( "unsupported key type %s\n", debugstr_w(type) );
return STATUS_NOT_SUPPORTED;
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 6804f2bff5..2a9a0d0986 100644
index f28b0d3..df54f62 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -63,6 +63,8 @@ typedef LONG NTSTATUS;
@ -292,5 +292,5 @@ index 6804f2bff5..2a9a0d0986 100644
{
LPCWSTR pszAlgId;
--
2.16.1
1.9.1

View File

@ -1,7 +1,7 @@
From 198271bfc6e17cb7be8f2296ea2375eb3a441db1 Mon Sep 17 00:00:00 2001
From 40c9ce94bf6975c77741669a86136935303a138e Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Tue, 10 Oct 2017 16:41:09 +0300
Subject: [PATCH 35/36] bcrypt/tests: Add simple test for RSA.
Subject: [PATCH] bcrypt/tests: Add simple test for RSA.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -12,7 +12,7 @@ Based on patch from Bernhard Übelacker.
1 file changed, 95 insertions(+)
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 047ffb4e6f..c0b936f6e5 100644
index d0bc52d..feb74c4 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1429,6 +1429,100 @@ static void test_ECDSA(void)
@ -125,5 +125,5 @@ index 047ffb4e6f..c0b936f6e5 100644
if (pBCryptHash) /* >= Win 10 */
test_BcryptHash();
--
2.16.1
1.9.1

View File

@ -1,18 +1,17 @@
From 139caeb5c401db46fc11cd8de60791f035852cbd Mon Sep 17 00:00:00 2001
From f986cac5710ee6bbf96aae2cdefea4f8eb49653e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 14 Oct 2017 22:44:13 +0200
Subject: [PATCH 36/36] bcrypt: Store full ECCKEY_BLOB struct in
BCryptImportKeyPair.
Subject: [PATCH] bcrypt: Store full ECCKEY_BLOB struct in BCryptImportKeyPair.
---
dlls/bcrypt/bcrypt_main.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 4f7e7636ca..695c49acd1 100644
index f858bec..c2300b4 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1431,6 +1431,7 @@ static void buffer_append_asn1_r_s( struct buffer *buffer, BYTE *r, DWORD r_len,
@@ -1428,6 +1428,7 @@ static void buffer_append_asn1_r_s( struct buffer *buffer, BYTE *r, DWORD r_len,
static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnutls_key )
{
@ -20,7 +19,7 @@ index 4f7e7636ca..695c49acd1 100644
gnutls_ecc_curve_t curve;
gnutls_datum_t x, y;
int ret;
@@ -1451,10 +1452,11 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
@@ -1448,10 +1449,11 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
return STATUS_INTERNAL_ERROR;
}
@ -36,7 +35,7 @@ index 4f7e7636ca..695c49acd1 100644
if ((ret = pgnutls_pubkey_import_ecc_raw( *gnutls_key, curve, &x, &y )))
{
@@ -2010,7 +2012,7 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
@@ -2062,7 +2064,7 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
return STATUS_NO_MEMORY;
key->hdr.magic = MAGIC_KEY;
@ -46,5 +45,5 @@ index 4f7e7636ca..695c49acd1 100644
HeapFree( GetProcessHeap(), 0, key );
return status;
--
2.16.1
1.9.1

View File

@ -1,2 +1 @@
Fixes: [44500] Add stubs for FltRegisterFilter, FltStartFiltering, FltUnregisterFilter
Depends: ntoskrnl-Ob_callbacks

View File

@ -1,39 +0,0 @@
From 92cb03fb619558c2193475843fbde619f517469d Mon Sep 17 00:00:00 2001
From: Jarkko Korpi <jarkko_korpi@hotmail.com>
Date: Wed, 15 Jul 2015 02:38:25 +0300
Subject: kernel32: Silence repeated LocaleNameToLCID unsupported flags
message.
---
dlls/kernel32/locale.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index eaf1183..74f77dd 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -1093,8 +1093,10 @@ LANGID WINAPI GetSystemDefaultUILanguage(void)
LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags )
{
struct locale_name locale_name;
+ static int once;
- if (flags) FIXME( "unsupported flags %x\n", flags );
+ if (flags && !once++)
+ FIXME( "unsupported flags %x\n", flags );
if (name == LOCALE_NAME_USER_DEFAULT)
return GetUserDefaultLCID();
@@ -1124,7 +1126,8 @@ LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags )
*/
INT WINAPI LCIDToLocaleName( LCID lcid, LPWSTR name, INT count, DWORD flags )
{
- if (flags) FIXME( "unsupported flags %x\n", flags );
+ static int once;
+ if (flags && !once++) FIXME( "unsupported flags %x\n", flags );
return GetLocaleInfoW( lcid, LOCALE_SNAME | LOCALE_NOUSEROVERRIDE, name, count );
}
--
2.4.5

View File

@ -1 +0,0 @@
Fixes: [30076] Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs

View File

@ -1,128 +0,0 @@
From a1f421186a42a54456a7507f117c135d8a248040 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 9 Mar 2018 14:21:46 +1100
Subject: [PATCH] include: Add more typedefs to wdm.h
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
include/ddk/wdm.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 8f5b909447..d874a35daa 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -44,6 +44,7 @@ typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
typedef ULONG_PTR ERESOURCE_THREAD;
typedef ERESOURCE_THREAD *PERESOURCE_THREAD;
+typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION;
struct _KDPC;
struct _KAPC;
@@ -1291,6 +1292,102 @@ typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST
typedef NTSTATUS (NTAPI EX_CALLBACK_FUNCTION)(void *CallbackContext, void *Argument1, void *Argument2);
typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION;
+typedef ULONG OB_OPERATION;
+
+typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION {
+ ACCESS_MASK DesiredAccess;
+ ACCESS_MASK OriginalDesiredAccess;
+} OB_PRE_CREATE_HANDLE_INFORMATION, *POB_PRE_CREATE_HANDLE_INFORMATION;
+
+typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION {
+ ACCESS_MASK DesiredAccess;
+ ACCESS_MASK OriginalDesiredAccess;
+ PVOID SourceProcess;
+ PVOID TargetProcess;
+} OB_PRE_DUPLICATE_HANDLE_INFORMATION, *POB_PRE_DUPLICATE_HANDLE_INFORMATION;
+
+typedef union _OB_PRE_OPERATION_PARAMETERS {
+ OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation;
+ OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
+} OB_PRE_OPERATION_PARAMETERS, *POB_PRE_OPERATION_PARAMETERS;
+
+typedef struct _OB_PRE_OPERATION_INFORMATION {
+ OB_OPERATION Operation;
+ union {
+ ULONG Flags;
+ struct {
+ ULONG KernelHandle:1;
+ ULONG Reserved:31;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ PVOID Object;
+ POBJECT_TYPE ObjectType;
+ PVOID CallContext;
+ POB_PRE_OPERATION_PARAMETERS Parameters;
+} OB_PRE_OPERATION_INFORMATION, *POB_PRE_OPERATION_INFORMATION;
+
+typedef struct _OB_POST_CREATE_HANDLE_INFORMATION {
+ IN ACCESS_MASK GrantedAccess;
+} OB_POST_CREATE_HANDLE_INFORMATION, *POB_POST_CREATE_HANDLE_INFORMATION;
+
+typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION {
+ IN ACCESS_MASK GrantedAccess;
+} OB_POST_DUPLICATE_HANDLE_INFORMATION, *POB_POST_DUPLICATE_HANDLE_INFORMATION;
+
+typedef union _OB_POST_OPERATION_PARAMETERS {
+ IN OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation;
+ IN OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
+} OB_POST_OPERATION_PARAMETERS, *POB_POST_OPERATION_PARAMETERS;
+
+typedef struct _OB_POST_OPERATION_INFORMATION {
+ OB_OPERATION Operation;
+ union {
+ IN ULONG Flags;
+ struct {
+ ULONG KernelHandle:1;
+ ULONG Reserved:31;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ PVOID Object;
+ POBJECT_TYPE ObjectType;
+ PVOID CallContext;
+ NTSTATUS ReturnStatus;
+ POB_POST_OPERATION_PARAMETERS Parameters;
+} OB_POST_OPERATION_INFORMATION,*POB_POST_OPERATION_INFORMATION;
+
+typedef enum _OB_PREOP_CALLBACK_STATUS {
+ OB_PREOP_SUCCESS
+} OB_PREOP_CALLBACK_STATUS, *POB_PREOP_CALLBACK_STATUS;
+
+typedef OB_PREOP_CALLBACK_STATUS
+(WINAPI *POB_PRE_OPERATION_CALLBACK)(void *context, POB_PRE_OPERATION_INFORMATION information);
+
+typedef void
+(WINAPI *POB_POST_OPERATION_CALLBACK)(void *context, POB_POST_OPERATION_INFORMATION information);
+
+typedef struct _OB_OPERATION_REGISTRATION {
+ POBJECT_TYPE *ObjectType;
+ OB_OPERATION Operations;
+ POB_PRE_OPERATION_CALLBACK PreOperation;
+ POB_POST_OPERATION_CALLBACK PostOperation;
+} OB_OPERATION_REGISTRATION, *POB_OPERATION_REGISTRATION;
+
+typedef struct _OB_CALLBACK_REGISTRATION {
+ USHORT Version;
+ USHORT OperationRegistrationCount;
+ UNICODE_STRING Altitude;
+ PVOID RegistrationContext;
+ OB_OPERATION_REGISTRATION *OperationRegistration;
+} OB_CALLBACK_REGISTRATION, *POB_CALLBACK_REGISTRATION;
+
+#define OB_FLT_REGISTRATION_VERSION_0100 0x0100
+#define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100
+
+typedef enum _DIRECTORY_NOTIFY_INFORMATION_CLASS {
+ DirectoryNotifyInformation = 1,
+ DirectoryNotifyExtendedInformation
+} DIRECTORY_NOTIFY_INFORMATION_CLASS, *PDIRECTORY_NOTIFY_INFORMATION_CLASS;
+
NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle);
#ifdef NONAMELESSUNION
--
2.16.1

View File

@ -1,50 +0,0 @@
From de2e5f34189173bb594b68fc392268c8820589e6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 9 Mar 2018 16:27:51 +1100
Subject: [PATCH] include: Add more types to ntifs.h
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
include/ddk/ntifs.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h
index 32c9e3084b..5e7dd18c7e 100644
--- a/include/ddk/ntifs.h
+++ b/include/ddk/ntifs.h
@@ -19,8 +19,24 @@
#ifndef __NTIFS_H__
#define __NTIFS_H__
+#include "ntddk.h"
+
typedef struct _EX_PUSH_LOCK EX_PUSH_LOCK, *PEX_PUSH_LOCK;
+typedef enum _FS_FILTER_SECTION_SYNC_TYPE
+{
+ SyncTypeOther = 0,
+ SyncTypeCreateSection
+} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE;
+
+typedef struct _FS_FILTER_SECTION_SYNC_OUTPUT
+{
+ ULONG StructureSize;
+ ULONG SizeReturned;
+ ULONG Flags;
+ ULONG DesiredReadAlignment;
+} FS_FILTER_SECTION_SYNC_OUTPUT, *PFS_FILTER_SECTION_SYNC_OUTPUT;
+
typedef struct _KQUEUE
{
DISPATCHER_HEADER Header;
@@ -30,6 +46,7 @@ typedef struct _KQUEUE
LIST_ENTRY ThreadListHead;
} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
+
NTSTATUS WINAPI ObQueryNameString(PVOID,POBJECT_NAME_INFORMATION,ULONG,PULONG);
#endif
--
2.16.1

View File

@ -1,62 +0,0 @@
From 2577f27639376d7e4bf1a58d9c08e4944d1242e6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 9 Mar 2018 14:26:26 +1100
Subject: [PATCH] ntoskrnl.exe: Add ObRegisterCallbacks stub
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 12 ++++++++++++
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 +
include/ddk/wdm.h | 1 +
3 files changed, 14 insertions(+)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 57bf33e07f..91ad00af2b 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -2408,6 +2408,18 @@ void WINAPI ObfDereferenceObject( void *obj )
ObDereferenceObject( obj );
}
+/***********************************************************************
+ * ObRegisterCallbacks (NTOSKRNL.EXE.@)
+ */
+NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION *callBack, void **handle)
+{
+ FIXME( "stub: %p %p\n", callBack, handle );
+
+ if(handle)
+ *handle = UlongToHandle(0xdeadbeaf);
+
+ return STATUS_SUCCESS;
+}
/***********************************************************************
* IoGetAttachedDeviceReference (NTOSKRNL.EXE.@)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 7580a96cd8..56f01dd2ba 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -817,6 +817,7 @@
@ stdcall ObReferenceObjectByName(ptr long ptr long ptr long ptr ptr)
@ stdcall ObReferenceObjectByPointer(ptr long ptr long)
@ stub ObReferenceSecurityDescriptor
+@ stdcall ObRegisterCallbacks(ptr ptr)
@ stub ObReleaseObjectSecurity
@ stub ObSetHandleAttributes
@ stub ObSetSecurityDescriptorInfo
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index d874a35daa..5e575236f2 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1501,6 +1501,7 @@ static inline void *MmGetSystemAddressForMdlSafe(MDL *mdl, ULONG priority)
}
void WINAPI ObDereferenceObject(void*);
+NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION*, void**);
NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**);
NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE);
--
2.16.1

Some files were not shown because too many files have changed in this diff Show More