Rebase against 0f1cb96b694a38106464044285296e531f90bb67

This commit is contained in:
Alistair Leslie-Hughes 2018-02-13 09:38:21 +11:00
parent 8b685b1ebd
commit e58651c321
26 changed files with 330 additions and 768 deletions

View File

@ -1,7 +1,7 @@
From 3092c9de3ac89e77a139db97a33b8b15f9a12eac Mon Sep 17 00:00:00 2001
From 971789f2af6149998e54382522569b3790309cf2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 7 Aug 2017 02:28:35 +0200
Subject: server: Implement token integrity level.
Subject: [PATCH] server: Implement token integrity level.
---
dlls/ntdll/nt.c | 23 ++++++++++++++---------
@ -10,10 +10,10 @@ Subject: server: Implement token integrity level.
3 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index dda6cabe1cf..6f2b24e6ba4 100644
index 9e60196..59c6e49 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -372,7 +372,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
@@ -340,7 +340,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
0, /* TokenAccessInformation */
0, /* TokenVirtualizationAllowed */
0, /* TokenVirtualizationEnabled */
@ -21,8 +21,8 @@ index dda6cabe1cf..6f2b24e6ba4 100644
+ 0, /* TokenIntegrityLevel */
0, /* TokenUIAccess */
0, /* TokenMandatoryPolicy */
sizeof(TOKEN_GROUPS) + sizeof(logon_sid), /* TokenLogonSid */
@@ -625,18 +625,23 @@ NTSTATUS WINAPI NtQueryInformationToken(
0, /* TokenLogonSid */
@@ -593,18 +593,23 @@ NTSTATUS WINAPI NtQueryInformationToken(
}
break;
case TokenIntegrityLevel:
@ -55,10 +55,10 @@ index dda6cabe1cf..6f2b24e6ba4 100644
case TokenAppContainerSid:
{
diff --git a/server/protocol.def b/server/protocol.def
index 33f1d5f0ab8..ac2e2242511 100644
index c961eaf..0bb04cd 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3424,6 +3424,13 @@ enum caret_state
@@ -3388,6 +3388,13 @@ enum caret_state
VARARG(sid,SID); /* the sid specified by which_sid from the token */
@END
@ -73,10 +73,10 @@ index 33f1d5f0ab8..ac2e2242511 100644
obj_handle_t handle; /* handle to the token */
@REPLY
diff --git a/server/token.c b/server/token.c
index 292e1df80fd..8d2de6ab58e 100644
index 355a523..1ed994a 100644
--- a/server/token.c
+++ b/server/token.c
@@ -127,6 +127,7 @@ struct token
@@ -112,6 +112,7 @@ struct token
TOKEN_SOURCE source; /* source of the token */
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
TOKEN_ELEVATION_TYPE elevation; /* elevation level */
@ -84,7 +84,7 @@ index 292e1df80fd..8d2de6ab58e 100644
};
struct privilege
@@ -567,7 +568,8 @@ static struct token *create_token( unsigned primary, const SID *user,
@@ -544,7 +545,8 @@ static struct token *create_token( unsigned primary, const SID *user,
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
const ACL *default_dacl, TOKEN_SOURCE source,
const luid_t *modified_id,
@ -94,7 +94,7 @@ index 292e1df80fd..8d2de6ab58e 100644
{
struct token *token = alloc_object( &token_ops );
if (token)
@@ -648,6 +650,7 @@ static struct token *create_token( unsigned primary, const SID *user,
@@ -625,6 +627,7 @@ static struct token *create_token( unsigned primary, const SID *user,
}
token->source = source;
@ -102,7 +102,7 @@ index 292e1df80fd..8d2de6ab58e 100644
}
return token;
}
@@ -703,7 +706,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
@@ -680,7 +683,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
NULL, 0, src_token->default_dacl,
src_token->source, modified_id,
impersonation_level,
@ -112,7 +112,7 @@ index 292e1df80fd..8d2de6ab58e 100644
if (!token) return token;
/* copy groups */
@@ -907,7 +911,7 @@ struct token *token_create_admin( void )
@@ -884,7 +888,7 @@ struct token *token_create_admin( void )
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
token = create_token( TRUE, user_sid, admin_groups, sizeof(admin_groups)/sizeof(admin_groups[0]),
admin_privs, sizeof(admin_privs)/sizeof(admin_privs[0]), default_dacl,
@ -121,7 +121,7 @@ index 292e1df80fd..8d2de6ab58e 100644
/* we really need a primary group */
assert( token->primary_group );
}
@@ -1550,6 +1554,26 @@ DECL_HANDLER(get_token_sid)
@@ -1530,6 +1534,26 @@ DECL_HANDLER(get_token_sid)
}
}
@ -149,5 +149,5 @@ index 292e1df80fd..8d2de6ab58e 100644
DECL_HANDLER(get_token_groups)
{
--
2.13.1
1.9.1

View File

@ -1,7 +1,8 @@
From 6444094c9ef4f30a253bcee9e873ed511bda222c Mon Sep 17 00:00:00 2001
From d67d7293a17592b580d284fa68881a613e61f591 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 01:45:29 +0200
Subject: ntdll: Add function to create new tokens for elevation purposes.
Subject: [PATCH] ntdll: Add function to create new tokens for elevation
purposes.
---
dlls/ntdll/ntdll.spec | 3 ++
@ -13,10 +14,10 @@ Subject: ntdll: Add function to create new tokens for elevation purposes.
6 files changed, 117 insertions(+)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index c814f405017..eb84cc97bf8 100644
index dbead5e..586b504 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1483,6 +1483,9 @@
@@ -1482,6 +1482,9 @@
# Virtual memory
@ cdecl __wine_locked_recvmsg(long ptr long)
@ -27,10 +28,10 @@ index c814f405017..eb84cc97bf8 100644
@ cdecl wine_get_version() NTDLL_wine_get_version
@ cdecl wine_get_patches() NTDLL_wine_get_patches
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 907bbdd2d95..a7810f716ad 100644
index 8a64338..137a22d 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -77,6 +77,9 @@ extern void virtual_init_threading(void) DECLSPEC_HIDDEN;
@@ -80,6 +80,9 @@ extern void virtual_init_threading(void) DECLSPEC_HIDDEN;
extern void fill_cpu_info(void) DECLSPEC_HIDDEN;
extern void heap_set_debug_flags( HANDLE handle ) DECLSPEC_HIDDEN;
@ -41,7 +42,7 @@ index 907bbdd2d95..a7810f716ad 100644
extern timeout_t server_start_time DECLSPEC_HIDDEN;
extern unsigned int server_cpus DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index f615ce2fea7..77048003ace 100644
index 40034b4..1ebbb79 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -99,6 +99,24 @@ HANDLE CDECL __wine_make_process_system(void)
@ -70,10 +71,10 @@ index f615ce2fea7..77048003ace 100644
#define UNIMPLEMENTED_INFO_CLASS(c) \
diff --git a/server/protocol.def b/server/protocol.def
index c8ab4bf8c36..59fe9aec7a8 100644
index 0bb04cd..f2deca6 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3628,6 +3628,14 @@ struct handle_info
@@ -3641,6 +3641,14 @@ struct handle_info
@END
@ -89,7 +90,7 @@ index c8ab4bf8c36..59fe9aec7a8 100644
@REQ(create_completion)
unsigned int access; /* desired access to a port */
diff --git a/server/security.h b/server/security.h
index 6c337143c3d..21e90ccf23f 100644
index 6c33714..21e90cc 100644
--- a/server/security.h
+++ b/server/security.h
@@ -49,6 +49,7 @@ extern const PSID security_builtin_users_sid;
@ -101,18 +102,18 @@ index 6c337143c3d..21e90ccf23f 100644
/* token functions */
diff --git a/server/token.c b/server/token.c
index 3301283ee25..7abd92386ea 100644
index 7776cbe..64ab565 100644
--- a/server/token.c
+++ b/server/token.c
@@ -71,6 +71,7 @@ static const SID anonymous_logon_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORIT
@@ -79,6 +79,7 @@ static const SID anonymous_logon_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORIT
static const SID authenticated_user_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_AUTHENTICATED_USER_RID } };
static const SID local_system_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_LOCAL_SYSTEM_RID } };
static const SID high_label_sid = { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY }, { SECURITY_MANDATORY_HIGH_RID } };
+static const SID medium_label_sid = { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY }, { SECURITY_MANDATORY_MEDIUM_RID } };
static const struct /* same fields as struct SID */
{
BYTE Revision;
@@ -110,6 +111,7 @@ const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
static const SID_N(5) local_user_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } };
static const SID_N(2) builtin_admins_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } };
static const SID_N(2) builtin_users_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } };
@@ -95,6 +96,7 @@ const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
const PSID security_builtin_users_sid = (PSID)&builtin_users_sid;
const PSID security_domain_users_sid = (PSID)&domain_users_sid;
const PSID security_high_label_sid = (PSID)&high_label_sid;
@ -120,7 +121,7 @@ index 3301283ee25..7abd92386ea 100644
static luid_t prev_luid_value = { 1000, 0 };
@@ -915,6 +917,64 @@ struct token *token_create_admin( void )
@@ -901,6 +903,64 @@ struct token *token_create_admin( void )
return token;
}
@ -185,7 +186,7 @@ index 3301283ee25..7abd92386ea 100644
static struct privilege *token_find_privilege( struct token *token, const LUID *luid, int enabled_only )
{
struct privilege *privilege;
@@ -1729,3 +1789,27 @@ DECL_HANDLER(set_token_default_dacl)
@@ -1718,3 +1778,27 @@ DECL_HANDLER(set_token_default_dacl)
release_object( token );
}
}
@ -214,5 +215,5 @@ index 3301283ee25..7abd92386ea 100644
+ }
+}
--
2.14.1
1.9.1

View File

@ -1,7 +1,7 @@
From e15be9d22652dbf7ef027ce5f3ef3faa42139c7a Mon Sep 17 00:00:00 2001
From 3009b829c97f3a072ca0f93250776d0b3de2cbb8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 03:39:55 +0200
Subject: ntdll: Implement process token elevation through manifests.
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
---
dlls/ntdll/loader.c | 37 +++++++++++++++++++++++++++++++++++++
@ -12,14 +12,13 @@ Subject: ntdll: Implement process token elevation through manifests.
5 files changed, 67 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index cdf8d586c36..5162e2fc0ec 100644
index 49e8619..a908142 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3095,6 +3095,32 @@ static void load_global_options(void)
}
@@ -3053,6 +3053,32 @@ NTSTATUS attach_dlls( CONTEXT *context )
+/***********************************************************************
/***********************************************************************
+ * elevate_process
+ */
+static void elevate_process( void )
@ -45,10 +44,11 @@ index cdf8d586c36..5162e2fc0ec 100644
+}
+
+
/***********************************************************************
* start_process
+/***********************************************************************
* load_global_options
*/
@@ -3111,6 +3137,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
static void load_global_options(void)
@@ -3113,6 +3139,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
@ -56,8 +56,8 @@ index cdf8d586c36..5162e2fc0ec 100644
LARGE_INTEGER timeout;
NTSTATUS status;
WINE_MODREF *wm;
@@ -3154,6 +3181,16 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
if ((status = fixup_imports( wm, load_path )) != STATUS_SUCCESS) goto error;
@@ -3141,6 +3168,16 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
REG_DWORD, &peb->NtGlobalFlag, sizeof(peb->NtGlobalFlag), NULL );
heap_set_debug_flags( GetProcessHeap() );
+ /* elevate process if necessary */
@ -70,14 +70,14 @@ index cdf8d586c36..5162e2fc0ec 100644
+ elevate_process(); /* FIXME: the process exists with a wrong token for a short time */
+ }
+
status = wine_call_on_stack( attach_process_dlls, wm, (char *)NtCurrentTeb()->Tib.StackBase - page_size );
if (status != STATUS_SUCCESS) goto error;
/* the main exe needs to be the first in the load order list */
RemoveEntryList( &wm->ldr.InLoadOrderModuleList );
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList );
diff --git a/server/process.c b/server/process.c
index f8969433ede..10cf39d8962 100644
index ee85249..81cea2f 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1136,6 +1136,14 @@ struct process_snapshot *process_snap( int *count )
@@ -1133,6 +1133,14 @@ struct process_snapshot *process_snap( int *count )
return snapshot;
}
@ -93,10 +93,10 @@ index f8969433ede..10cf39d8962 100644
DECL_HANDLER(new_process)
{
diff --git a/server/process.h b/server/process.h
index 548796f9c22..262eb59627b 100644
index f22c128..78e88ec 100644
--- a/server/process.h
+++ b/server/process.h
@@ -137,6 +137,7 @@ extern void break_process( struct process *process );
@@ -136,6 +136,7 @@ extern void break_process( struct process *process );
extern void detach_debugged_processes( struct thread *debugger );
extern struct process_snapshot *process_snap( int *count );
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
@ -105,10 +105,10 @@ index 548796f9c22..262eb59627b 100644
/* console functions */
extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
diff --git a/server/protocol.def b/server/protocol.def
index 7590541ac8a..55cc768d21a 100644
index f2deca6..35c0eb4 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3610,6 +3610,13 @@ struct handle_info
@@ -3649,6 +3649,13 @@ struct handle_info
@END
@ -123,10 +123,10 @@ index 7590541ac8a..55cc768d21a 100644
@REQ(create_completion)
unsigned int access; /* desired access to a port */
diff --git a/server/token.c b/server/token.c
index 7abd92386ea..49e84362a83 100644
index 64ab565..52fa10d 100644
--- a/server/token.c
+++ b/server/token.c
@@ -1813,3 +1813,17 @@ DECL_HANDLER(create_token)
@@ -1802,3 +1802,17 @@ DECL_HANDLER(create_token)
release_object( token );
}
}
@ -145,5 +145,5 @@ index 7abd92386ea..49e84362a83 100644
+ }
+}
--
2.14.1
1.9.1

View File

@ -1,7 +1,7 @@
From 44c826229e00ebefac0bca596746c1037c5c370b Mon Sep 17 00:00:00 2001
From f4e4c077ff51929c3550f1557b69970db5d5cacb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 17 Jan 2016 17:02:41 +0100
Subject: api-ms-win-shcore-obsolete-l1-1-0: Add dll.
Subject: [PATCH] api-ms-win-shcore-obsolete-l1-1-0: Add dll.
---
configure.ac | 1 +
@ -13,10 +13,10 @@ Subject: api-ms-win-shcore-obsolete-l1-1-0: Add dll.
create mode 100644 dlls/api-ms-win-shcore-obsolete-l1-1-0/api-ms-win-shcore-obsolete-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index cc1d5ba443c..78c163e5f35 100644
index 4c8614c..7755acd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2939,6 +2939,7 @@ WINE_CONFIG_DLL(api-ms-win-service-management-l2-1-0)
@@ -2994,6 +2994,7 @@ WINE_CONFIG_DLL(api-ms-win-service-management-l2-1-0)
WINE_CONFIG_DLL(api-ms-win-service-private-l1-1-1)
WINE_CONFIG_DLL(api-ms-win-service-winsvc-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-service-winsvc-l1-2-0)
@ -26,14 +26,14 @@ index cc1d5ba443c..78c163e5f35 100644
WINE_CONFIG_DLL(api-ms-win-shell-shellfolders-l1-1-0)
diff --git a/dlls/api-ms-win-shcore-obsolete-l1-1-0/Makefile.in b/dlls/api-ms-win-shcore-obsolete-l1-1-0/Makefile.in
new file mode 100644
index 00000000000..6588d13937e
index 0000000..6588d13
--- /dev/null
+++ b/dlls/api-ms-win-shcore-obsolete-l1-1-0/Makefile.in
@@ -0,0 +1 @@
+MODULE = api-ms-win-shcore-obsolete-l1-1-0.dll
diff --git a/dlls/api-ms-win-shcore-obsolete-l1-1-0/api-ms-win-shcore-obsolete-l1-1-0.spec b/dlls/api-ms-win-shcore-obsolete-l1-1-0/api-ms-win-shcore-obsolete-l1-1-0.spec
new file mode 100644
index 00000000000..edb8143799d
index 0000000..edb8143
--- /dev/null
+++ b/dlls/api-ms-win-shcore-obsolete-l1-1-0/api-ms-win-shcore-obsolete-l1-1-0.spec
@@ -0,0 +1,3 @@
@ -41,20 +41,20 @@ index 00000000000..edb8143799d
+@ stdcall SHStrDupA(str ptr) shcore.SHStrDupA
+@ stdcall SHStrDupW(wstr ptr) shcore.SHStrDupW
diff --git a/tools/make_specfiles b/tools/make_specfiles
index ec4b68c2cf1..00f70283d49 100755
index 6b59b32..f200e7c 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -330,6 +330,10 @@ my @dll_groups =
"shlwapi",
"shcore",
@@ -334,6 +334,10 @@ my @dll_groups =
"api-ms-win-shcore-scaling-l1-1-1",
],
+ [
[
+ "shcore",
+ "api-ms-win-shcore-obsolete-l1-1-0",
+ ],
[
+ [
"user32",
"api-ms-win-core-stringansi-l1-1-0",
"api-ms-win-core-string-l2-1-0",
--
2.14.2
1.9.1

View File

@ -1,7 +1,7 @@
From acffeda04d634fcbf0e35734f2d758c4db558e53 Mon Sep 17 00:00:00 2001
From 2dde29c954187ccfc2bbbb9aad463c055392fda6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 23 Jan 2016 21:08:48 +0100
Subject: api-ms-win-rtcore-ntuser-draw-l1-1-0: Add dll.
Subject: [PATCH] api-ms-win-rtcore-ntuser-draw-l1-1-0: Add dll.
---
configure.ac | 1 +
@ -13,11 +13,11 @@ Subject: api-ms-win-rtcore-ntuser-draw-l1-1-0: Add dll.
create mode 100644 dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/api-ms-win-rtcore-ntuser-draw-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index 6621de58f49..db6567341b4 100644
index 2096d84..fc35889 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2897,6 +2897,7 @@ WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-ntuser-rectangle-l1-1-0)
@@ -2971,6 +2971,7 @@ WINE_CONFIG_DLL(api-ms-win-ntuser-rectangle-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-perf-legacy-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-power-base-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-power-setting-l1-1-0)
+WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-draw-l1-1-0)
@ -26,23 +26,23 @@ index 6621de58f49..db6567341b4 100644
WINE_CONFIG_DLL(api-ms-win-security-activedirectoryclient-l1-1-0)
diff --git a/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/Makefile.in b/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/Makefile.in
new file mode 100644
index 00000000000..956f2f3c9d8
index 0000000..956f2f3
--- /dev/null
+++ b/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/Makefile.in
@@ -0,0 +1 @@
+MODULE = api-ms-win-rtcore-ntuser-draw-l1-1-0.dll
diff --git a/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/api-ms-win-rtcore-ntuser-draw-l1-1-0.spec b/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/api-ms-win-rtcore-ntuser-draw-l1-1-0.spec
new file mode 100644
index 00000000000..59900a93eb5
index 0000000..59900a9
--- /dev/null
+++ b/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/api-ms-win-rtcore-ntuser-draw-l1-1-0.spec
@@ -0,0 +1 @@
+@ stdcall RedrawWindow(long ptr long long) user32.RedrawWindow
diff --git a/tools/make_specfiles b/tools/make_specfiles
index d62172215fc..82717b9ceb3 100755
index b10e199..b1fd1fc 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -337,6 +337,7 @@ my @dll_groups =
@@ -345,6 +345,7 @@ my @dll_groups =
"api-ms-win-core-string-l2-1-0",
"api-ms-win-downlevel-user32-l1-1-0",
"api-ms-win-ntuser-dc-access-l1-1-0",
@ -51,5 +51,5 @@ index d62172215fc..82717b9ceb3 100755
"api-ms-win-rtcore-ntuser-window-l1-1-0",
"ext-ms-win-ntuser-message-l1-1-1",
--
2.14.1
1.9.1

View File

@ -1,141 +0,0 @@
From f84cb2913cb755152d98c278f3ed6927167c9b2b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 24 Jan 2016 16:06:47 +0100
Subject: shcore: Add SetProcessDpiAwareness stub.
---
dlls/shcore/Makefile.in | 3 +++
dlls/shcore/main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/shcore/shcore.spec | 2 +-
include/Makefile.in | 1 +
include/shellscalingapi.h | 29 ++++++++++++++++++++++++++++
5 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 dlls/shcore/main.c
create mode 100644 include/shellscalingapi.h
diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in
index dd5f08f..ec2e95f 100644
--- a/dlls/shcore/Makefile.in
+++ b/dlls/shcore/Makefile.in
@@ -1 +1,4 @@
MODULE = shcore.dll
+
+C_SRCS = \
+ main.c
diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c
new file mode 100644
index 0000000..0e59d38
--- /dev/null
+++ b/dlls/shcore/main.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2016 Sebastian Lackner
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "shellscalingapi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shcore);
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+ TRACE("(%p, %u, %p)\n", instance, reason, reserved);
+
+ switch (reason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(instance);
+ break;
+ }
+
+ return TRUE;
+}
+
+HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
+{
+ FIXME("(%u): stub\n", value);
+ return E_NOTIMPL;
+}
diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec
index 12a4ef3..1624319 100644
--- a/dlls/shcore/shcore.spec
+++ b/dlls/shcore/shcore.spec
@@ -78,6 +78,6 @@
@ stdcall SHUnicodeToAnsi(wstr ptr ptr) shlwapi.SHUnicodeToAnsi
@ stdcall SHUnicodeToUnicode(wstr ptr long) shlwapi.SHUnicodeToUnicode
@ stdcall SetCurrentProcessExplicitAppUserModelID(wstr) shell32.SetCurrentProcessExplicitAppUserModelID
-@ stub SetProcessDpiAwareness
+@ stdcall SetProcessDpiAwareness(long)
@ stub SetProcessReference
@ stub UnregisterScaleChangeEvent
diff --git a/include/Makefile.in b/include/Makefile.in
index 199de7a..c907afe4 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -570,6 +570,7 @@ HEADER_SRCS = \
sfc.h \
shdispid.h \
shellapi.h \
+ shellscalingapi.h \
shlguid.h \
shlobj.h \
shlwapi.h \
diff --git a/include/shellscalingapi.h b/include/shellscalingapi.h
new file mode 100644
index 0000000..6d7a167
--- /dev/null
+++ b/include/shellscalingapi.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2016 Sebastian Lackner
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_SHELLSCALINGAPI_H
+#define __WINE_SHELLSCALINGAPI_H
+
+typedef enum PROCESS_DPI_AWARENESS
+{
+ PROCESS_DPI_UNAWARE = 0,
+ PROCESS_SYSTEM_DPI_AWARE = 1,
+ PROCESS_PER_MONITOR_DPI_AWARE = 2,
+} PROCESS_DPI_AWARENESS;
+
+#endif /* __WINE_SHELLSCALINGAPI_H */
--
2.6.4

View File

@ -1,86 +0,0 @@
From 0effbe0e3eeb84626ec6b64848fe6cfb1279dc02 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 26 Jan 2016 15:39:10 +0100
Subject: shcore: Implement stub for GetDpiForMonitor.
---
dlls/shcore/Makefile.in | 1 +
dlls/shcore/main.c | 16 ++++++++++++++++
dlls/shcore/shcore.spec | 2 +-
include/shellscalingapi.h | 8 ++++++++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in
index ec2e95f..0b172fc 100644
--- a/dlls/shcore/Makefile.in
+++ b/dlls/shcore/Makefile.in
@@ -1,4 +1,5 @@
MODULE = shcore.dll
+IMPORTS = gdi32 user32
C_SRCS = \
main.c
diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c
index 0e59d38..ce0d9ed 100644
--- a/dlls/shcore/main.c
+++ b/dlls/shcore/main.c
@@ -21,6 +21,8 @@
#include "windef.h"
#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
#include "shellscalingapi.h"
#include "wine/debug.h"
@@ -47,3 +49,17 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
FIXME("(%u): stub\n", value);
return E_NOTIMPL;
}
+
+HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y)
+{
+ HDC hDC;
+
+ TRACE("(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y);
+
+ hDC = GetDC(0);
+ if (x) *x = GetDeviceCaps(hDC, LOGPIXELSX);
+ if (y) *y = GetDeviceCaps(hDC, LOGPIXELSY);
+ ReleaseDC(0, hDC);
+
+ return S_OK;
+}
diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec
index 1624319..4d6e845 100644
--- a/dlls/shcore/shcore.spec
+++ b/dlls/shcore/shcore.spec
@@ -6,7 +6,7 @@
@ stub DllGetActivationFactory
@ stdcall -private DllGetClassObject(ptr ptr ptr) shell32.DllGetClassObject
@ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID
-@ stub GetDpiForMonitor
+@ stdcall GetDpiForMonitor(long long ptr ptr)
@ stub GetDpiForShellUIComponent
@ stub GetProcessDpiAwareness
@ stub GetProcessReference
diff --git a/include/shellscalingapi.h b/include/shellscalingapi.h
index 6d7a167..56ae94a 100644
--- a/include/shellscalingapi.h
+++ b/include/shellscalingapi.h
@@ -26,4 +26,12 @@ typedef enum PROCESS_DPI_AWARENESS
PROCESS_PER_MONITOR_DPI_AWARE = 2,
} PROCESS_DPI_AWARENESS;
+typedef enum MONITOR_DPI_TYPE
+{
+ MDT_EFFECTIVE_DPI = 0,
+ MDT_ANGULAR_DPI = 1,
+ MDT_RAW_DPI = 2,
+ MDT_DEFAULT = MDT_EFFECTIVE_DPI,
+} MONITOR_DPI_TYPE;
+
#endif /* __WINE_SHELLSCALINGAPI_H */
--
2.6.4

View File

@ -1,44 +0,0 @@
From 3d855b15e9f99f1cc3168cc9e606cb698e078a4b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 6 Feb 2016 02:38:14 +0100
Subject: shcore: Add stub for GetProcessDpiAwareness.
---
dlls/shcore/main.c | 7 +++++++
dlls/shcore/shcore.spec | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c
index ce0d9ed..f2d362d 100644
--- a/dlls/shcore/main.c
+++ b/dlls/shcore/main.c
@@ -50,6 +50,13 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
return E_NOTIMPL;
}
+HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *value)
+{
+ FIXME("(%p, %p): stub\n", process, value);
+ if (value) *value = PROCESS_DPI_UNAWARE;
+ return S_OK;
+}
+
HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y)
{
HDC hDC;
diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec
index 4d6e845..34f989f 100644
--- a/dlls/shcore/shcore.spec
+++ b/dlls/shcore/shcore.spec
@@ -8,7 +8,7 @@
@ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID
@ stdcall GetDpiForMonitor(long long ptr ptr)
@ stub GetDpiForShellUIComponent
-@ stub GetProcessDpiAwareness
+@ stdcall GetProcessDpiAwareness(long ptr)
@ stub GetProcessReference
@ stub GetScaleFactorForDevice
@ stub GetScaleFactorForMonitor
--
2.7.0

View File

@ -1,7 +1,7 @@
From 12402a522209bfaf340b6a94b6777f93a530160f Mon Sep 17 00:00:00 2001
From e79bfa6ad892b6dabc686e4109b9c01cb0a9d816 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Dec 2016 05:37:02 +0100
Subject: bcrypt/tests: Add tests for AES GCM mode.
Subject: [PATCH] bcrypt/tests: Add tests for AES GCM mode.
---
dlls/bcrypt/tests/bcrypt.c | 155 ++++++++++++++++++++++++++++++++++++++++++++-
@ -10,10 +10,10 @@ Subject: bcrypt/tests: Add tests for AES GCM mode.
3 files changed, 179 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index c6921096f74..f551345aca0 100644
index 8fd6c6a..517baf2 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -838,6 +838,8 @@ static void test_BCryptGenerateSymmetricKey(void)
@@ -561,6 +561,8 @@ static void test_BCryptGenerateSymmetricKey(void)
static void test_BCryptEncrypt(void)
{
@ -22,7 +22,7 @@ index c6921096f74..f551345aca0 100644
static UCHAR secret[] =
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
static UCHAR iv[] =
@@ -856,15 +858,28 @@ static void test_BCryptEncrypt(void)
@@ -579,15 +581,28 @@ static void test_BCryptEncrypt(void)
{0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
@ -52,7 +52,7 @@ index c6921096f74..f551345aca0 100644
len = 0xdeadbeef;
size = sizeof(len);
ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
@@ -951,12 +966,101 @@ static void test_BCryptEncrypt(void)
@@ -674,12 +689,101 @@ static void test_BCryptEncrypt(void)
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
@ -154,7 +154,7 @@ index c6921096f74..f551345aca0 100644
static UCHAR secret[] =
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
static UCHAR iv[] =
@@ -978,6 +1082,12 @@ static void test_BCryptDecrypt(void)
@@ -701,6 +805,12 @@ static void test_BCryptDecrypt(void)
{0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
@ -167,7 +167,7 @@ index c6921096f74..f551345aca0 100644
BCRYPT_KEY_LENGTHS_STRUCT key_lengths;
BCRYPT_ALG_HANDLE aes;
BCRYPT_KEY_HANDLE key;
@@ -997,6 +1107,10 @@ static void test_BCryptDecrypt(void)
@@ -720,6 +830,10 @@ static void test_BCryptDecrypt(void)
ok(key_lengths.dwMaxLength == 256, "Expected 256, got %d\n", key_lengths.dwMaxLength);
ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
@ -178,7 +178,7 @@ index c6921096f74..f551345aca0 100644
len = 0xdeadbeef;
size = sizeof(len);
ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
@@ -1094,6 +1208,45 @@ static void test_BCryptDecrypt(void)
@@ -817,6 +931,45 @@ static void test_BCryptDecrypt(void)
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
@ -225,10 +225,10 @@ index c6921096f74..f551345aca0 100644
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
}
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 2555bf06b82..acf2f30e21c 100644
index 1f7093c..1e468a3 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -90,7 +90,29 @@ typedef struct __BCRYPT_KEY_LENGTHS_STRUCT
@@ -92,7 +92,29 @@ typedef struct __BCRYPT_KEY_LENGTHS_STRUCT
ULONG dwMinLength;
ULONG dwMaxLength;
ULONG dwIncrement;
@ -257,10 +257,10 @@ index 2555bf06b82..acf2f30e21c 100644
+#define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
+#define BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG 0x00000002
typedef PVOID BCRYPT_ALG_HANDLE;
typedef PVOID BCRYPT_KEY_HANDLE;
typedef struct _CRYPT_INTERFACE_REG
{
diff --git a/include/ntstatus.h b/include/ntstatus.h
index 86dad85b43f..7026de7f85f 100644
index 86dad85..7026de7 100644
--- a/include/ntstatus.h
+++ b/include/ntstatus.h
@@ -990,6 +990,8 @@
@ -273,5 +273,5 @@ index 86dad85b43f..7026de7f85f 100644
#define RPC_NT_WRONG_KIND_OF_BINDING ((NTSTATUS) 0xC0020002)
#define RPC_NT_INVALID_BINDING ((NTSTATUS) 0xC0020003)
--
2.13.1
1.9.1

View File

@ -1,17 +1,18 @@
From 5cfd49e478e1f4d432cfa7140265c15813939fe5 Mon Sep 17 00:00:00 2001
From 499bccf292d3279bdbc4170de49e0cc596e5b43e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 26 Dec 2016 06:18:01 +0100
Subject: bcrypt: Pass object to get_{alg,hash}_property instead of alg_id.
Subject: [PATCH] bcrypt: Pass object to get_{alg,hash}_property instead of
alg_id.
---
dlls/bcrypt/bcrypt_main.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
dlls/bcrypt/bcrypt_main.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 7a935150778..4869206ab49 100644
index c064b63..7f37560 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -440,15 +440,15 @@ static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *
@@ -509,15 +509,15 @@ static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *
return STATUS_NOT_IMPLEMENTED;
}
@ -30,7 +31,7 @@ index 7a935150778..4869206ab49 100644
{
case ALG_ID_AES:
if (!strcmpW( prop, BCRYPT_BLOCK_LENGTH ))
@@ -484,11 +484,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
@@ -566,11 +566,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
return STATUS_NOT_IMPLEMENTED;
}
@ -44,7 +45,7 @@ index 7a935150778..4869206ab49 100644
if (status == STATUS_NOT_IMPLEMENTED)
FIXME( "unsupported property %s\n", debugstr_w(prop) );
return status;
@@ -508,12 +508,12 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
@@ -590,12 +590,12 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
case MAGIC_ALG:
{
const struct algorithm *alg = (const struct algorithm *)object;
@ -59,22 +60,16 @@ index 7a935150778..4869206ab49 100644
}
default:
WARN( "unknown magic %08x\n", object->magic );
@@ -696,34 +696,34 @@ struct key
ULONG secret_len;
};
@@ -768,7 +768,7 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
}
#if defined(HAVE_GNUTLS_CIPHER_INIT) || defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
-static ULONG get_block_size( enum alg_id alg )
+static ULONG get_block_size( struct algorithm *alg )
{
ULONG ret = 0, size = sizeof(ret);
get_alg_property( alg, BCRYPT_BLOCK_LENGTH, (UCHAR *)&ret, sizeof(ret), &size );
return ret;
}
-static NTSTATUS key_init( struct key *key, enum alg_id id, const UCHAR *secret, ULONG secret_len )
+static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
{
UCHAR *buffer;
@@ -793,21 +793,21 @@ static NTSTATUS key_init( struct key *key, enum alg_id id, const UCHAR *secret,
if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
@ -100,7 +95,7 @@ index 7a935150778..4869206ab49 100644
key->handle = 0; /* initialized on first use */
key->secret = buffer;
key->secret_len = secret_len;
@@ -819,7 +819,7 @@ struct key
@@ -1011,7 +1011,7 @@ struct key
ULONG block_size;
};
@ -109,7 +104,7 @@ index 7a935150778..4869206ab49 100644
{
ERR( "support for keys not available at build time\n" );
return STATUS_NOT_IMPLEMENTED;
@@ -868,7 +868,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
@@ -1060,7 +1060,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
if (!(key = HeapAlloc( GetProcessHeap(), 0, sizeof(*key) ))) return STATUS_NO_MEMORY;
key->hdr.magic = MAGIC_KEY;
@ -119,5 +114,5 @@ index 7a935150778..4869206ab49 100644
HeapFree( GetProcessHeap(), 0, key );
return status;
--
2.13.1
1.9.1

View File

@ -1,7 +1,7 @@
From cb5fa7e822dcd6105f189507ab648eacc86ab91a Mon Sep 17 00:00:00 2001
From d31424121e0c29bd695cca9be5d7bd9b8f0e3c95 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: bcrypt: Add support for computing/comparing cipher tag.
Subject: [PATCH] bcrypt: Add support for computing/comparing cipher tag.
---
dlls/bcrypt/bcrypt_main.c | 41 ++++++++++++++++++++++++++++++++++++++++-
@ -9,11 +9,11 @@ Subject: bcrypt: Add support for computing/comparing cipher tag.
2 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 97c437a20c0..0ff461adc91 100644
index 7e760e6..fe91409 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -49,6 +49,9 @@ static HINSTANCE instance;
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
WINE_DECLARE_DEBUG_CHANNEL(winediag);
+/* Not present in gnutls version < 3.0 */
@ -47,7 +47,7 @@ index 97c437a20c0..0ff461adc91 100644
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
{
pgnutls_perror( ret );
@@ -892,6 +906,19 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -976,6 +990,19 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_SUCCESS;
}
@ -67,7 +67,7 @@ index 97c437a20c0..0ff461adc91 100644
static NTSTATUS key_destroy( struct key *key )
{
if (key->handle) pgnutls_cipher_deinit( key->handle );
@@ -934,6 +961,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -1126,6 +1153,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_NOT_IMPLEMENTED;
}
@ -80,7 +80,7 @@ index 97c437a20c0..0ff461adc91 100644
static NTSTATUS key_destroy( struct key *key )
{
ERR( "support for keys not available at build time\n" );
@@ -1018,7 +1051,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1210,7 +1243,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;
@ -89,7 +89,7 @@ index 97c437a20c0..0ff461adc91 100644
}
if ((status = key_set_params( key, iv, iv_len ))) return status;
@@ -1077,6 +1110,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1269,6 +1302,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;
@ -97,7 +97,7 @@ index 97c437a20c0..0ff461adc91 100644
if (!auth_info) return STATUS_INVALID_PARAMETER;
if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
@@ -1094,6 +1128,11 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1286,6 +1320,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;
@ -110,10 +110,10 @@ index 97c437a20c0..0ff461adc91 100644
}
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 79e8c4c36d3..14725a52b7a 100644
index 2a646e8..887fe85 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1018,11 +1018,11 @@ static void test_BCryptEncrypt(void)
@@ -751,11 +751,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");
@ -127,7 +127,7 @@ index 79e8c4c36d3..14725a52b7a 100644
/* input size is not multiple of block size */
size = 0;
@@ -1033,11 +1033,11 @@ static void test_BCryptEncrypt(void)
@@ -766,11 +766,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");
@ -141,7 +141,7 @@ index 79e8c4c36d3..14725a52b7a 100644
/* test with padding */
memcpy(ivbuf, iv, sizeof(iv));
@@ -1231,7 +1231,7 @@ static void test_BCryptDecrypt(void)
@@ -974,7 +974,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);
@ -151,5 +151,5 @@ index 79e8c4c36d3..14725a52b7a 100644
ret = pBCryptDestroyKey(key);
--
2.13.1
1.9.1

View File

@ -1,7 +1,7 @@
From 8970fffeee459389818a2e96940393692d082e95 Mon Sep 17 00:00:00 2001
From 1283926e7c5c3d872a286c9cfa190ef3c7459397 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 13 Aug 2017 04:28:43 +0200
Subject: bcrypt: Partial implementation of BCryptImportKey and
Subject: [PATCH] bcrypt: Partial implementation of BCryptImportKey and
BCryptExportKey.
---
@ -13,7 +13,7 @@ Subject: bcrypt: Partial implementation of BCryptImportKey and
5 files changed, 165 insertions(+), 4 deletions(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index f5911d2cd40..f8a8c45a1d5 100644
index fcd0f6d..28c2394 100644
--- a/dlls/bcrypt/bcrypt.spec
+++ b/dlls/bcrypt/bcrypt.spec
@@ -20,7 +20,7 @@
@ -35,10 +35,10 @@ index f5911d2cd40..f8a8c45a1d5 100644
@ stdcall BCryptOpenAlgorithmProvider(ptr wstr wstr long)
@ stub BCryptQueryContextConfiguration
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 80b0480265a..dc865ea9d07 100644
index b523019..60825f4 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1016,6 +1016,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1090,6 +1090,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_SUCCESS;
}
@ -52,7 +52,7 @@ index 80b0480265a..dc865ea9d07 100644
static NTSTATUS key_destroy( struct key *key )
{
if (key->handle) pgnutls_cipher_deinit( key->handle );
@@ -1083,6 +1090,12 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1265,6 +1272,12 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_NOT_IMPLEMENTED;
}
@ -65,7 +65,7 @@ index 80b0480265a..dc865ea9d07 100644
static NTSTATUS key_destroy( struct key *key )
{
ERR( "support for keys not available at build time\n" );
@@ -1149,6 +1162,94 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
@@ -1331,6 +1344,94 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
return STATUS_SUCCESS;
}
@ -161,7 +161,7 @@ index 80b0480265a..dc865ea9d07 100644
{
struct key *key = handle;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 3bc1ee526f3..98d4961879c 100644
index 02e0f52..6fa0329 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -47,6 +47,9 @@ static NTSTATUS (WINAPI *pBCryptDecrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID
@ -174,7 +174,7 @@ index 3bc1ee526f3..98d4961879c 100644
static void test_BCryptGenRandom(void)
{
@@ -1572,6 +1575,46 @@ static void test_BCryptDecrypt(void)
@@ -1283,6 +1286,46 @@ static void test_BCryptDecrypt(void)
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
}
@ -221,7 +221,7 @@ index 3bc1ee526f3..98d4961879c 100644
START_TEST(bcrypt)
{
HMODULE module;
@@ -1600,6 +1643,8 @@ START_TEST(bcrypt)
@@ -1311,6 +1354,8 @@ START_TEST(bcrypt)
pBCryptDecrypt = (void *)GetProcAddress(module, "BCryptDecrypt");
pBCryptDuplicateKey = (void *)GetProcAddress(module, "BCryptDuplicateKey");
pBCryptDestroyKey = (void *)GetProcAddress(module, "BCryptDestroyKey");
@ -230,7 +230,7 @@ index 3bc1ee526f3..98d4961879c 100644
test_BCryptGenRandom();
test_BCryptGetFipsAlgorithmMode();
@@ -1613,6 +1658,7 @@ START_TEST(bcrypt)
@@ -1320,6 +1365,7 @@ START_TEST(bcrypt)
test_BCryptGenerateSymmetricKey();
test_BCryptEncrypt();
test_BCryptDecrypt();
@ -239,7 +239,7 @@ index 3bc1ee526f3..98d4961879c 100644
if (pBCryptHash) /* >= Win 10 */
test_BcryptHash();
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
index b14a332e18f..478c2cfb1da 100644
index 68735eb..d0f0f56 100644
--- a/dlls/ncrypt/ncrypt.spec
+++ b/dlls/ncrypt/ncrypt.spec
@@ -22,7 +22,7 @@
@ -261,7 +261,7 @@ index b14a332e18f..478c2cfb1da 100644
@ stub BCryptKeyDerivation
@ stdcall BCryptOpenAlgorithmProvider(ptr wstr wstr long) bcrypt.BCryptOpenAlgorithmProvider
diff --git a/include/bcrypt.h b/include/bcrypt.h
index acf2f30e21c..de812ffe333 100644
index 1e468a3..81822af 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -58,6 +58,10 @@ typedef LONG NTSTATUS;
@ -275,7 +275,7 @@ index acf2f30e21c..de812ffe333 100644
#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}
#define MS_PLATFORM_CRYPTO_PROVIDER (const WCHAR [])\
@@ -92,6 +96,13 @@ typedef struct __BCRYPT_KEY_LENGTHS_STRUCT
@@ -94,6 +98,13 @@ typedef struct __BCRYPT_KEY_LENGTHS_STRUCT
ULONG dwIncrement;
} BCRYPT_KEY_LENGTHS_STRUCT, BCRYPT_AUTH_TAG_LENGTHS_STRUCT;
@ -289,9 +289,9 @@ index acf2f30e21c..de812ffe333 100644
typedef struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
{
ULONG cbSize;
@@ -114,6 +125,9 @@ typedef struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
#define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
#define BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG 0x00000002
@@ -139,6 +150,9 @@ typedef struct _CRYPT_PROVIDER_REG
PCRYPT_IMAGE_REG pKM;
} CRYPT_PROVIDER_REG, *PCRYPT_PROVIDER_REG;
+#define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b
+#define BCRYPT_KEY_DATA_BLOB_VERSION1 1
@ -300,5 +300,5 @@ index acf2f30e21c..de812ffe333 100644
typedef PVOID BCRYPT_KEY_HANDLE;
typedef PVOID BCRYPT_HANDLE;
--
2.13.1
1.9.1

View File

@ -1,43 +1,47 @@
From f0a766813a241fad6771c83634855fc97a14ff2e Mon Sep 17 00:00:00 2001
From 4c8edad4d1caeed9965913f559eec4e379fd2337 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: bcrypt: Preparation for asymmetric keys.
Subject: [PATCH] bcrypt: Preparation for asymmetric keys.
---
dlls/bcrypt/bcrypt_main.c | 312 ++++++++++++++++++++++++++++++----------------
1 file changed, 204 insertions(+), 108 deletions(-)
dlls/bcrypt/bcrypt_main.c | 316 ++++++++++++++++++++++++++++++----------------
1 file changed, 206 insertions(+), 110 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index a7e5bff2b8c..4e1992292cd 100644
index d089bad..0eca8e6 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -199,14 +199,15 @@ static const struct {
@@ -237,16 +237,17 @@ static const struct {
ULONG hash_length;
ULONG block_bits;
const WCHAR *alg_name;
+ BOOL symmetric;
} alg_props[] = {
- /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM },
- /* ALG_ID_MD2 */ { 270, 16, 128, BCRYPT_MD2_ALGORITHM },
- /* ALG_ID_MD4 */ { 270, 16, 512, BCRYPT_MD4_ALGORITHM },
- /* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM },
- /* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM },
- /* ALG_ID_SHA1 */ { 278, 20, 512, BCRYPT_SHA1_ALGORITHM },
- /* ALG_ID_SHA256 */ { 286, 32, 512, BCRYPT_SHA256_ALGORITHM },
- /* ALG_ID_SHA384 */ { 382, 48, 1024, BCRYPT_SHA384_ALGORITHM },
- /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM }
+ /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM, TRUE },
+ /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM, TRUE },
+ /* ALG_ID_MD2 */ { 270, 16, 128, BCRYPT_MD2_ALGORITHM, FALSE },
+ /* 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 },
+ /* 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 },
+ /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
+ /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE }
};
struct algorithm
@@ -815,10 +816,8 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
}
@@ -893,10 +894,8 @@ static ULONG get_block_size( struct algorithm *alg )
#endif
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
-struct key
+struct key_symmetric
{
@ -46,10 +50,11 @@ index a7e5bff2b8c..4e1992292cd 100644
enum mode_id mode;
ULONG block_size;
gnutls_cipher_hd_t handle;
@@ -826,6 +825,16 @@ struct key
@@ -904,7 +903,17 @@ struct key
ULONG secret_len;
};
-static NTSTATUS key_init( struct key *key, enum alg_id id, const UCHAR *secret, ULONG secret_len )
+struct key
+{
+ struct object hdr;
@ -60,19 +65,11 @@ index a7e5bff2b8c..4e1992292cd 100644
+ } u;
+};
+
static ULONG get_block_size( struct algorithm *alg )
{
ULONG ret = 0, size = sizeof(ret);
@@ -833,7 +842,7 @@ static ULONG get_block_size( struct algorithm *alg )
return ret;
}
-static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
+static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
{
UCHAR *buffer;
@@ -849,34 +858,64 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
@@ -920,34 +929,64 @@ static NTSTATUS key_init( struct key *key, enum alg_id id, const UCHAR *secret,
return STATUS_NOT_SUPPORTED;
}
@ -151,7 +148,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return STATUS_SUCCESS;
}
@@ -884,19 +923,22 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
@@ -955,19 +994,22 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
{
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
{
@ -177,7 +174,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return STATUS_SUCCESS;
}
else
@@ -916,22 +958,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
@@ -987,22 +1029,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
{
case ALG_ID_AES:
WARN( "handle block size\n" );
@ -207,7 +204,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return GNUTLS_CIPHER_UNKNOWN;
default:
FIXME( "algorithm %u not supported\n", key->alg_id );
@@ -939,17 +981,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
@@ -1010,17 +1052,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
}
}
@ -229,7 +226,7 @@ index a7e5bff2b8c..4e1992292cd 100644
}
if ((cipher = get_gnutls_cipher( key )) == GNUTLS_CIPHER_UNKNOWN)
@@ -961,12 +1003,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
@@ -1032,12 +1074,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
iv_len = sizeof(zero_iv);
}
@ -245,7 +242,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -975,11 +1017,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
@@ -1046,11 +1088,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
return STATUS_SUCCESS;
}
@ -259,7 +256,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -988,12 +1030,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
@@ -1059,12 +1101,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
return STATUS_SUCCESS;
}
@ -274,7 +271,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1002,12 +1044,12 @@ static NTSTATUS key_encrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -1073,12 +1115,12 @@ static NTSTATUS key_encrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_SUCCESS;
}
@ -289,7 +286,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1016,11 +1058,11 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
@@ -1087,11 +1129,11 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
return STATUS_SUCCESS;
}
@ -303,7 +300,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
@@ -1029,17 +1071,20 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
@@ -1100,17 +1142,20 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
return STATUS_SUCCESS;
}
@ -329,7 +326,7 @@ index a7e5bff2b8c..4e1992292cd 100644
HeapFree( GetProcessHeap(), 0, key );
return STATUS_SUCCESS;
}
@@ -1047,21 +1092,41 @@ static NTSTATUS key_destroy( struct key *key )
@@ -1226,21 +1271,41 @@ static NTSTATUS key_destroy( struct key *key )
struct key
{
struct object hdr;
@ -376,7 +373,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return STATUS_NOT_IMPLEMENTED;
}
@@ -1071,39 +1136,39 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
@@ -1250,39 +1315,39 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
return STATUS_NOT_IMPLEMENTED;
}
@ -422,7 +419,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
ERR( "support for keys not available at build time\n" );
return STATUS_NOT_IMPLEMENTED;
@@ -1136,7 +1201,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
@@ -1315,7 +1380,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
}
key->hdr.magic = MAGIC_KEY;
@ -431,7 +428,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
HeapFree( GetProcessHeap(), 0, key );
*handle = NULL;
@@ -1233,13 +1298,19 @@ NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
@@ -1412,13 +1477,19 @@ NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
if (!output || !output_len || !size) return STATUS_INVALID_PARAMETER;
@ -452,7 +449,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return status;
if (!strcmpW( type, BCRYPT_KEY_DATA_BLOB ))
@@ -1280,19 +1351,30 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1459,19 +1530,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;
@ -484,7 +481,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
@@ -1303,7 +1385,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1482,7 +1564,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" );
@ -493,7 +490,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return status;
*ret_len = input_len;
@@ -1311,46 +1393,48 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1490,46 +1572,48 @@ 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;
@ -558,7 +555,7 @@ index a7e5bff2b8c..4e1992292cd 100644
HeapFree( GetProcessHeap(), 0, buf );
}
@@ -1364,19 +1448,30 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1543,19 +1627,30 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
struct key *key = handle;
ULONG bytes_left = input_len;
UCHAR *buf, *src, *dst;
@ -590,7 +587,7 @@ index a7e5bff2b8c..4e1992292cd 100644
{
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
UCHAR tag[16];
@@ -1386,7 +1481,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1565,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;
@ -599,7 +596,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return status;
*ret_len = input_len;
@@ -1394,12 +1489,12 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1573,12 +1668,12 @@ 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;
@ -615,7 +612,7 @@ index a7e5bff2b8c..4e1992292cd 100644
return status;
if (memcmp( tag, auth_info->pbTag, auth_info->cbTag ))
return STATUS_AUTH_TAG_MISMATCH;
@@ -1407,44 +1502,45 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
@@ -1586,44 +1681,45 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
return STATUS_SUCCESS;
}
@ -679,5 +676,5 @@ index a7e5bff2b8c..4e1992292cd 100644
else
status = STATUS_UNSUCCESSFUL; /* FIXME: invalid padding */
--
2.14.1
1.9.1

View File

@ -1,17 +1,17 @@
From 745f8d61f2335efb96078f937ca113f144892cc3 Mon Sep 17 00:00:00 2001
From 4547f7d3d18783e30d955c6ec236b3b1945e8155 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: bcrypt: Implement importing of ecdsa keys.
Subject: [PATCH] bcrypt: Implement importing of ecdsa keys.
---
dlls/bcrypt/bcrypt.spec | 4 +-
dlls/bcrypt/bcrypt_main.c | 156 ++++++++++++++++++++++++++++++++++++++++++---
dlls/bcrypt/bcrypt_main.c | 144 ++++++++++++++++++++++++++++++++++++++++++++-
dlls/bcrypt/tests/bcrypt.c | 6 +-
include/bcrypt.h | 2 +
4 files changed, 154 insertions(+), 14 deletions(-)
4 files changed, 148 insertions(+), 8 deletions(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index f8a8c45a1d5..5d21b4646cc 100644
index 28c2394..78824d7 100644
--- a/dlls/bcrypt/bcrypt.spec
+++ b/dlls/bcrypt/bcrypt.spec
@@ -32,7 +32,7 @@
@ -26,17 +26,17 @@ index f8a8c45a1d5..5d21b4646cc 100644
@@ -50,7 +50,7 @@
@ stub BCryptSignHash
@ stub BCryptUnregisterConfigChangeNotify
@ stub BCryptUnregisterProvider
@ stdcall BCryptUnregisterProvider(wstr)
-@ stub BCryptVerifySignature
+@ stdcall BCryptVerifySignature(ptr ptr ptr long ptr long long)
@ stub GetAsymmetricEncryptionInterface
@ stub GetCipherInterface
@ stub GetHashInterface
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 4e1992292cd..f822a7aadf3 100644
index 0eca8e6..5381d9c 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -181,7 +181,9 @@ enum alg_id
@@ -219,7 +219,9 @@ enum alg_id
ALG_ID_SHA1,
ALG_ID_SHA256,
ALG_ID_SHA384,
@ -47,30 +47,18 @@ index 4e1992292cd..f822a7aadf3 100644
};
enum mode_id
@@ -201,13 +203,15 @@ static const struct {
const WCHAR *alg_name;
BOOL symmetric;
} alg_props[] = {
- /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM, TRUE },
- /* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM, FALSE },
- /* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM, FALSE },
- /* 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 },
- /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
+ /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM, TRUE },
+ /* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM, FALSE },
+ /* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM, FALSE },
+ /* 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 },
+ /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
+ /* ALG_ID_ECDSA_P256 */ { 0, 0, 0, BCRYPT_ECDSA_P256_ALGORITHM, FALSE },
+ /* ALG_ID_ECDSA_P384 */ { 0, 0, 0, BCRYPT_ECDSA_P384_ALGORITHM, FALSE },
@@ -247,7 +249,9 @@ static const struct {
/* 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 },
- /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE }
+ /* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
+ /* ALG_ID_ECDSA_P256 */ { 0, 0, 0, BCRYPT_ECDSA_P256_ALGORITHM, FALSE },
+ /* ALG_ID_ECDSA_P384 */ { 0, 0, 0, BCRYPT_ECDSA_P384_ALGORITHM, FALSE },
};
struct algorithm
@@ -284,6 +288,8 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
@@ -326,6 +330,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;
@ -79,7 +67,7 @@ index 4e1992292cd..f822a7aadf3 100644
else
{
FIXME( "algorithm %s not supported\n", debugstr_w(id) );
@@ -825,6 +831,12 @@ struct key_symmetric
@@ -903,6 +909,12 @@ struct key_symmetric
ULONG secret_len;
};
@ -92,7 +80,7 @@ index 4e1992292cd..f822a7aadf3 100644
struct key
{
struct object hdr;
@@ -832,6 +844,7 @@ struct key
@@ -910,6 +922,7 @@ struct key
union
{
struct key_symmetric s;
@ -100,7 +88,7 @@ index 4e1992292cd..f822a7aadf3 100644
} u;
};
@@ -871,6 +884,33 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
@@ -942,6 +955,33 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
return STATUS_SUCCESS;
}
@ -134,7 +122,7 @@ index 4e1992292cd..f822a7aadf3 100644
static inline BOOL key_is_symmetric( struct key *key )
{
return alg_props[key->alg_id].symmetric;
@@ -903,7 +943,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
@@ -974,7 +1014,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
}
else
{
@ -149,7 +137,7 @@ index 4e1992292cd..f822a7aadf3 100644
}
}
@@ -1085,6 +1131,10 @@ static NTSTATUS key_destroy( struct key *key )
@@ -1156,6 +1202,10 @@ static NTSTATUS key_destroy( struct key *key )
if (key->u.s.handle) pgnutls_cipher_deinit( key->u.s.handle );
HeapFree( GetProcessHeap(), 0, key->u.s.secret );
}
@ -160,7 +148,7 @@ index 4e1992292cd..f822a7aadf3 100644
HeapFree( GetProcessHeap(), 0, key );
return STATUS_SUCCESS;
}
@@ -1112,6 +1162,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, UCHA
@@ -1291,6 +1341,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, UCHA
return STATUS_NOT_IMPLEMENTED;
}
@ -173,7 +161,7 @@ index 4e1992292cd..f822a7aadf3 100644
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
{
ERR( "support for keys not available at build time\n" );
@@ -1334,6 +1390,88 @@ NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
@@ -1513,6 +1569,88 @@ NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
return STATUS_INVALID_PARAMETER;
}
@ -263,10 +251,10 @@ index 4e1992292cd..f822a7aadf3 100644
{
struct key *key = handle;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index be901202970..20f70706430 100644
index 1e4c2bc..678b5c1 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1672,7 +1672,7 @@ static void test_ECDSA(void)
@@ -1395,7 +1395,7 @@ static void test_ECDSA(void)
status = pBCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDSA_P256_ALGORITHM, NULL, 0);
if (status)
{
@ -275,7 +263,7 @@ index be901202970..20f70706430 100644
return;
}
@@ -1688,10 +1688,10 @@ static void test_ECDSA(void)
@@ -1411,10 +1411,10 @@ static void test_ECDSA(void)
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
status = pBCryptVerifySignature(key, NULL, certHash, sizeof(certHash) - 1, certSignature, sizeof(certSignature), 0);
@ -289,10 +277,10 @@ index be901202970..20f70706430 100644
pBCryptDestroyKey(key);
pBCryptCloseAlgorithmProvider(alg, 0);
diff --git a/include/bcrypt.h b/include/bcrypt.h
index f524cb9afdc..3dcc953e9ed 100644
index 9e5cd58..bf0547c 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -185,8 +185,10 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
@@ -210,8 +210,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);
@ -304,5 +292,5 @@ index f524cb9afdc..3dcc953e9ed 100644
#endif /* __WINE_BCRYPT_H */
--
2.14.1
1.9.1

View File

@ -1,7 +1,7 @@
From 09e86a5b33ead90b064eeb1d728f567283dfa389 Mon Sep 17 00:00:00 2001
From 64ad33508c5d3cfc3dcb40987b060cba2889d41d 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: bcrypt: Implement BCryptVerifySignature for ecdsa signatures.
Subject: [PATCH] bcrypt: Implement BCryptVerifySignature for ecdsa signatures.
---
dlls/bcrypt/bcrypt_main.c | 326 ++++++++++++++++++++++++++++++++++++++++++++-
@ -9,11 +9,11 @@ Subject: bcrypt: Implement BCryptVerifySignature for ecdsa signatures.
2 files changed, 326 insertions(+), 4 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index f822a7aadf3..881f6f7eb0c 100644
index 5381d9c..16bff9d 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -27,6 +27,7 @@
#elif defined(SONAME_LIBGNUTLS)
#elif defined(HAVE_GNUTLS_CIPHER_INIT)
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
+#include <gnutls/abstract.h>
@ -21,7 +21,7 @@ index f822a7aadf3..881f6f7eb0c 100644
#include "ntstatus.h"
@@ -49,9 +50,26 @@ static HINSTANCE instance;
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
WINE_DECLARE_DEBUG_CHANNEL(winediag);
+#if GNUTLS_VERSION_MAJOR < 3
@ -119,7 +119,7 @@ index f822a7aadf3..881f6f7eb0c 100644
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
{
@@ -1124,6 +1180,264 @@ static NTSTATUS key_symmetric_get_secret( struct key *key, UCHAR **secret, ULONG
@@ -1195,6 +1251,264 @@ static NTSTATUS key_symmetric_get_secret( struct key *key, UCHAR **secret, ULONG
return STATUS_SUCCESS;
}
@ -384,7 +384,7 @@ index f822a7aadf3..881f6f7eb0c 100644
static NTSTATUS key_destroy( struct key *key )
{
if (key_is_symmetric(key))
@@ -1230,6 +1544,13 @@ static NTSTATUS key_symmetric_get_secret( struct key *key, UCHAR **secret, ULONG
@@ -1409,6 +1723,13 @@ static NTSTATUS key_symmetric_get_secret( struct key *key, UCHAR **secret, ULONG
return STATUS_NOT_IMPLEMENTED;
}
@ -398,7 +398,7 @@ index f822a7aadf3..881f6f7eb0c 100644
static NTSTATUS key_destroy( struct key *key )
{
ERR( "support for keys not available at build time\n" );
@@ -1463,13 +1784,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
@@ -1642,13 +1963,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
{
struct key *key = handle;
@ -416,10 +416,10 @@ index f822a7aadf3..881f6f7eb0c 100644
NTSTATUS WINAPI BCryptDestroyKey( BCRYPT_KEY_HANDLE handle )
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 20f70706430..73bd4d69a5b 100644
index 678b5c1..0694a0f 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1688,10 +1688,10 @@ static void test_ECDSA(void)
@@ -1411,10 +1411,10 @@ static void test_ECDSA(void)
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
status = pBCryptVerifySignature(key, NULL, certHash, sizeof(certHash) - 1, certSignature, sizeof(certSignature), 0);
@ -433,5 +433,5 @@ index 20f70706430..73bd4d69a5b 100644
pBCryptDestroyKey(key);
pBCryptCloseAlgorithmProvider(alg, 0);
--
2.14.1
1.9.1

View File

@ -1,8 +1,8 @@
From 72f7ded1f27e7d14b7efb7200b43e320f3e245d4 Mon Sep 17 00:00:00 2001
From 7955372efe4eb048ac77fabd17b99807866f06c3 Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Tue, 10 Oct 2017 16:40:41 +0300
Subject: bcrypt: Initial implementation for RSA key import and signature
verification.
Subject: [PATCH] bcrypt: Initial implementation for RSA key import and
signature verification.
---
dlls/bcrypt/bcrypt_main.c | 128 ++++++++++++++++++++++++++++++++++++++++++----
@ -10,7 +10,7 @@ Subject: bcrypt: Initial implementation for RSA key import and signature
2 files changed, 135 insertions(+), 10 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 881f6f7eb0c..3356364a6dc 100644
index 16bff9d..07684b8 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -71,6 +71,9 @@ static int (*pgnutls_pubkey_verify_hash2)(gnutls_pubkey_t key, gnutls_sign_algor
@ -47,31 +47,31 @@ index 881f6f7eb0c..3356364a6dc 100644
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
{
@@ -234,6 +247,7 @@ enum alg_id
ALG_ID_AES,
@@ -272,6 +285,7 @@ enum alg_id
ALG_ID_MD4,
ALG_ID_MD5,
ALG_ID_RNG,
+ ALG_ID_RSA,
ALG_ID_SHA1,
ALG_ID_SHA256,
ALG_ID_SHA384,
@@ -262,6 +276,7 @@ static const struct {
/* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_ALGORITHM, TRUE },
/* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM, FALSE },
/* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM, FALSE },
+ /* ALG_ID_RSA */ { 0, 0, 0, BCRYPT_RSA_ALGORITHM, FALSE },
/* 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 },
@@ -340,6 +355,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
if (!strcmpW( id, BCRYPT_AES_ALGORITHM )) alg_id = ALG_ID_AES;
@@ -302,6 +316,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 },
+ /* ALG_ID_RSA */ { 0, 0, 0, BCRYPT_RSA_ALGORITHM, FALSE },
/* 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 },
@@ -382,6 +397,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;
+ else if (!strcmpW( id, BCRYPT_RSA_ALGORITHM )) alg_id = ALG_ID_RSA;
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;
@@ -950,6 +966,7 @@ static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, con
@@ -1021,6 +1037,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 881f6f7eb0c..3356364a6dc 100644
break;
default:
@@ -1326,6 +1343,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
@@ -1397,6 +1414,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
return STATUS_SUCCESS;
}
@ -114,7 +114,7 @@ index 881f6f7eb0c..3356364a6dc 100644
static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_key)
{
switch (key->alg_id)
@@ -1333,6 +1378,8 @@ static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_
@@ -1404,6 +1449,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 881f6f7eb0c..3356364a6dc 100644
default:
FIXME("Algorithm %d not yet supported\n", key->alg_id);
@@ -1362,6 +1409,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
@@ -1433,6 +1480,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
return STATUS_SUCCESS;
}
@ -138,7 +138,7 @@ index 881f6f7eb0c..3356364a6dc 100644
static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULONG signature_len,
gnutls_datum_t *gnutls_signature )
{
@@ -1370,6 +1425,8 @@ static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULO
@@ -1441,6 +1496,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 881f6f7eb0c..3356364a6dc 100644
default:
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
@@ -1388,18 +1445,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1459,18 +1516,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
NTSTATUS status;
int ret;
@ -195,7 +195,7 @@ index 881f6f7eb0c..3356364a6dc 100644
}
switch (key->alg_id)
@@ -1408,6 +1485,9 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1479,6 +1556,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 881f6f7eb0c..3356364a6dc 100644
default:
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
@@ -1433,7 +1513,8 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
@@ -1504,7 +1584,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 881f6f7eb0c..3356364a6dc 100644
pgnutls_pubkey_deinit( gnutls_key );
return (ret < 0) ? STATUS_INVALID_SIGNATURE : STATUS_SUCCESS;
}
@@ -1774,6 +1855,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
@@ -1953,6 +2034,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
*ret_key = key;
return STATUS_SUCCESS;
}
@ -250,7 +250,7 @@ index 881f6f7eb0c..3356364a6dc 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 3dcc953e9ed..944796024bf 100644
index bf0547c..89736d6 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -63,6 +63,8 @@ typedef LONG NTSTATUS;
@ -262,15 +262,15 @@ index 3dcc953e9ed..944796024bf 100644
#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}
@@ -72,6 +74,7 @@ typedef LONG NTSTATUS;
#define BCRYPT_AES_ALGORITHM (const WCHAR []){'A','E','S',0}
@@ -74,6 +76,7 @@ typedef LONG NTSTATUS;
#define BCRYPT_MD4_ALGORITHM (const WCHAR []){'M','D','4',0}
#define BCRYPT_MD5_ALGORITHM (const WCHAR []){'M','D','5',0}
#define BCRYPT_RNG_ALGORITHM (const WCHAR []){'R','N','G',0}
+#define BCRYPT_RSA_ALGORITHM (const WCHAR []){'R','S','A',0}
#define BCRYPT_SHA1_ALGORITHM (const WCHAR []){'S','H','A','1',0}
#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}
@@ -138,6 +141,20 @@ typedef struct _BCRYPT_ECCKEY_BLOB
@@ -140,6 +143,20 @@ typedef struct _BCRYPT_ECCKEY_BLOB
ULONG cbKey;
} BCRYPT_ECCKEY_BLOB, *PBCRYPT_ECCKEY_BLOB;
@ -292,5 +292,5 @@ index 3dcc953e9ed..944796024bf 100644
{
LPCWSTR pszAlgId;
--
2.14.1
1.9.1

View File

@ -1,33 +0,0 @@
From 3651880f20c67b92c384f805191b1b5e3a3a8631 Mon Sep 17 00:00:00 2001
From: Samuel Kim <ubuntor2000@gmail.com>
Date: Sat, 5 Sep 2015 21:40:00 -0400
Subject: comctl32: fix buttons becoming unthemed when pressed/released
Fixes 37584.
---
dlls/comctl32/theme_button.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/comctl32/theme_button.c b/dlls/comctl32/theme_button.c
index 327c76b..cffa092 100644
--- a/dlls/comctl32/theme_button.c
+++ b/dlls/comctl32/theme_button.c
@@ -419,6 +419,14 @@ LRESULT CALLBACK THEMING_ButtonSubclassProc(HWND hwnd, UINT msg,
break;
}
+ case BM_SETCHECK:
+ case BM_SETSTATE:
+ theme = GetWindowTheme(hwnd);
+ if (theme) {
+ InvalidateRect(hwnd, NULL, FALSE);
+ }
+ return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
+
default:
/* Call old proc */
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
--
2.5.1

View File

@ -1 +0,0 @@
Fixes: [37584] Properly render themed buttons when they are pressed

View File

@ -1,7 +1,7 @@
From 8ad9cbe32ec79dfff404aee19772d684f524e287 Mon Sep 17 00:00:00 2001
From e8fdbe56cb46f23d730bcc32a15510cc770b4ce6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Sep 2017 22:17:15 +0200
Subject: crypt32/tests: Add basic test for ecdsa oid.
Subject: [PATCH] crypt32/tests: Add basic test for ecdsa oid.
---
dlls/crypt32/tests/oid.c | 35 +++++++++++++++++++++++++++++++++++
@ -9,7 +9,7 @@ Subject: crypt32/tests: Add basic test for ecdsa oid.
2 files changed, 50 insertions(+)
diff --git a/dlls/crypt32/tests/oid.c b/dlls/crypt32/tests/oid.c
index b6614071aba..567658d515d 100644
index 8fc67b3..e14f240 100644
--- a/dlls/crypt32/tests/oid.c
+++ b/dlls/crypt32/tests/oid.c
@@ -22,6 +22,7 @@
@ -20,20 +20,20 @@ index b6614071aba..567658d515d 100644
#include <wincrypt.h>
#include <winreg.h>
@@ -541,8 +542,10 @@ static void test_enumOIDInfo(void)
@@ -543,8 +544,10 @@ static void test_enumOIDInfo(void)
static void test_findOIDInfo(void)
{
+ static WCHAR sha256ECDSA[] = { 's','h','a','2','5','6','E','C','D','S','A',0 };
static WCHAR sha1[] = { 's','h','a','1',0 };
static CHAR oid_rsa_md5[] = szOID_RSA_MD5;
static CHAR oid_rsa_md5[] = szOID_RSA_MD5, oid_sha256[] = szOID_NIST_sha256;
+ static CHAR oid_ecda_sha25[] = szOID_ECDSA_SHA256;
ALG_ID alg = CALG_SHA1;
ALG_ID algs[2] = { CALG_MD5, CALG_RSA_SIGN };
PCCRYPT_OID_INFO info;
@@ -585,6 +588,38 @@ static void test_findOIDInfo(void)
ok(U(*info).Algid == CALG_MD5, "Expected CALG_MD5, got %d\n",
U(*info).Algid);
@@ -600,6 +603,38 @@ static void test_findOIDInfo(void)
ok(U(*info).Algid == CALG_SHA_256 || U(*info).Algid == -1,
"Expected CALG_MD5 or -1, got %d\n", U(*info).Algid);
}
+
+ info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, oid_ecda_sha25, 0);
@ -71,7 +71,7 @@ index b6614071aba..567658d515d 100644
START_TEST(oid)
diff --git a/include/wincrypt.h b/include/wincrypt.h
index 22ff350923a..d3c3bf07056 100644
index a7c24e7..373acac 100644
--- a/include/wincrypt.h
+++ b/include/wincrypt.h
@@ -1244,6 +1244,17 @@ typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_FUNC)(DWORD dwEncodingType,
@ -104,5 +104,5 @@ index 22ff350923a..d3c3bf07056 100644
typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
--
2.14.1
1.9.1

View File

@ -1,35 +1,36 @@
From cac3b5016a340f61ae2e7f16508fd8b30baaf88d Mon Sep 17 00:00:00 2001
From a95984145caa33f4f5b85f76708559c3696db33f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 7 Mar 2015 18:09:37 +0100
Subject: ntdll: Process APC calls before starting process.
Subject: [PATCH] ntdll: Process APC calls before starting process.
alesliehughes - rebase conflict - not sure if this is correct anymore.
---
dlls/ntdll/loader.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 5d8b4e2e513..cdf8d586c36 100644
index 77a16b3..49e8619 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3111,6 +3111,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
@@ -3113,6 +3113,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
+ LARGE_INTEGER timeout;
NTSTATUS status;
WINE_MODREF *wm;
LPCWSTR load_path;
@@ -3158,6 +3159,10 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
virtual_release_address_space();
virtual_clear_thread_stack();
PEB *peb = NtCurrentTeb()->Peb;
@@ -3152,6 +3153,10 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), status );
NtTerminateProcess( GetCurrentProcess(), status );
}
+
+ timeout.QuadPart = 0;
+ NtDelayExecution( TRUE, &timeout );
+
if (context.ContextFlags) NtSetContextThread( GetCurrentThread(), &context );
wine_switch_to_stack( start_process, wm->ldr.EntryPoint, NtCurrentTeb()->Tib.StackBase );
server_init_process_done();
}
--
2.14.1
1.9.1

View File

@ -1,19 +1,20 @@
From c8675f4675c856711f0b3e3395e484e77e6c4c00 Mon Sep 17 00:00:00 2001
From 4f9ac8c39ccef8c5e3016981a4508e5e54598a91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 10 Jan 2017 21:04:11 +0100
Subject: include: Add run level information enum and structure to winnt.h.
Subject: [PATCH] include: Add run level information enum and structure to
winnt.h.
---
include/winnt.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
include/winnt.h | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h
index 72c399b410f..abdd7569eed 100644
index 04f00a6..6e72a6a 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -5670,11 +5670,30 @@ typedef struct _ASSEMBLY_FILE_DETAILED_INFORMATION {
typedef const ASSEMBLY_FILE_DETAILED_INFORMATION *PCASSEMBLY_FILE_DETAILED_INFORMATION;
@@ -5763,16 +5763,34 @@ typedef struct _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION {
} ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, *PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION;
#endif
+typedef enum {
+ ACTCTX_RUN_LEVEL_UNSPECIFIED = 0,
@ -37,11 +38,17 @@ index 72c399b410f..abdd7569eed 100644
AssemblyDetailedInformationInActivationContext = 3,
FileInformationInAssemblyOfAssemblyInActivationContext = 4,
+ RunlevelInformationInActivationContext = 5,
+ CompatibilityInformationInActivationContext = 6,
CompatibilityInformationInActivationContext = 6,
+ ActivationContextManifestResourceName = 7,
MaxActivationContextInfoClass,
AssemblyDetailedInformationInActivationContxt = 3,
- AssemblyDetailedInformationInActivationContxt = 3,
- FileInformationInAssemblyOfAssemblyInActivationContxt = 4
+ AssemblyDetailedInformationInActivationContxt = 3,
+ FileInformationInAssemblyOfAssemblyInActivationContxt = 4
} ACTIVATION_CONTEXT_INFO_CLASS;
#define ACTIVATION_CONTEXT_PATH_TYPE_NONE 1
--
2.11.0
1.9.1

View File

@ -1,45 +1,27 @@
From d7c46fb48d7fab2cd7caa498843f85ff085cae6a Mon Sep 17 00:00:00 2001
From c657cab5f25ce05fb091f03fccf005517d3918a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 10 Jan 2017 21:06:06 +0100
Subject: ntdll: Parse execution level information in manifest data.
Subject: [PATCH] ntdll: Parse execution level information in manifest data.
---
dlls/ntdll/actctx.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 157 insertions(+), 9 deletions(-)
dlls/ntdll/actctx.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 148 insertions(+)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 323ee68fc09..6801bcfb6d2 100644
index 956f255..b099bb1 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -490,15 +490,18 @@ enum assembly_type
struct assembly
{
- enum assembly_type type;
- struct assembly_identity id;
- struct file_info manifest;
- WCHAR *directory;
- BOOL no_inherit;
- struct dll_redirect *dlls;
- unsigned int num_dlls;
- unsigned int allocated_dlls;
- struct entity_array entities;
+ enum assembly_type type;
+ struct assembly_identity id;
+ struct file_info manifest;
+ WCHAR *directory;
+ BOOL no_inherit;
+ struct dll_redirect *dlls;
+ unsigned int num_dlls;
+ unsigned int allocated_dlls;
+ struct entity_array entities;
@@ -501,6 +501,9 @@ struct assembly
struct entity_array entities;
COMPATIBILITY_CONTEXT_ELEMENT* compat_contexts;
ULONG num_compat_contexts;
+ BOOL rel_found;
+ ACTCTX_REQUESTED_RUN_LEVEL run_level;
+ DWORD ui_access;
};
enum context_sections
@@ -557,6 +560,10 @@ static const WCHAR fileW[] = {'f','i','l','e',0};
@@ -559,6 +562,10 @@ static const WCHAR fileW[] = {'f','i','l','e',0};
static const WCHAR hashW[] = {'h','a','s','h',0};
static const WCHAR noInheritW[] = {'n','o','I','n','h','e','r','i','t',0};
static const WCHAR noInheritableW[] = {'n','o','I','n','h','e','r','i','t','a','b','l','e',0};
@ -50,7 +32,7 @@ index 323ee68fc09..6801bcfb6d2 100644
static const WCHAR typelibW[] = {'t','y','p','e','l','i','b',0};
static const WCHAR windowClassW[] = {'w','i','n','d','o','w','C','l','a','s','s',0};
@@ -2024,6 +2031,142 @@ static BOOL parse_clr_surrogate_elem(xmlbuf_t* xmlbuf, struct assembly* assembly
@@ -2055,6 +2062,142 @@ static BOOL parse_clr_surrogate_elem(xmlbuf_t* xmlbuf, struct assembly* assembly
return parse_expect_end_elem(xmlbuf, clrSurrogateW, asmv1W);
}
@ -193,7 +175,7 @@ index 323ee68fc09..6801bcfb6d2 100644
static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, BOOL optional)
{
struct assembly_identity ai;
@@ -2296,6 +2439,11 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl,
@@ -2405,6 +2548,11 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl,
{
ret = parse_clr_surrogate_elem(xmlbuf, assembly, acl);
}
@ -206,5 +188,5 @@ index 323ee68fc09..6801bcfb6d2 100644
{
if (!parse_assembly_identity_elem(xmlbuf, acl->actctx, &assembly->id)) return FALSE;
--
2.11.0
1.9.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "354fa7eb7921c3317e7943c18871febe5570dd52"
echo "0f1cb96b694a38106464044285296e531f90bb67"
}
# Show version information
@ -101,7 +101,6 @@ patch_enable_all ()
enable_bcrypt_Improvements="$1"
enable_browseui_Progress_Dialog="$1"
enable_combase_RoApi="$1"
enable_comctl32_Button_Theming="$1"
enable_comctl32_Listview_DrawItem="$1"
enable_comctl32_TTM_ADDTOOLW="$1"
enable_comctl32_Tests="$1"
@ -370,7 +369,6 @@ patch_enable_all ()
enable_shell32_NewMenu_Interface="$1"
enable_shell32_Placeholder_Icons="$1"
enable_shell32_Progress_Dialog="$1"
enable_shell32_RunDLL_CallEntry16="$1"
enable_shell32_SFGAO_HASSUBFOLDER="$1"
enable_shell32_SHCreateSessionKey="$1"
enable_shell32_SHELL_execute="$1"
@ -581,9 +579,6 @@ patch_enable ()
combase-RoApi)
enable_combase_RoApi="$2"
;;
comctl32-Button_Theming)
enable_comctl32_Button_Theming="$2"
;;
comctl32-Listview_DrawItem)
enable_comctl32_Listview_DrawItem="$2"
;;
@ -1388,9 +1383,6 @@ patch_enable ()
shell32-Progress_Dialog)
enable_shell32_Progress_Dialog="$2"
;;
shell32-RunDLL_CallEntry16)
enable_shell32_RunDLL_CallEntry16="$2"
;;
shell32-SFGAO_HASSUBFOLDER)
enable_shell32_SFGAO_HASSUBFOLDER="$2"
;;
@ -3017,7 +3009,7 @@ if test "$enable_Pipelight" -eq 1; then
patch_apply Pipelight/0001-winex11-Implement-X11DRV_FLUSH_GDI_DISPLAY-ExtEscape-c.patch
patch_apply Pipelight/0002-user32-Decrease-minimum-SetTimer-interval-to-5-ms.patch
patch_apply Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch
patch_apply Pipelight/0004-winex11.drv-Indicate-direct-rendering-through-OpenGL.patch
#patch_apply Pipelight/0004-winex11.drv-Indicate-direct-rendering-through-OpenGL.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "winex11: Implement X11DRV_FLUSH_GDI_DISPLAY ExtEscape command.", 1 },';
printf '%s\n' '+ { "Michael Müller", "user32: Decrease minimum SetTimer interval to 5 ms.", 2 },';
@ -3389,7 +3381,6 @@ fi
if test "$enable_api_ms_win_Stub_DLLs" -eq 1; then
patch_apply api-ms-win-Stub_DLLs/0001-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch
patch_apply api-ms-win-Stub_DLLs/0006-iertutil-Add-dll-and-add-stub-for-ordinal-811.patch
patch_apply api-ms-win-Stub_DLLs/0007-shcore-Add-dll.patch
patch_apply api-ms-win-Stub_DLLs/0008-api-ms-win-shcore-obsolete-l1-1-0-Add-dll.patch
patch_apply api-ms-win-Stub_DLLs/0009-ext-ms-win-xaml-pal-l1-1-0-Add-dll-and-add-stub-for-.patch
patch_apply api-ms-win-Stub_DLLs/0010-ext-ms-win-appmodel-usercontext-l1-1-0-Add-dll-and-a.patch
@ -3401,9 +3392,6 @@ if test "$enable_api_ms_win_Stub_DLLs" -eq 1; then
patch_apply api-ms-win-Stub_DLLs/0017-api-ms-win-rtcore-ntuser-window-l1-1-0-Add-dll.patch
patch_apply api-ms-win-Stub_DLLs/0018-ext-ms-win-rtcore-ntuser-syscolors-l1-1-0-Add-dll.patch
patch_apply api-ms-win-Stub_DLLs/0019-api-ms-win-rtcore-ntuser-draw-l1-1-0-Add-dll.patch
patch_apply api-ms-win-Stub_DLLs/0022-shcore-Add-SetProcessDpiAwareness-stub.patch
patch_apply api-ms-win-Stub_DLLs/0023-shcore-Implement-stub-for-GetDpiForMonitor.patch
patch_apply api-ms-win-Stub_DLLs/0025-shcore-Add-stub-for-GetProcessDpiAwareness.patch
patch_apply api-ms-win-Stub_DLLs/0026-feclient-Add-stub-dll.patch
patch_apply api-ms-win-Stub_DLLs/0027-uiautomationcore-Add-dll-and-stub-some-functions.patch
(
@ -3557,21 +3545,6 @@ if test "$enable_browseui_Progress_Dialog" -eq 1; then
) >> "$patchlist"
fi
# Patchset comctl32-Button_Theming
# |
# | This patchset fixes the following Wine bugs:
# | * [#37584] Properly render themed buttons when they are pressed
# |
# | Modified files:
# | * dlls/comctl32/theme_button.c
# |
if test "$enable_comctl32_Button_Theming" -eq 1; then
patch_apply comctl32-Button_Theming/0001-comctl32-fix-buttons-becoming-unthemed-when-pressed-.patch
(
printf '%s\n' '+ { "Samuel Kim", "comctl32: Fix buttons becoming unthemed when pressed/released.", 1 },';
) >> "$patchlist"
fi
# Patchset comctl32-Listview_DrawItem
# |
# | This patchset fixes the following Wine bugs:
@ -8233,21 +8206,6 @@ if test "$enable_shell32_Placeholder_Icons" -eq 1; then
) >> "$patchlist"
fi
# Patchset shell32-RunDLL_CallEntry16
# |
# | This patchset fixes the following Wine bugs:
# | * [#23033] Use manual relay for RunDLL_CallEntry16 in shell32
# |
# | Modified files:
# | * dlls/shell32/control.c, dlls/shell32/shell32.spec
# |
if test "$enable_shell32_RunDLL_CallEntry16" -eq 1; then
patch_apply shell32-RunDLL_CallEntry16/0001-shell32-Use-manual-redirection-for-RunDLL_CallEntry1.patch
(
printf '%s\n' '+ { "Michael Müller", "shell32: Use manual redirection for RunDLL_CallEntry16.", 1 },';
) >> "$patchlist"
fi
# Patchset shell32-SFGAO_HASSUBFOLDER
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,20 +1,21 @@
From 8bffcd9ad57c8c1b13f38045585043b7003c7c0c Mon Sep 17 00:00:00 2001
From 2ea454b0c058d14647bb55593d1021454a3c09a4 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 25 Jun 2014 11:49:12 -0600
Subject: server: Add default security descriptor ownership for processes.
Subject: [PATCH] server: Add default security descriptor ownership for
processes.
---
dlls/advapi32/tests/security.c | 35 +++++++++++++++++++++++++++++++++++
server/process.c | 26 +++++++++++++++++++++++++-
server/security.h | 1 +
server/token.c | 8 ++++++++
4 files changed, 69 insertions(+), 1 deletion(-)
server/token.c | 2 ++
4 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index ca5edffae5..acbf124be8 100644
index c472491..6f7a7f1 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -4542,11 +4542,15 @@ static void test_acls(void)
@@ -4665,11 +4665,15 @@ static void test_acls(void)
static void test_GetSecurityInfo(void)
{
@ -30,7 +31,7 @@ index ca5edffae5..acbf124be8 100644
ACL_SIZE_INFORMATION acl_size;
PSECURITY_DESCRIPTOR pSD;
ACCESS_ALLOWED_ACE *ace;
@@ -4673,6 +4677,37 @@ static void test_GetSecurityInfo(void)
@@ -4796,6 +4800,37 @@ static void test_GetSecurityInfo(void)
}
LocalFree(pSD);
CloseHandle(obj);
@ -69,7 +70,7 @@ index ca5edffae5..acbf124be8 100644
static void test_GetSidSubAuthority(void)
diff --git a/server/process.c b/server/process.c
index 2327a2664b..de6b1ed020 100644
index 651ecdf..9a11e0a 100644
--- a/server/process.c
+++ b/server/process.c
@@ -62,6 +62,7 @@ static int shutdown_stage; /* current stage in the shutdown process */
@ -89,7 +90,7 @@ index 2327a2664b..de6b1ed020 100644
default_set_sd, /* set_sd */
no_lookup_name, /* lookup_name */
no_link_name, /* link_name */
@@ -671,6 +672,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access
@@ -672,6 +673,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access
return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
}
@ -120,7 +121,7 @@ index 2327a2664b..de6b1ed020 100644
{
struct process *process = get_fd_user( fd );
diff --git a/server/security.h b/server/security.h
index 873bbc6afd..606dbb2ab2 100644
index bc4a8f6..6c33714 100644
--- a/server/security.h
+++ b/server/security.h
@@ -47,6 +47,7 @@ extern const PSID security_local_user_sid;
@ -132,24 +133,18 @@ index 873bbc6afd..606dbb2ab2 100644
diff --git a/server/token.c b/server/token.c
index 532d7b7405..1aa1c993df 100644
index b0849ad..9228e46 100644
--- a/server/token.c
+++ b/server/token.c
@@ -92,6 +92,13 @@ static const struct /* same fields as struct SID */
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
DWORD SubAuthority[2];
} builtin_users_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } };
+static const struct /* same fields as struct SID */
+{
+ BYTE Revision;
+ BYTE SubAuthorityCount;
+ SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
+ DWORD SubAuthority[5];
+} domain_users_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, DOMAIN_GROUP_RID_USERS } };
@@ -83,6 +83,7 @@ static const SID_N(5) local_user_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORIT
static const SID_N(2) builtin_admins_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } };
static const SID_N(2) builtin_users_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } };
static const SID_N(3) builtin_logon_sid = { SID_REVISION, 3, { SECURITY_NT_AUTHORITY }, { SECURITY_LOGON_IDS_RID, 0, 0 } };
+static const SID_N(5) domain_users_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, DOMAIN_GROUP_RID_USERS } };
const PSID security_world_sid = (PSID)&world_sid;
static const PSID security_local_sid = (PSID)&local_sid;
@@ -101,6 +108,7 @@ const PSID security_local_system_sid = (PSID)&local_system_sid;
@@ -92,6 +93,7 @@ const PSID security_local_system_sid = (PSID)&local_system_sid;
const PSID security_local_user_sid = (PSID)&local_user_sid;
const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
const PSID security_builtin_users_sid = (PSID)&builtin_users_sid;
@ -158,5 +153,5 @@ index 532d7b7405..1aa1c993df 100644
static luid_t prev_luid_value = { 1000, 0 };
--
2.13.1
1.9.1

View File

@ -1,56 +0,0 @@
From f83364d68291cd94bc0e20fee08fd08ff1e8f35d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 4 Aug 2014 23:04:34 +0200
Subject: shell32: Use manual redirection for RunDLL_CallEntry16
---
dlls/shell32/control.c | 22 ++++++++++++++++++++++
dlls/shell32/shell32.spec | 2 +-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c
index b393154..2ddf8b0 100644
--- a/dlls/shell32/control.c
+++ b/dlls/shell32/control.c
@@ -883,3 +883,25 @@ DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, D
FIXME("(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
return 0x0deadbee;
}
+
+/*************************************************************************
+ * RunDLL_CallEntry16 [SHELL32.122]
+ * Manually relay this function to make Tages Protection v5 happy
+ */
+void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
+ LPCSTR cmdline, INT cmdshow )
+{
+ static HMODULE shell16 = NULL;
+ static void (WINAPI *pRunDLL_CallEntry16)( DWORD proc, HWND hwnd, HINSTANCE inst,
+ LPCSTR cmdline, INT cmdshow ) = NULL;
+
+ if (!pRunDLL_CallEntry16)
+ {
+ if (!shell16 && !(shell16 = LoadLibraryA( "shell.dll16" )))
+ return;
+ if (!(pRunDLL_CallEntry16 = (void *)GetProcAddress( shell16, "RunDLL_CallEntry16" )))
+ return;
+ }
+
+ pRunDLL_CallEntry16( proc, hwnd, inst, cmdline, cmdshow );
+}
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index d73dcbb..e559587 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -114,7 +114,7 @@
119 stdcall -ordinal IsLFNDrive(ptr) IsLFNDriveAW
120 stdcall -noname FileMenu_AbortInitMenu()
121 stdcall -noname SHFlushClipboard()
- 122 stdcall -private @(long long ptr str long) shell.dll16.RunDLL_CallEntry16
+ 122 stdcall -noname RunDLL_CallEntry16(long long ptr str long)
123 stdcall -noname SHFreeUnusedLibraries()
124 stdcall -noname FileMenu_AppendFilesForPidl(long ptr long)
125 stdcall -noname FileMenu_AddFilesForPidl(long long long ptr long long ptr)
--
1.8.3.2

View File

@ -1 +0,0 @@
Fixes: [23033] Use manual relay for RunDLL_CallEntry16 in shell32