You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4232441093 | ||
|
912df91ba1 | ||
|
12f8688fc5 | ||
|
3e2e449d4e | ||
|
3f05773e20 | ||
|
a47000e41c | ||
|
e92999d7d5 | ||
|
687f25d6bb | ||
|
8ef379ecc8 | ||
|
d79b66338e | ||
|
82cd676a72 | ||
|
da78da9cdd | ||
|
b9b5da4780 | ||
|
444ec16851 | ||
|
76b749edc9 | ||
|
a56b7a18c3 | ||
|
5a5b6e862b | ||
|
06da0acbdc | ||
|
efdf5d2bc2 | ||
|
543b9eaae1 | ||
|
ce5620a1a4 | ||
|
05a282feff | ||
|
ab34c856c3 | ||
|
9a9fb0c9f8 | ||
|
0ef6532241 | ||
|
3b1cd79e05 | ||
|
37b0772439 | ||
|
3b947eae95 | ||
|
73cb57f5b9 | ||
|
f473f9cb80 | ||
|
9e463db339 | ||
|
943ffbfbbf | ||
|
5ad5986215 | ||
|
998dd35306 | ||
|
df5f35e1d1 | ||
|
f61db43e7f | ||
|
734b40739a | ||
|
c97e444da2 | ||
|
b84644bd63 | ||
|
1c3562d671 | ||
|
14f5eae731 | ||
|
534583d958 | ||
|
aa957fe3a3 | ||
|
e3bf95ebea | ||
|
8c7825d1c0 | ||
|
fae17cd83a | ||
|
8caca32d08 | ||
|
0be12d7669 | ||
|
a99ad44fff | ||
|
a644cbf827 | ||
|
88c85f01c3 | ||
|
04a8307d45 | ||
|
c6708dbbbf | ||
|
3dfeab6722 | ||
|
147562e3e1 | ||
|
1383fc82bc | ||
|
23560728b5 | ||
|
3f25cd198a | ||
|
5b58419a0e | ||
|
4136b55f1c | ||
|
2ae8a0be02 | ||
|
dc52cbef3c |
@@ -0,0 +1,55 @@
|
||||
From ce0ab0ccd6e4953a9673d15e00cf602668469c2c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 5 Mar 2017 23:04:36 +0100
|
||||
Subject: advapi32: Fix error code when calling LsaOpenPolicy for non existing
|
||||
remote machine.
|
||||
|
||||
---
|
||||
dlls/advapi32/lsa.c | 2 +-
|
||||
dlls/advapi32/tests/lsa.c | 10 ++++++++++
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
||||
index b8dedbd6d58..e5e3b1649c0 100644
|
||||
--- a/dlls/advapi32/lsa.c
|
||||
+++ b/dlls/advapi32/lsa.c
|
||||
@@ -692,7 +692,7 @@ NTSTATUS WINAPI LsaOpenPolicy(
|
||||
ObjectAttributes, DesiredAccess, PolicyHandle);
|
||||
|
||||
ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL,
|
||||
- STATUS_ACCESS_VIOLATION);
|
||||
+ RPC_NT_SERVER_UNAVAILABLE);
|
||||
dumpLsaAttributes(ObjectAttributes);
|
||||
|
||||
if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
|
||||
diff --git a/dlls/advapi32/tests/lsa.c b/dlls/advapi32/tests/lsa.c
|
||||
index 4daf75f58d1..7ddda731be2 100644
|
||||
--- a/dlls/advapi32/tests/lsa.c
|
||||
+++ b/dlls/advapi32/tests/lsa.c
|
||||
@@ -70,6 +70,8 @@ static BOOL init(void)
|
||||
|
||||
static void test_lsa(void)
|
||||
{
|
||||
+ static WCHAR machineW[] = {'W','i','n','e','N','o','M','a','c','h','i','n','e',0};
|
||||
+ LSA_UNICODE_STRING machine;
|
||||
NTSTATUS status;
|
||||
LSA_HANDLE handle;
|
||||
LSA_OBJECT_ATTRIBUTES object_attributes;
|
||||
@@ -77,6 +79,14 @@ static void test_lsa(void)
|
||||
ZeroMemory(&object_attributes, sizeof(object_attributes));
|
||||
object_attributes.Length = sizeof(object_attributes);
|
||||
|
||||
+ machine.Buffer = machineW;
|
||||
+ machine.Length = sizeof(machineW) - 2;
|
||||
+ machine.MaximumLength = sizeof(machineW);
|
||||
+
|
||||
+ status = pLsaOpenPolicy( &machine, &object_attributes, POLICY_LOOKUP_NAMES, &handle);
|
||||
+ ok(status == RPC_NT_SERVER_UNAVAILABLE,
|
||||
+ "LsaOpenPolicy(POLICY_LOOKUP_NAMES) for invalid machine returned 0x%08x\n", status);
|
||||
+
|
||||
status = pLsaOpenPolicy( NULL, &object_attributes, POLICY_ALL_ACCESS, &handle);
|
||||
ok(status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED,
|
||||
"LsaOpenPolicy(POLICY_ALL_ACCESS) returned 0x%08x\n", status);
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,34 @@
|
||||
From 1941137bff72a2297812bbd05fb6f6a1578426b0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 5 Mar 2017 23:05:54 +0100
|
||||
Subject: advapi32: Use TRACE for LsaOpenPolicy/LsaClose.
|
||||
|
||||
---
|
||||
dlls/advapi32/lsa.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
||||
index e5e3b1649c0..0f2167d19ab 100644
|
||||
--- a/dlls/advapi32/lsa.c
|
||||
+++ b/dlls/advapi32/lsa.c
|
||||
@@ -136,7 +136,7 @@ NTSTATUS WINAPI LsaAddAccountRights(
|
||||
*/
|
||||
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
|
||||
{
|
||||
- FIXME("(%p) stub\n", ObjectHandle);
|
||||
+ TRACE("(%p) semi-stub\n", ObjectHandle);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ NTSTATUS WINAPI LsaOpenPolicy(
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN OUT PLSA_HANDLE PolicyHandle)
|
||||
{
|
||||
- FIXME("(%s,%p,0x%08x,%p) stub\n",
|
||||
+ TRACE("(%s,%p,0x%08x,%p) semi-stub\n",
|
||||
SystemName?debugstr_w(SystemName->Buffer):"(null)",
|
||||
ObjectAttributes, DesiredAccess, PolicyHandle);
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,162 @@
|
||||
From fdc085e009942fa89ef5f0cd4104ab78c9d80b1b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 5 Mar 2017 23:50:06 +0100
|
||||
Subject: advapi32: Implement LsaLookupPrivilegeName.
|
||||
|
||||
---
|
||||
dlls/advapi32/advapi32.spec | 2 +-
|
||||
dlls/advapi32/advapi32_misc.h | 2 ++
|
||||
dlls/advapi32/lsa.c | 38 ++++++++++++++++++++++++++++++++++++++
|
||||
dlls/advapi32/security.c | 27 ++++++++++++++++++---------
|
||||
include/ntsecapi.h | 1 +
|
||||
5 files changed, 60 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
|
||||
index 3000973265c..2c599c8bd92 100644
|
||||
--- a/dlls/advapi32/advapi32.spec
|
||||
+++ b/dlls/advapi32/advapi32.spec
|
||||
@@ -446,7 +446,7 @@
|
||||
@ stdcall LsaLookupNames2(ptr long long ptr ptr ptr)
|
||||
@ stdcall LsaLookupNames(long long ptr ptr ptr)
|
||||
@ stub LsaLookupPrivilegeDisplayName
|
||||
-# @ stub LsaLookupPrivilegeName
|
||||
+@ stdcall LsaLookupPrivilegeName(long ptr ptr)
|
||||
# @ stub LsaLookupPrivilegeValue
|
||||
@ stdcall LsaLookupSids(ptr long ptr ptr ptr)
|
||||
# @ stub LsaManageSidNameMapping
|
||||
diff --git a/dlls/advapi32/advapi32_misc.h b/dlls/advapi32/advapi32_misc.h
|
||||
index d116ecb836e..ecb07f635a6 100644
|
||||
--- a/dlls/advapi32/advapi32_misc.h
|
||||
+++ b/dlls/advapi32/advapi32_misc.h
|
||||
@@ -68,4 +68,6 @@ static inline WCHAR *strdupAW( const char *src )
|
||||
return dst;
|
||||
}
|
||||
|
||||
+const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1];
|
||||
+
|
||||
#endif /* __WINE_ADVAPI32MISC_H */
|
||||
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
||||
index 0f2167d19ab..6a7a69a9eb7 100644
|
||||
--- a/dlls/advapi32/lsa.c
|
||||
+++ b/dlls/advapi32/lsa.c
|
||||
@@ -1012,3 +1012,41 @@ NTSTATUS WINAPI LsaUnregisterPolicyChangeNotification(
|
||||
FIXME("(%d,%p) stub\n", class, event);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * LsaLookupPrivilegeName [ADVAPI32.@]
|
||||
+ *
|
||||
+ */
|
||||
+NTSTATUS WINAPI LsaLookupPrivilegeName(
|
||||
+ LSA_HANDLE handle,
|
||||
+ PLUID lpLuid,
|
||||
+ PUNICODE_STRING *name)
|
||||
+{
|
||||
+ UNICODE_STRING *priv_unicode;
|
||||
+ size_t priv_size;
|
||||
+ WCHAR *strW;
|
||||
+
|
||||
+ TRACE("(%p, %p, %p)\n", handle, lpLuid, name);
|
||||
+
|
||||
+ if (!handle)
|
||||
+ return STATUS_INVALID_HANDLE;
|
||||
+
|
||||
+ if (!name)
|
||||
+ return STATUS_INVALID_PARAMETER;
|
||||
+
|
||||
+ if (lpLuid->HighPart ||
|
||||
+ (lpLuid->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE ||
|
||||
+ lpLuid->LowPart > SE_MAX_WELL_KNOWN_PRIVILEGE))
|
||||
+ return STATUS_NO_SUCH_PRIVILEGE;
|
||||
+
|
||||
+ priv_size = (strlenW(WellKnownPrivNames[lpLuid->LowPart]) + 1) * sizeof(WCHAR);
|
||||
+ priv_unicode = heap_alloc(sizeof(*priv_unicode) + priv_size);
|
||||
+ if (!priv_unicode) return STATUS_NO_MEMORY;
|
||||
+
|
||||
+ strW = (WCHAR *)(priv_unicode + 1);
|
||||
+ strcpyW(strW, WellKnownPrivNames[lpLuid->LowPart]);
|
||||
+ RtlInitUnicodeString(priv_unicode, strW);
|
||||
+
|
||||
+ *name = priv_unicode;
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index b0b368d6abf..24ec3099713 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -1840,7 +1840,7 @@ static const WCHAR SE_IMPERSONATE_NAME_W[] =
|
||||
static const WCHAR SE_CREATE_GLOBAL_NAME_W[] =
|
||||
{ 'S','e','C','r','e','a','t','e','G','l','o','b','a','l','P','r','i','v','i','l','e','g','e',0 };
|
||||
|
||||
-static const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1] =
|
||||
+const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1] =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -2043,33 +2043,42 @@ BOOL WINAPI
|
||||
LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName,
|
||||
LPDWORD cchName)
|
||||
{
|
||||
+ UNICODE_STRING system_name, *priv;
|
||||
+ LSA_HANDLE lsa;
|
||||
+ NTSTATUS status;
|
||||
size_t privNameLen;
|
||||
|
||||
TRACE("%s,%p,%p,%p\n",debugstr_w(lpSystemName), lpLuid, lpName, cchName);
|
||||
|
||||
- if (!ADVAPI_IsLocalComputer(lpSystemName))
|
||||
+ RtlInitUnicodeString(&system_name, lpSystemName);
|
||||
+ status = LsaOpenPolicy(&system_name, NULL, POLICY_LOOKUP_NAMES, &lsa);
|
||||
+ if (status)
|
||||
{
|
||||
- SetLastError(RPC_S_SERVER_UNAVAILABLE);
|
||||
+ SetLastError(LsaNtStatusToWinError(status));
|
||||
return FALSE;
|
||||
}
|
||||
- if (lpLuid->HighPart || (lpLuid->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE ||
|
||||
- lpLuid->LowPart > SE_MAX_WELL_KNOWN_PRIVILEGE))
|
||||
+
|
||||
+ status = LsaLookupPrivilegeName(&lsa, lpLuid, &priv);
|
||||
+ LsaClose(lsa);
|
||||
+ if (status)
|
||||
{
|
||||
- SetLastError(ERROR_NO_SUCH_PRIVILEGE);
|
||||
+ SetLastError(LsaNtStatusToWinError(status));
|
||||
return FALSE;
|
||||
}
|
||||
- privNameLen = strlenW(WellKnownPrivNames[lpLuid->LowPart]);
|
||||
- /* Windows crashes if cchName is NULL, so will I */
|
||||
+
|
||||
+ privNameLen = priv->Length / sizeof(WCHAR);
|
||||
if (*cchName <= privNameLen)
|
||||
{
|
||||
*cchName = privNameLen + 1;
|
||||
+ LsaFreeMemory(priv);
|
||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
- strcpyW(lpName, WellKnownPrivNames[lpLuid->LowPart]);
|
||||
+ strcpyW(lpName, priv->Buffer);
|
||||
*cchName = privNameLen;
|
||||
+ LsaFreeMemory(priv);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
diff --git a/include/ntsecapi.h b/include/ntsecapi.h
|
||||
index 2bb3d312e43..0bf0eca43ed 100644
|
||||
--- a/include/ntsecapi.h
|
||||
+++ b/include/ntsecapi.h
|
||||
@@ -370,6 +370,7 @@ NTSTATUS WINAPI LsaLookupNames(LSA_HANDLE,ULONG,PLSA_UNICODE_STRING,PLSA_REFEREN
|
||||
PLSA_TRANSLATED_SID*);
|
||||
NTSTATUS WINAPI LsaLookupNames2(LSA_HANDLE,ULONG,ULONG,PLSA_UNICODE_STRING,PLSA_REFERENCED_DOMAIN_LIST*,
|
||||
PLSA_TRANSLATED_SID2*);
|
||||
+NTSTATUS WINAPI LsaLookupPrivilegeName(LSA_HANDLE,PLUID,PUNICODE_STRING*);
|
||||
NTSTATUS WINAPI LsaLookupSids(LSA_HANDLE,ULONG,PSID *,PLSA_REFERENCED_DOMAIN_LIST *,PLSA_TRANSLATED_NAME *);
|
||||
ULONG WINAPI LsaNtStatusToWinError(NTSTATUS);
|
||||
NTSTATUS WINAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,ACCESS_MASK,PLSA_HANDLE);
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,62 @@
|
||||
From 01efac6b4fa338715ad775c147a6bfc42e0bc38e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 6 Mar 2017 00:01:53 +0100
|
||||
Subject: advapi32: Add stub for LsaLookupPrivilegeDisplayName.
|
||||
|
||||
---
|
||||
dlls/advapi32/advapi32.spec | 2 +-
|
||||
dlls/advapi32/lsa.c | 21 +++++++++++++++++++++
|
||||
2 files changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
|
||||
index 2c599c8bd92..ce1838d8c5a 100644
|
||||
--- a/dlls/advapi32/advapi32.spec
|
||||
+++ b/dlls/advapi32/advapi32.spec
|
||||
@@ -445,7 +445,7 @@
|
||||
# @ stub LsaICLookupSidsWithCreds
|
||||
@ stdcall LsaLookupNames2(ptr long long ptr ptr ptr)
|
||||
@ stdcall LsaLookupNames(long long ptr ptr ptr)
|
||||
-@ stub LsaLookupPrivilegeDisplayName
|
||||
+@ stdcall LsaLookupPrivilegeDisplayName(long ptr ptr ptr)
|
||||
@ stdcall LsaLookupPrivilegeName(long ptr ptr)
|
||||
# @ stub LsaLookupPrivilegeValue
|
||||
@ stdcall LsaLookupSids(ptr long ptr ptr ptr)
|
||||
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
||||
index 6a7a69a9eb7..fdb238f74b2 100644
|
||||
--- a/dlls/advapi32/lsa.c
|
||||
+++ b/dlls/advapi32/lsa.c
|
||||
@@ -45,6 +45,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
||||
return FailureCode; \
|
||||
}
|
||||
|
||||
+static LPCSTR debugstr_us( const UNICODE_STRING *us )
|
||||
+{
|
||||
+ if (!us) return "(null)";
|
||||
+ return debugstr_wn(us->Buffer, us->Length / sizeof(WCHAR));
|
||||
+}
|
||||
+
|
||||
static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa)
|
||||
{
|
||||
if (oa)
|
||||
@@ -1050,3 +1056,18 @@ NTSTATUS WINAPI LsaLookupPrivilegeName(
|
||||
*name = priv_unicode;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * LsaLookupPrivilegeDisplayName [ADVAPI32.@]
|
||||
+ *
|
||||
+ */
|
||||
+NTSTATUS WINAPI LsaLookupPrivilegeDisplayName(
|
||||
+ LSA_HANDLE handle,
|
||||
+ PLSA_UNICODE_STRING name,
|
||||
+ PLSA_UNICODE_STRING *dispname,
|
||||
+ SHORT *language)
|
||||
+{
|
||||
+ FIXME("(%p, %s, %p, %p)\n", handle, debugstr_us(name), dispname, language);
|
||||
+
|
||||
+ return STATUS_NO_SUCH_PRIVILEGE;
|
||||
+}
|
||||
--
|
||||
2.11.0
|
||||
|
1
patches/advapi-LsaLookupPrivilegeName/definition
Normal file
1
patches/advapi-LsaLookupPrivilegeName/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: Add LsaLookupPrivilege[Display]Name stubs
|
@@ -1,61 +0,0 @@
|
||||
From bb079b53bc79d44987d5f7ac93d0e1d2c5b00698 Mon Sep 17 00:00:00 2001
|
||||
From: Austin English <austinenglish@gmail.com>
|
||||
Date: Wed, 9 Nov 2016 21:46:10 -0600
|
||||
Subject: advapi32: add LookupSecurityDescriptorPartsA/W stubs
|
||||
|
||||
Fixes https://bugs.winehq.org/show_bug.cgi?id=41682
|
||||
---
|
||||
dlls/advapi32/advapi32.spec | 4 ++--
|
||||
dlls/advapi32/security.c | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 26 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
|
||||
index 6c57c88adf7..88d8634ef64 100644
|
||||
--- a/dlls/advapi32/advapi32.spec
|
||||
+++ b/dlls/advapi32/advapi32.spec
|
||||
@@ -415,8 +415,8 @@
|
||||
@ stdcall LookupPrivilegeNameW(wstr ptr ptr ptr)
|
||||
@ stdcall LookupPrivilegeValueA(ptr ptr ptr)
|
||||
@ stdcall LookupPrivilegeValueW(ptr ptr ptr)
|
||||
-# @ stub LookupSecurityDescriptorPartsA
|
||||
-# @ stub LookupSecurityDescriptorPartsW
|
||||
+@ stdcall LookupSecurityDescriptorPartsA(ptr ptr ptr ptr ptr ptr ptr)
|
||||
+@ stdcall LookupSecurityDescriptorPartsW(ptr ptr ptr ptr ptr ptr ptr)
|
||||
@ stdcall LsaAddAccountRights(ptr ptr ptr long)
|
||||
@ stub LsaAddPrivilegesToAccount
|
||||
# @ stub LsaClearAuditLog
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index 3b5d7a42b6f..01e8ea02706 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -6199,3 +6199,27 @@ BOOL WINAPI SaferSetLevelInformation(SAFER_LEVEL_HANDLE handle, SAFER_OBJECT_INF
|
||||
FIXME("(%p %u %p %u) stub\n", handle, infotype, buffer, size);
|
||||
return FALSE;
|
||||
}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * LookupSecurityDescriptorPartsA [ADVAPI32.@]
|
||||
+ */
|
||||
+DWORD WINAPI LookupSecurityDescriptorPartsA(TRUSTEEA *owner, TRUSTEEA *group, ULONG *access_count,
|
||||
+ EXPLICIT_ACCESSA *access_list, ULONG *audit_count,
|
||||
+ EXPLICIT_ACCESSA *audit_list, SECURITY_DESCRIPTOR *descriptor)
|
||||
+{
|
||||
+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count,
|
||||
+ access_list, audit_count, audit_list, descriptor);
|
||||
+ return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * LookupSecurityDescriptorPartsW [ADVAPI32.@]
|
||||
+ */
|
||||
+DWORD WINAPI LookupSecurityDescriptorPartsW(TRUSTEEW *owner, TRUSTEEW *group, ULONG *access_count,
|
||||
+ EXPLICIT_ACCESSW *access_list, ULONG *audit_count,
|
||||
+ EXPLICIT_ACCESSW *audit_list, SECURITY_DESCRIPTOR *descriptor)
|
||||
+{
|
||||
+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count,
|
||||
+ access_list, audit_count, audit_list, descriptor);
|
||||
+ return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
+}
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [41682] Add stub for advapi32.LookupSecurityDescriptorPartsA/W
|
@@ -1,4 +1,4 @@
|
||||
From 306414ced0169b9ee4de34706e9235acb1bd93d6 Mon Sep 17 00:00:00 2001
|
||||
From 77c8c1ec52dac0b2ad058a3c52de93422bf91ee6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 15 Jan 2016 13:01:15 +0100
|
||||
Subject: kernelbase: Add dll and add stub for QuirkIsEnabled.
|
||||
@@ -22,7 +22,7 @@ index b9caed090b2..2beb34bafdb 100644
|
||||
+C_SRCS = \
|
||||
+ misc.c
|
||||
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
|
||||
index f104030ab25..74ff728cbc8 100644
|
||||
index f104030ab25..14d2578262f 100644
|
||||
--- a/dlls/kernelbase/kernelbase.spec
|
||||
+++ b/dlls/kernelbase/kernelbase.spec
|
||||
@@ -1,3 +1,6 @@
|
||||
@@ -464,7 +464,7 @@ index f104030ab25..74ff728cbc8 100644
|
||||
+@ stub GetCurrentPackageApplicationResourcesContext
|
||||
+@ stub GetCurrentPackageContext
|
||||
+@ stdcall GetCurrentPackageFamilyName(ptr ptr) kernel32.GetCurrentPackageFamilyName
|
||||
+@ stub GetCurrentPackageFullName
|
||||
+@ stdcall GetCurrentPackageFullName(ptr ptr) kernel32.GetCurrentPackageFullName
|
||||
+@ stdcall GetCurrentPackageId(ptr ptr) kernel32.GetCurrentPackageId
|
||||
+@ stub GetCurrentPackageInfo
|
||||
+@ stub GetCurrentPackagePath
|
||||
@@ -1367,8 +1367,8 @@ index f104030ab25..74ff728cbc8 100644
|
||||
+@ stdcall SetConsoleCtrlHandler(ptr long) kernel32.SetConsoleCtrlHandler
|
||||
+@ stdcall SetConsoleCursorInfo(long ptr) kernel32.SetConsoleCursorInfo
|
||||
+@ stdcall SetConsoleCursorPosition(long long) kernel32.SetConsoleCursorPosition
|
||||
+@ stdcall SetConsoleInputExeNameA(ptr) kernel32.SetConsoleInputExeNameA
|
||||
+@ stdcall SetConsoleInputExeNameW(ptr) kernel32.SetConsoleInputExeNameW
|
||||
+@ stdcall SetConsoleInputExeNameA(str) kernel32.SetConsoleInputExeNameA
|
||||
+@ stdcall SetConsoleInputExeNameW(wstr) kernel32.SetConsoleInputExeNameW
|
||||
+@ stdcall SetConsoleMode(long long) kernel32.SetConsoleMode
|
||||
+@ stdcall SetConsoleOutputCP(long) kernel32.SetConsoleOutputCP
|
||||
+@ stdcall SetConsoleScreenBufferInfoEx(long ptr) kernel32.SetConsoleScreenBufferInfoEx
|
||||
|
@@ -1,81 +1,52 @@
|
||||
From 0f19391f2d2b5478137635a66a560bb9e097075a Mon Sep 17 00:00:00 2001
|
||||
From aefdbc0fabb66052164ecd45fecfb0b947a130ac Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 12 Apr 2016 01:02:34 +0200
|
||||
Subject: uiautomationcore: Add dll and stub some functions.
|
||||
|
||||
---
|
||||
configure.ac | 1 +
|
||||
dlls/uiautomationcore/Makefile.in | 5 ++
|
||||
dlls/uiautomationcore/main.c | 117 ++++++++++++++++++++++++++++
|
||||
dlls/uiautomationcore/uiautomationcore.spec | 99 +++++++++++++++++++++++
|
||||
include/uiautomationcoreapi.h | 16 ++++
|
||||
5 files changed, 238 insertions(+)
|
||||
create mode 100644 dlls/uiautomationcore/Makefile.in
|
||||
create mode 100644 dlls/uiautomationcore/main.c
|
||||
create mode 100644 dlls/uiautomationcore/uiautomationcore.spec
|
||||
dlls/uiautomationcore/Makefile.in | 1 +
|
||||
dlls/uiautomationcore/uia_main.c | 89 ++++++++++++++++++++++++++++-
|
||||
dlls/uiautomationcore/uiautomationcore.spec | 14 +++--
|
||||
include/uiautomationcoreapi.h | 16 ++++++
|
||||
4 files changed, 114 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 4cfcdb1..9e8bbb9 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3314,6 +3314,7 @@ WINE_CONFIG_TEST(dlls/twain_32/tests)
|
||||
WINE_CONFIG_DLL(typelib.dll16,enable_win16)
|
||||
WINE_CONFIG_DLL(ucrtbase,,[implib])
|
||||
WINE_CONFIG_TEST(dlls/ucrtbase/tests)
|
||||
+WINE_CONFIG_DLL(uiautomationcore)
|
||||
WINE_CONFIG_DLL(unicows,,[implib])
|
||||
WINE_CONFIG_DLL(updspapi)
|
||||
WINE_CONFIG_DLL(url,,[implib])
|
||||
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
|
||||
new file mode 100644
|
||||
index 0000000..bd6f9d6
|
||||
--- /dev/null
|
||||
index 78d6254a015..029fc2e4995 100644
|
||||
--- a/dlls/uiautomationcore/Makefile.in
|
||||
+++ b/dlls/uiautomationcore/Makefile.in
|
||||
@@ -0,0 +1,5 @@
|
||||
+MODULE = uiautomationcore.dll
|
||||
@@ -1,4 +1,5 @@
|
||||
MODULE = uiautomationcore.dll
|
||||
+IMPORTS = uuid
|
||||
+
|
||||
+C_SRCS = \
|
||||
+ main.c
|
||||
diff --git a/dlls/uiautomationcore/main.c b/dlls/uiautomationcore/main.c
|
||||
new file mode 100644
|
||||
index 0000000..71fe84c
|
||||
--- /dev/null
|
||||
+++ b/dlls/uiautomationcore/main.c
|
||||
@@ -0,0 +1,117 @@
|
||||
+/*
|
||||
+ * uiautomationcore API
|
||||
+ *
|
||||
|
||||
C_SRCS = \
|
||||
uia_main.c
|
||||
diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c
|
||||
index 994d8e6080b..f1429faeff9 100644
|
||||
--- a/dlls/uiautomationcore/uia_main.c
|
||||
+++ b/dlls/uiautomationcore/uia_main.c
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
+ * Copyright 2016 Michael MĂĽller
|
||||
+ *
|
||||
+ * 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"
|
||||
+
|
||||
* Copyright 2017 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -16,7 +17,11 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
-#include "uiautomationcore.h"
|
||||
+#include <stdarg.h>
|
||||
+
|
||||
+#include "windef.h"
|
||||
+#include "winbase.h"
|
||||
+#include "wine/debug.h"
|
||||
+
|
||||
+#define COBJMACROS
|
||||
+#include "uiautomationcoreapi.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(uiautomation);
|
||||
+
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
@@ -37,11 +42,91 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, void *lpv)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static HRESULT WINAPI dummy_QueryInterface(IUnknown *iface, REFIID iid, void **ppv)
|
||||
+{
|
||||
+ TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), ppv);
|
||||
@@ -115,12 +86,18 @@ index 0000000..71fe84c
|
||||
+
|
||||
+static IUnknown dummy = { &dummy_Vtbl };
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * UiaLookupId (uiautomationcore.@)
|
||||
+ */
|
||||
+int WINAPI UiaLookupId(AutomationIdentifierType type, const GUID *guid)
|
||||
+{
|
||||
+ FIXME("(%d, %s)\n", type, debugstr_guid(guid));
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * UiaGetReservedMixedAttributeValue (uiautomationcore.@)
|
||||
+ */
|
||||
+HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", value);
|
||||
@@ -129,6 +106,9 @@ index 0000000..71fe84c
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * UiaGetReservedNotSupportedValue (uiautomationcore.@)
|
||||
+ */
|
||||
+HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value)
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", value);
|
||||
@@ -137,6 +117,9 @@ index 0000000..71fe84c
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * UiaReturnRawElementProvider (uiautomationcore.@)
|
||||
+ */
|
||||
+LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wparam, LPARAM lparam,
|
||||
+ IRawElementProviderSimple *provider)
|
||||
+{
|
||||
@@ -144,129 +127,68 @@ index 0000000..71fe84c
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+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;
|
||||
+}
|
||||
/***********************************************************************
|
||||
* UiaClientsAreListening (uiautomationcore.@)
|
||||
*/
|
||||
BOOL WINAPI UiaClientsAreListening(void)
|
||||
{
|
||||
- FIXME("()\n");
|
||||
+ FIXME("(): stub\n");
|
||||
return FALSE;
|
||||
}
|
||||
diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec
|
||||
new file mode 100644
|
||||
index 0000000..321cd06
|
||||
--- /dev/null
|
||||
index 3026001b6b7..221711c41d2 100644
|
||||
--- a/dlls/uiautomationcore/uiautomationcore.spec
|
||||
+++ b/dlls/uiautomationcore/uiautomationcore.spec
|
||||
@@ -0,0 +1,99 @@
|
||||
+@ stub DllCanUnloadNow
|
||||
+@ stub DllGetClassObject
|
||||
+@ stub DllRegisterServer
|
||||
+@ stub DllUnregisterServer
|
||||
+@ stub DockPattern_SetDockPosition
|
||||
+@ stub ExpandCollapsePattern_Collapse
|
||||
+@ stub ExpandCollapsePattern_Expand
|
||||
+@ stub GridPattern_GetItem
|
||||
+@ stub InvokePattern_Invoke
|
||||
+@ stub ItemContainerPattern_FindItemByProperty
|
||||
+@ stub LegacyIAccessiblePattern_DoDefaultAction
|
||||
+@ stub LegacyIAccessiblePattern_GetIAccessible
|
||||
+@ stub LegacyIAccessiblePattern_Select
|
||||
+@ stub LegacyIAccessiblePattern_SetValue
|
||||
+@ stub MultipleViewPattern_GetViewName
|
||||
+@ stub MultipleViewPattern_SetCurrentView
|
||||
+@ stub RangeValuePattern_SetValue
|
||||
+@ stub ScrollItemPattern_ScrollIntoView
|
||||
+@ stub ScrollPattern_Scroll
|
||||
+@ stub ScrollPattern_SetScrollPercent
|
||||
+@ stub SelectionItemPattern_AddToSelection
|
||||
+@ stub SelectionItemPattern_RemoveFromSelection
|
||||
+@ stub SelectionItemPattern_Select
|
||||
+@ stub SynchronizedInputPattern_Cancel
|
||||
+@ stub SynchronizedInputPattern_StartListening
|
||||
+@ stub TextPattern_GetSelection
|
||||
+@ stub TextPattern_GetVisibleRanges
|
||||
+@ stub TextPattern_RangeFromChild
|
||||
+@ stub TextPattern_RangeFromPoint
|
||||
+@ stub TextPattern_get_DocumentRange
|
||||
+@ stub TextPattern_get_SupportedTextSelection
|
||||
+@ stub TextRange_AddToSelection
|
||||
+@ stub TextRange_Clone
|
||||
+@ stub TextRange_Compare
|
||||
+@ stub TextRange_CompareEndpoints
|
||||
+@ stub TextRange_ExpandToEnclosingUnit
|
||||
+@ stub TextRange_FindAttribute
|
||||
+@ stub TextRange_FindText
|
||||
+@ stub TextRange_GetAttributeValue
|
||||
+@ stub TextRange_GetBoundingRectangles
|
||||
+@ stub TextRange_GetChildren
|
||||
+@ stub TextRange_GetEnclosingElement
|
||||
+@ stub TextRange_GetText
|
||||
+@ stub TextRange_Move
|
||||
+@ stub TextRange_MoveEndpointByRange
|
||||
+@ stub TextRange_MoveEndpointByUnit
|
||||
+@ stub TextRange_RemoveFromSelection
|
||||
+@ stub TextRange_ScrollIntoView
|
||||
+@ stub TextRange_Select
|
||||
+@ stub TogglePattern_Toggle
|
||||
+@ stub TransformPattern_Move
|
||||
+@ stub TransformPattern_Resize
|
||||
+@ stub TransformPattern_Rotate
|
||||
+@ stub UiaAddEvent
|
||||
+@ stub UiaClientsAreListening
|
||||
@@ -53,14 +53,16 @@
|
||||
@ stub TransformPattern_Rotate
|
||||
@ stub UiaAddEvent
|
||||
@ stdcall UiaClientsAreListening()
|
||||
+@ stub UiaDisconnectAllProviders
|
||||
+@ stub UiaDisconnectProvider
|
||||
+@ stub UiaEventAddWindow
|
||||
+@ stub UiaEventRemoveWindow
|
||||
+@ stub UiaFind
|
||||
+@ stub UiaGetErrorDescription
|
||||
+@ stub UiaGetPatternProvider
|
||||
+@ stub UiaGetPropertyValue
|
||||
@ stub UiaEventAddWindow
|
||||
@ stub UiaEventRemoveWindow
|
||||
@ stub UiaFind
|
||||
@ stub UiaGetErrorDescription
|
||||
@ stub UiaGetPatternProvider
|
||||
@ stub UiaGetPropertyValue
|
||||
-@ stub UiaGetReservedMixedAttributeValue
|
||||
-@ stub UiaGetReservedNotSupportedValue
|
||||
+@ stdcall UiaGetReservedMixedAttributeValue(ptr)
|
||||
+@ stdcall UiaGetReservedNotSupportedValue(ptr)
|
||||
+@ stub UiaGetRootNode
|
||||
+@ stub UiaGetRuntimeId
|
||||
+@ stub UiaGetUpdatedCache
|
||||
+@ stub UiaHPatternObjectFromVariant
|
||||
+@ stub UiaHTextRangeFromVariant
|
||||
+@ stub UiaHUiaNodeFromVariant
|
||||
+@ stub UiaHasServerSideProvider
|
||||
+@ stub UiaHostProviderFromHwnd
|
||||
@ stub UiaGetRootNode
|
||||
@ stub UiaGetRuntimeId
|
||||
@ stub UiaGetUpdatedCache
|
||||
@@ -69,7 +71,8 @@
|
||||
@ stub UiaHUiaNodeFromVariant
|
||||
@ stub UiaHasServerSideProvider
|
||||
@ stub UiaHostProviderFromHwnd
|
||||
-@ stub UiaLookupId
|
||||
+@ stub UiaIAccessibleFromProvider
|
||||
+@ stdcall UiaLookupId(long ptr)
|
||||
+@ stub UiaNavigate
|
||||
+@ stub UiaNodeFromFocus
|
||||
+@ stub UiaNodeFromHandle
|
||||
+@ stub UiaNodeFromPoint
|
||||
+@ stub UiaNodeFromProvider
|
||||
+@ stub UiaNodeRelease
|
||||
+@ stub UiaPatternRelease
|
||||
@ stub UiaNavigate
|
||||
@ stub UiaNodeFromFocus
|
||||
@ stub UiaNodeFromHandle
|
||||
@@ -77,13 +80,16 @@
|
||||
@ stub UiaNodeFromProvider
|
||||
@ stub UiaNodeRelease
|
||||
@ stub UiaPatternRelease
|
||||
+@ stub UiaProviderForNonClient
|
||||
+@ stub UiaProviderFromIAccessible
|
||||
+@ stub UiaRaiseAsyncContentLoadedEvent
|
||||
+@ stub UiaRaiseAutomationEvent
|
||||
+@ stub UiaRaiseAutomationPropertyChangedEvent
|
||||
+@ stub UiaRaiseStructureChangedEvent
|
||||
@ stub UiaRaiseAsyncContentLoadedEvent
|
||||
@ stub UiaRaiseAutomationEvent
|
||||
@ stub UiaRaiseAutomationPropertyChangedEvent
|
||||
@ stub UiaRaiseStructureChangedEvent
|
||||
+@ stub UiaRaiseTextEditTextChangedEvent
|
||||
+@ stub UiaRegisterProviderCallback
|
||||
+@ stub UiaRemoveEvent
|
||||
@ stub UiaRegisterProviderCallback
|
||||
@ stub UiaRemoveEvent
|
||||
-@ stub UiaReturnRawElementProvider
|
||||
+@ stdcall UiaReturnRawElementProvider(long long long ptr)
|
||||
+@ stub UiaSetFocus
|
||||
+@ stub UiaTextRangeRelease
|
||||
+@ stub ValuePattern_SetValue
|
||||
+@ stub VirtualizedItemPattern_Realize
|
||||
+@ stub WindowPattern_Close
|
||||
+@ stub WindowPattern_SetWindowVisualState
|
||||
+@ stub WindowPattern_WaitForInputIdle
|
||||
@ stub UiaSetFocus
|
||||
@ stub UiaTextRangeRelease
|
||||
@ stub ValuePattern_SetValue
|
||||
diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h
|
||||
index 340f500..b9107ce 100644
|
||||
index 340f5005db4..b9107ceb792 100644
|
||||
--- a/include/uiautomationcoreapi.h
|
||||
+++ b/include/uiautomationcoreapi.h
|
||||
@@ -19,6 +19,8 @@
|
||||
@@ -307,5 +229,5 @@ index 340f500..b9107ce 100644
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,43 +0,0 @@
|
||||
From 7b2e5b361ebe380ae671b8f3d2ae4c90167354dc Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 15 Nov 2016 22:00:38 +0100
|
||||
Subject: uiautomationcore: Add stub for UiaClientsAreListening.
|
||||
|
||||
---
|
||||
dlls/uiautomationcore/main.c | 6 ++++++
|
||||
dlls/uiautomationcore/uiautomationcore.spec | 2 +-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/uiautomationcore/main.c b/dlls/uiautomationcore/main.c
|
||||
index 71fe84c..6ea1351 100644
|
||||
--- a/dlls/uiautomationcore/main.c
|
||||
+++ b/dlls/uiautomationcore/main.c
|
||||
@@ -99,6 +99,12 @@ LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wparam, LPARAM lpar
|
||||
return 0;
|
||||
}
|
||||
|
||||
+BOOL WINAPI UiaClientsAreListening(void)
|
||||
+{
|
||||
+ FIXME("(): stub\n");
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
||||
{
|
||||
diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec
|
||||
index 321cd06..221711c 100644
|
||||
--- a/dlls/uiautomationcore/uiautomationcore.spec
|
||||
+++ b/dlls/uiautomationcore/uiautomationcore.spec
|
||||
@@ -52,7 +52,7 @@
|
||||
@ stub TransformPattern_Resize
|
||||
@ stub TransformPattern_Rotate
|
||||
@ stub UiaAddEvent
|
||||
-@ stub UiaClientsAreListening
|
||||
+@ stdcall UiaClientsAreListening()
|
||||
@ stub UiaDisconnectAllProviders
|
||||
@ stub UiaDisconnectProvider
|
||||
@ stub UiaEventAddWindow
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -20,6 +20,5 @@ Fixes: Add kernelbase dll
|
||||
Fixes: Add iertutil dll
|
||||
Fixes: Add shcore dll
|
||||
Fixes: [40451] Add feclient dll
|
||||
Depends: kernel32-GetCurrentPackageFamilyName
|
||||
Depends: combase-RoApi
|
||||
Depends: kernel32-UmsStubs
|
||||
|
@@ -1,18 +1,18 @@
|
||||
From 489a67ec803b382248134be53f3449c206e208ff Mon Sep 17 00:00:00 2001
|
||||
From b05734fe9746e5dbbfcf248b2b892d6e09006956 Mon Sep 17 00:00:00 2001
|
||||
From: Hans Leidekker <hans@codeweavers.com>
|
||||
Date: Mon, 19 Dec 2016 19:38:52 +0100
|
||||
Subject: bcrypt: Add AES provider.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 10 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 347 ++++++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/bcrypt/bcrypt_main.c | 353 ++++++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/bcrypt/tests/bcrypt.c | 18 +--
|
||||
dlls/ncrypt/ncrypt.spec | 10 +-
|
||||
include/bcrypt.h | 3 +
|
||||
5 files changed, 357 insertions(+), 31 deletions(-)
|
||||
5 files changed, 361 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index e299fe0cce8..962953e509b 100644
|
||||
index a1cce4423dc..9ecd21d767c 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -5,15 +5,15 @@
|
||||
@@ -27,7 +27,7 @@ index e299fe0cce8..962953e509b 100644
|
||||
-@ stub BCryptDestroyKey
|
||||
+@ stdcall BCryptDestroyKey(ptr)
|
||||
@ stub BCryptDestroySecret
|
||||
@ stub BCryptDuplicateHash
|
||||
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long)
|
||||
@ stub BCryptDuplicateKey
|
||||
-@ stub BCryptEncrypt
|
||||
+@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long)
|
||||
@@ -53,10 +53,10 @@ index e299fe0cce8..962953e509b 100644
|
||||
@ stub BCryptUnregisterConfigChangeNotify
|
||||
@ stub BCryptUnregisterProvider
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 6023c942e49..5867dbdc3fa 100644
|
||||
index 80d7ddb9466..247b3dc7327 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -49,6 +49,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
@@ -51,6 +51,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
|
||||
static void *libgnutls_handle;
|
||||
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
@@ -67,7 +67,7 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
MAKE_FUNCPTR(gnutls_global_deinit);
|
||||
MAKE_FUNCPTR(gnutls_global_init);
|
||||
MAKE_FUNCPTR(gnutls_global_set_log_function);
|
||||
@@ -84,6 +88,10 @@ static BOOL gnutls_initialize(void)
|
||||
@@ -80,6 +84,10 @@ static BOOL gnutls_initialize(void)
|
||||
goto fail; \
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
LOAD_FUNCPTR(gnutls_global_deinit)
|
||||
LOAD_FUNCPTR(gnutls_global_init)
|
||||
LOAD_FUNCPTR(gnutls_global_set_log_function)
|
||||
@@ -138,6 +146,7 @@ NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount,
|
||||
@@ -128,6 +136,7 @@ NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount,
|
||||
|
||||
#define MAGIC_ALG (('A' << 24) | ('L' << 16) | ('G' << 8) | '0')
|
||||
#define MAGIC_HASH (('H' << 24) | ('A' << 16) | ('S' << 8) | 'H')
|
||||
@@ -86,7 +86,7 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
struct object
|
||||
{
|
||||
ULONG magic;
|
||||
@@ -145,6 +154,7 @@ struct object
|
||||
@@ -135,6 +144,7 @@ struct object
|
||||
|
||||
enum alg_id
|
||||
{
|
||||
@@ -94,15 +94,15 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
ALG_ID_MD5,
|
||||
ALG_ID_RNG,
|
||||
ALG_ID_SHA1,
|
||||
@@ -157,6 +167,7 @@ static const struct {
|
||||
ULONG hash_length;
|
||||
@@ -152,6 +162,7 @@ static const struct {
|
||||
ULONG block_bits;
|
||||
const WCHAR *alg_name;
|
||||
} alg_props[] = {
|
||||
+ /* ALG_ID_AES */ { 0, BCRYPT_AES_ALGORITHM },
|
||||
/* ALG_ID_MD5 */ { 16, BCRYPT_MD5_ALGORITHM },
|
||||
/* ALG_ID_RNG */ { 0, BCRYPT_RNG_ALGORITHM },
|
||||
/* ALG_ID_SHA1 */ { 20, BCRYPT_SHA1_ALGORITHM },
|
||||
@@ -215,11 +226,10 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
|
||||
+ /* ALG_ID_AES */ { 654, 0, 0, BCRYPT_AES_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 },
|
||||
@@ -210,11 +221,10 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
|
||||
|
||||
NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR id, LPCWSTR implementation, DWORD flags )
|
||||
{
|
||||
@@ -115,7 +115,7 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
TRACE( "%p, %s, %s, %08x\n", handle, wine_dbgstr_w(id), wine_dbgstr_w(implementation), flags );
|
||||
|
||||
if (!handle || !id) return STATUS_INVALID_PARAMETER;
|
||||
@@ -229,9 +239,10 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
@@ -224,9 +234,10 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -127,48 +127,36 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
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;
|
||||
@@ -430,7 +441,6 @@ static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
static NTSTATUS hmac_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
{
|
||||
CCHmacFinal( &hash->u.hmac_ctx, output );
|
||||
-
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
#elif defined(HAVE_GNUTLS_HASH)
|
||||
@@ -586,12 +596,19 @@ static NTSTATUS hmac_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN64
|
||||
+#define OBJECT_LENGTH_AES 654
|
||||
+#else
|
||||
+#define OBJECT_LENGTH_AES 618
|
||||
+#endif
|
||||
#define OBJECT_LENGTH_MD5 274
|
||||
#define OBJECT_LENGTH_SHA1 278
|
||||
#define OBJECT_LENGTH_SHA256 286
|
||||
#define OBJECT_LENGTH_SHA384 382
|
||||
#define OBJECT_LENGTH_SHA512 382
|
||||
@@ -388,6 +399,8 @@ struct hash
|
||||
struct hash_impl inner;
|
||||
};
|
||||
|
||||
+#define BLOCK_LENGTH_AES 16
|
||||
+
|
||||
static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size )
|
||||
{
|
||||
if (!strcmpW( prop, BCRYPT_HASH_LENGTH ))
|
||||
@@ -628,6 +645,34 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
|
||||
if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH ))
|
||||
@@ -432,9 +445,43 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
|
||||
NTSTATUS status;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
status = generic_alg_property( id, prop, buf, size, ret_size );
|
||||
- if (status == STATUS_NOT_IMPLEMENTED)
|
||||
- FIXME( "unsupported property %s\n", debugstr_w(prop) );
|
||||
- return status;
|
||||
+ if (status != STATUS_NOT_IMPLEMENTED)
|
||||
+ return status;
|
||||
+
|
||||
+ switch (id)
|
||||
+ {
|
||||
+ case ALG_ID_AES:
|
||||
+ if (!strcmpW( prop, BCRYPT_BLOCK_LENGTH ))
|
||||
+ {
|
||||
+ value = BLOCK_LENGTH_AES;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH ))
|
||||
+ {
|
||||
+ value = OBJECT_LENGTH_AES;
|
||||
+ break;
|
||||
+ *ret_size = sizeof(ULONG);
|
||||
+ if (size < sizeof(ULONG))
|
||||
+ return STATUS_BUFFER_TOO_SMALL;
|
||||
+ if (buf)
|
||||
+ *(ULONG *)buf = BLOCK_LENGTH_AES;
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+ if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
+ {
|
||||
@@ -184,13 +172,18 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
+ return STATUS_BUFFER_TOO_SMALL;
|
||||
+ }
|
||||
+ }
|
||||
+ FIXME( "unsupported aes algorithm property %s\n", debugstr_w(prop) );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+ break;
|
||||
+
|
||||
case ALG_ID_MD5:
|
||||
if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH ))
|
||||
{
|
||||
@@ -731,6 +776,13 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ FIXME( "unsupported property %s\n", debugstr_w(prop) );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static NTSTATUS get_hash_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size )
|
||||
@@ -474,6 +521,13 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +197,7 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE *handle, UCHAR *object, ULONG objectlen,
|
||||
UCHAR *secret, ULONG secretlen, ULONG flags )
|
||||
{
|
||||
@@ -854,6 +906,293 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
|
||||
@@ -632,6 +686,293 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
|
||||
return BCryptDestroyHash( handle );
|
||||
}
|
||||
|
||||
@@ -499,10 +492,10 @@ index 6023c942e49..5867dbdc3fa 100644
|
||||
{
|
||||
switch (reason)
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 422f2cfd340..d2df74ed919 100644
|
||||
index 42312b45b78..4d5891b461b 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -780,7 +780,7 @@ static void test_aes(void)
|
||||
@@ -704,7 +704,7 @@ static void test_aes(void)
|
||||
ULONG size, len;
|
||||
UCHAR mode[64];
|
||||
NTSTATUS ret;
|
||||
@@ -511,7 +504,7 @@ index 422f2cfd340..d2df74ed919 100644
|
||||
alg = NULL;
|
||||
ret = pBCryptOpenAlgorithmProvider(&alg, BCRYPT_AES_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
@@ -814,7 +814,6 @@ todo_wine {
|
||||
@@ -738,7 +738,6 @@ todo_wine {
|
||||
ret = pBCryptCloseAlgorithmProvider(alg, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
}
|
||||
@@ -519,7 +512,7 @@ index 422f2cfd340..d2df74ed919 100644
|
||||
|
||||
static void test_BCryptGenerateSymmetricKey(void)
|
||||
{
|
||||
@@ -833,11 +832,6 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
@@ -757,11 +756,6 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -531,7 +524,7 @@ index 422f2cfd340..d2df74ed919 100644
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
len = size = 0xdeadbeef;
|
||||
@@ -922,11 +916,6 @@ static void test_BCryptEncrypt(void)
|
||||
@@ -846,11 +840,6 @@ static void test_BCryptEncrypt(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -543,7 +536,7 @@ index 422f2cfd340..d2df74ed919 100644
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
len = 0xdeadbeef;
|
||||
@@ -1013,11 +1002,6 @@ static void test_BCryptDecrypt(void)
|
||||
@@ -937,11 +926,6 @@ static void test_BCryptDecrypt(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -556,7 +549,7 @@ index 422f2cfd340..d2df74ed919 100644
|
||||
|
||||
len = 0xdeadbeef;
|
||||
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
|
||||
index 04127608d68..60b7eb37075 100644
|
||||
index 6e871a5d6b8..1a78853bf49 100644
|
||||
--- a/dlls/ncrypt/ncrypt.spec
|
||||
+++ b/dlls/ncrypt/ncrypt.spec
|
||||
@@ -5,17 +5,17 @@
|
||||
@@ -573,7 +566,7 @@ index 04127608d68..60b7eb37075 100644
|
||||
-@ stub BCryptDestroyKey
|
||||
+@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
|
||||
@ stub BCryptDestroySecret
|
||||
@ stub BCryptDuplicateHash
|
||||
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
|
||||
@ stub BCryptDuplicateKey
|
||||
-@ stub BCryptEncrypt
|
||||
+@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
|
||||
|
@@ -1,469 +0,0 @@
|
||||
From f527689b793100c79654ac5d6c1376d128ca3175 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 19 Dec 2016 23:58:52 +0100
|
||||
Subject: bcrypt: Directly implement hmac computation.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 277 +++++++++++++++++-----------------------------
|
||||
1 file changed, 104 insertions(+), 173 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 937bdf7..af2314a 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -60,9 +60,6 @@ MAKE_FUNCPTR(gnutls_global_set_log_level);
|
||||
MAKE_FUNCPTR(gnutls_hash);
|
||||
MAKE_FUNCPTR(gnutls_hash_deinit);
|
||||
MAKE_FUNCPTR(gnutls_hash_init);
|
||||
-MAKE_FUNCPTR(gnutls_hmac);
|
||||
-MAKE_FUNCPTR(gnutls_hmac_deinit);
|
||||
-MAKE_FUNCPTR(gnutls_hmac_init);
|
||||
MAKE_FUNCPTR(gnutls_perror);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
||||
@@ -99,9 +96,6 @@ static BOOL gnutls_initialize(void)
|
||||
LOAD_FUNCPTR(gnutls_hash);
|
||||
LOAD_FUNCPTR(gnutls_hash_deinit);
|
||||
LOAD_FUNCPTR(gnutls_hash_init);
|
||||
- LOAD_FUNCPTR(gnutls_hmac);
|
||||
- LOAD_FUNCPTR(gnutls_hmac_deinit);
|
||||
- LOAD_FUNCPTR(gnutls_hmac_init);
|
||||
LOAD_FUNCPTR(gnutls_perror)
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
@@ -163,6 +157,8 @@ enum alg_id
|
||||
ALG_ID_SHA512
|
||||
};
|
||||
|
||||
+#define MAX_HASH_OUTPUT_BYTES 64
|
||||
+
|
||||
static const struct {
|
||||
ULONG hash_length;
|
||||
const WCHAR *alg_name;
|
||||
@@ -183,6 +179,19 @@ struct algorithm
|
||||
BOOL hmac;
|
||||
};
|
||||
|
||||
+#define MAX_HASH_BLOCK_BITS 1024
|
||||
+
|
||||
+int alg_block_bits[] =
|
||||
+{
|
||||
+ /* ALG_ID_AES */ 0,
|
||||
+ /* ALG_ID_MD5 */ 512,
|
||||
+ /* ALG_ID_RNG */ 0,
|
||||
+ /* ALG_ID_SHA1 */ 512,
|
||||
+ /* ALG_ID_SHA256 */ 512,
|
||||
+ /* ALG_ID_SHA384 */ 1024,
|
||||
+ /* ALG_ID_SHA512 */ 1024
|
||||
+};
|
||||
+
|
||||
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG count, ULONG flags)
|
||||
{
|
||||
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
|
||||
@@ -289,24 +298,20 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *enabled)
|
||||
}
|
||||
|
||||
#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
-struct hash
|
||||
+struct hash_impl
|
||||
{
|
||||
- struct object hdr;
|
||||
- enum alg_id alg_id;
|
||||
- BOOL hmac;
|
||||
union
|
||||
{
|
||||
CC_MD5_CTX md5_ctx;
|
||||
CC_SHA1_CTX sha1_ctx;
|
||||
CC_SHA256_CTX sha256_ctx;
|
||||
CC_SHA512_CTX sha512_ctx;
|
||||
- CCHmacContext hmac_ctx;
|
||||
} u;
|
||||
};
|
||||
|
||||
-static NTSTATUS hash_init( struct hash *hash )
|
||||
+static NTSTATUS hash_init( struct hash_impl *hash, enum alg_id alg_id )
|
||||
{
|
||||
- switch (hash->alg_id)
|
||||
+ switch (alg_id)
|
||||
{
|
||||
case ALG_ID_MD5:
|
||||
CC_MD5_Init( &hash->u.md5_ctx );
|
||||
@@ -329,50 +334,16 @@ static NTSTATUS hash_init( struct hash *hash )
|
||||
break;
|
||||
|
||||
default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
+ ERR( "unhandled id %u\n", alg_id );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_init( struct hash *hash, UCHAR *key, ULONG key_size )
|
||||
+static NTSTATUS hash_update( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *input, ULONG size )
|
||||
{
|
||||
- CCHmacAlgorithm cc_algorithm;
|
||||
- switch (hash->alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- cc_algorithm = kCCHmacAlgMD5;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA1:
|
||||
- cc_algorithm = kCCHmacAlgSHA1;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- cc_algorithm = kCCHmacAlgSHA256;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- cc_algorithm = kCCHmacAlgSHA384;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- cc_algorithm = kCCHmacAlgSHA512;
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
-
|
||||
- CCHmacInit( &hash->u.hmac_ctx, cc_algorithm, key, key_size );
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-static NTSTATUS hash_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
-{
|
||||
- switch (hash->alg_id)
|
||||
+ switch (alg_id)
|
||||
{
|
||||
case ALG_ID_MD5:
|
||||
CC_MD5_Update( &hash->u.md5_ctx, input, size );
|
||||
@@ -395,21 +366,16 @@ static NTSTATUS hash_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
break;
|
||||
|
||||
default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
+ ERR( "unhandled id %u\n", alg_id );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
-{
|
||||
- CCHmacUpdate( &hash->u.hmac_ctx, input, size );
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
+static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *output, ULONG size )
|
||||
{
|
||||
- switch (hash->alg_id)
|
||||
+ switch (alg_id)
|
||||
{
|
||||
case ALG_ID_MD5:
|
||||
CC_MD5_Final( output, &hash->u.md5_ctx );
|
||||
@@ -432,37 +398,25 @@ static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
break;
|
||||
|
||||
default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
+ ERR( "unhandled id %u\n", alg_id );
|
||||
break;
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
-{
|
||||
- CCHmacFinal( &hash->u.hmac_ctx, output );
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
#elif defined(HAVE_GNUTLS_HASH)
|
||||
-struct hash
|
||||
+struct hash_impl
|
||||
{
|
||||
- struct object hdr;
|
||||
- enum alg_id alg_id;
|
||||
- BOOL hmac;
|
||||
- union
|
||||
- {
|
||||
- gnutls_hash_hd_t hash_handle;
|
||||
- gnutls_hmac_hd_t hmac_handle;
|
||||
- } u;
|
||||
+ gnutls_hash_hd_t hash_handle;
|
||||
};
|
||||
|
||||
-static NTSTATUS hash_init( struct hash *hash )
|
||||
+static NTSTATUS hash_init( struct hash_impl *hash, enum alg_id alg_id )
|
||||
{
|
||||
gnutls_digest_algorithm_t alg;
|
||||
|
||||
if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
|
||||
|
||||
- switch (hash->alg_id)
|
||||
+ switch (alg_id)
|
||||
{
|
||||
case ALG_ID_MD5:
|
||||
alg = GNUTLS_DIG_MD5;
|
||||
@@ -484,117 +438,63 @@ static NTSTATUS hash_init( struct hash *hash )
|
||||
break;
|
||||
|
||||
default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
-
|
||||
- if (pgnutls_hash_init( &hash->u.hash_handle, alg )) return STATUS_INTERNAL_ERROR;
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hmac_init( struct hash *hash, UCHAR *key, ULONG key_size )
|
||||
-{
|
||||
- gnutls_mac_algorithm_t alg;
|
||||
-
|
||||
- if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
|
||||
-
|
||||
- switch (hash->alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- alg = GNUTLS_MAC_MD5;
|
||||
- break;
|
||||
- case ALG_ID_SHA1:
|
||||
- alg = GNUTLS_MAC_SHA1;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- alg = GNUTLS_MAC_SHA256;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- alg = GNUTLS_MAC_SHA384;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- alg = GNUTLS_MAC_SHA512;
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", hash->alg_id );
|
||||
+ ERR( "unhandled id %u\n", alg_id );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
- if (pgnutls_hmac_init( &hash->u.hmac_handle, alg, key, key_size )) return STATUS_INTERNAL_ERROR;
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
-{
|
||||
- if (pgnutls_hash( hash->u.hash_handle, input, size )) return STATUS_INTERNAL_ERROR;
|
||||
+ if (pgnutls_hash_init( &hash->hash_handle, alg )) return STATUS_INTERNAL_ERROR;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
+static NTSTATUS hash_update( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *input, ULONG size )
|
||||
{
|
||||
- if (pgnutls_hmac( hash->u.hmac_handle, input, size )) return STATUS_INTERNAL_ERROR;
|
||||
+ if (pgnutls_hash( hash->hash_handle, input, size )) return STATUS_INTERNAL_ERROR;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
+static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *output, ULONG size )
|
||||
{
|
||||
- pgnutls_hash_deinit( hash->u.hash_handle, output );
|
||||
+ pgnutls_hash_deinit( hash->hash_handle, output );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
-{
|
||||
- pgnutls_hmac_deinit( hash->u.hmac_handle, output );
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
#else
|
||||
-struct hash
|
||||
+struct hash_impl
|
||||
{
|
||||
- struct object hdr;
|
||||
- BOOL hmac;
|
||||
- enum alg_id alg_id;
|
||||
-};
|
||||
|
||||
-static NTSTATUS hash_init( struct hash *hash )
|
||||
-{
|
||||
- ERR( "support for hashes not available at build time\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hmac_init( struct hash *hash, UCHAR *key, ULONG key_size )
|
||||
-{
|
||||
- ERR( "support for hashes not available at build time\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
-}
|
||||
+};
|
||||
|
||||
-static NTSTATUS hash_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
+static NTSTATUS hash_init( struct hash_impl *hash, enum alg_id alg_id )
|
||||
{
|
||||
ERR( "support for hashes not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
-static NTSTATUS hmac_update( struct hash *hash, UCHAR *input, ULONG size )
|
||||
+static NTSTATUS hash_update( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *input, ULONG size )
|
||||
{
|
||||
ERR( "support for hashes not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
-static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
+static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
+ UCHAR *output, ULONG size )
|
||||
{
|
||||
ERR( "support for hashes not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
+#endif
|
||||
|
||||
-static NTSTATUS hmac_finish( struct hash *hash, UCHAR *output, ULONG size )
|
||||
+struct hash
|
||||
{
|
||||
- ERR( "support for hashes not available at build time\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
-}
|
||||
-#endif
|
||||
+ struct object hdr;
|
||||
+ enum alg_id alg_id;
|
||||
+ BOOL hmac;
|
||||
+ struct hash_impl outer;
|
||||
+ struct hash_impl inner;
|
||||
+};
|
||||
|
||||
#ifdef _WIN64
|
||||
#define OBJECT_LENGTH_AES 654
|
||||
@@ -787,8 +687,11 @@ NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDL
|
||||
UCHAR *secret, ULONG secretlen, ULONG flags )
|
||||
{
|
||||
struct algorithm *alg = algorithm;
|
||||
+ UCHAR buffer[MAX_HASH_BLOCK_BITS / 8];
|
||||
struct hash *hash;
|
||||
+ int block_bytes;
|
||||
NTSTATUS status;
|
||||
+ int i;
|
||||
|
||||
TRACE( "%p, %p, %p, %u, %p, %u, %08x - stub\n", algorithm, handle, object, objectlen,
|
||||
secret, secretlen, flags );
|
||||
@@ -806,17 +709,45 @@ NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDL
|
||||
hash->alg_id = alg->id;
|
||||
hash->hmac = alg->hmac;
|
||||
|
||||
- if (hash->hmac)
|
||||
+ status = hash_init( &hash->inner, hash->alg_id );
|
||||
+ if (status || !hash->hmac) goto end;
|
||||
+ status = hash_init( &hash->outer, hash->alg_id );
|
||||
+ if (status) goto end;
|
||||
+
|
||||
+ /* reduce key size if too big */
|
||||
+ block_bytes = alg_block_bits[hash->alg_id] / 8;
|
||||
+ if (secretlen > block_bytes)
|
||||
{
|
||||
- status = hmac_init( hash, secret, secretlen );
|
||||
+ struct hash_impl temp;
|
||||
+ status = hash_init( &temp, hash->alg_id );
|
||||
+ if (status) goto end;
|
||||
+ status = hash_update( &temp, hash->alg_id, secret, secretlen );
|
||||
+ if (status) goto end;
|
||||
+ memset( buffer, 0, block_bytes );
|
||||
+ status = hash_finish( &temp, hash->alg_id, buffer, alg_props[hash->alg_id].hash_length );
|
||||
+ if (status) goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
- status = hash_init( hash );
|
||||
+ memset( buffer, 0, block_bytes );
|
||||
+ memcpy( buffer, secret, secretlen );
|
||||
}
|
||||
|
||||
+ /* initialize outer hash */
|
||||
+ for (i = 0; i < block_bytes; i++)
|
||||
+ buffer[i] ^= 0x5c;
|
||||
+ status = hash_update( &hash->outer, hash->alg_id, buffer, block_bytes );
|
||||
+ if (status) goto end;
|
||||
+
|
||||
+ /* initialize inner hash */
|
||||
+ for (i = 0; i < block_bytes; i++)
|
||||
+ buffer[i] ^= (0x5c ^ 0x36);
|
||||
+ status = hash_update( &hash->inner, hash->alg_id, buffer, block_bytes );
|
||||
+
|
||||
+end:
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
+ /* FIXME: call hash_finish to release resources */
|
||||
HeapFree( GetProcessHeap(), 0, hash );
|
||||
return status;
|
||||
}
|
||||
@@ -845,33 +776,33 @@ NTSTATUS WINAPI BCryptHashData( BCRYPT_HASH_HANDLE handle, UCHAR *input, ULONG s
|
||||
if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
|
||||
if (!input) return STATUS_SUCCESS;
|
||||
|
||||
- if (hash->hmac)
|
||||
- {
|
||||
- return hmac_update( hash, input, size );
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return hash_update( hash, input, size );
|
||||
- }
|
||||
+ return hash_update( &hash->inner, hash->alg_id, input, size );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI BCryptFinishHash( BCRYPT_HASH_HANDLE handle, UCHAR *output, ULONG size, ULONG flags )
|
||||
{
|
||||
+ UCHAR buffer[MAX_HASH_OUTPUT_BYTES];
|
||||
struct hash *hash = handle;
|
||||
+ NTSTATUS status;
|
||||
+ int hash_size;
|
||||
|
||||
TRACE( "%p, %p, %u, %08x\n", handle, output, size, flags );
|
||||
|
||||
if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
|
||||
if (!output) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
- if (hash->hmac)
|
||||
- {
|
||||
- return hmac_finish( hash, output, size );
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return hash_finish( hash, output, size );
|
||||
- }
|
||||
+ if (!hash->hmac)
|
||||
+ return hash_finish( &hash->inner, hash->alg_id, output, size );
|
||||
+
|
||||
+ hash_size = alg_props[hash->alg_id].hash_length;
|
||||
+
|
||||
+ status = hash_finish( &hash->inner, hash->alg_id, buffer, hash_size);
|
||||
+ if (status) return status;
|
||||
+
|
||||
+ status = hash_update( &hash->outer, hash->alg_id, buffer, hash_size);
|
||||
+ if (status) return status;
|
||||
+
|
||||
+ return hash_finish( &hash->outer, hash->alg_id, output, size);
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG secretlen,
|
||||
--
|
||||
2.9.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,216 +0,0 @@
|
||||
From ae04ece5f64a29a67e187d5aa32c6b8d3e399d61 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 20 Dec 2016 02:39:26 +0100
|
||||
Subject: bcrypt: Use hash fallback implementation as default and remove gnutls
|
||||
/ commoncrypto hash implemetation.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 171 ----------------------------------------------
|
||||
1 file changed, 171 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 9441cf0..3e2b22d 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -59,9 +59,6 @@ MAKE_FUNCPTR(gnutls_global_deinit);
|
||||
MAKE_FUNCPTR(gnutls_global_init);
|
||||
MAKE_FUNCPTR(gnutls_global_set_log_function);
|
||||
MAKE_FUNCPTR(gnutls_global_set_log_level);
|
||||
-MAKE_FUNCPTR(gnutls_hash);
|
||||
-MAKE_FUNCPTR(gnutls_hash_deinit);
|
||||
-MAKE_FUNCPTR(gnutls_hash_init);
|
||||
MAKE_FUNCPTR(gnutls_perror);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
||||
@@ -95,9 +92,6 @@ static BOOL gnutls_initialize(void)
|
||||
LOAD_FUNCPTR(gnutls_global_init)
|
||||
LOAD_FUNCPTR(gnutls_global_set_log_function)
|
||||
LOAD_FUNCPTR(gnutls_global_set_log_level)
|
||||
- LOAD_FUNCPTR(gnutls_hash);
|
||||
- LOAD_FUNCPTR(gnutls_hash_deinit);
|
||||
- LOAD_FUNCPTR(gnutls_hash_init);
|
||||
LOAD_FUNCPTR(gnutls_perror)
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
@@ -299,170 +293,6 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *enabled)
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
-struct hash_impl
|
||||
-{
|
||||
- union
|
||||
- {
|
||||
- CC_MD5_CTX md5_ctx;
|
||||
- CC_SHA1_CTX sha1_ctx;
|
||||
- CC_SHA256_CTX sha256_ctx;
|
||||
- CC_SHA512_CTX sha512_ctx;
|
||||
- } u;
|
||||
-};
|
||||
-
|
||||
-static NTSTATUS hash_init( struct hash_impl *hash, enum alg_id alg_id )
|
||||
-{
|
||||
- switch (alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- CC_MD5_Init( &hash->u.md5_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA1:
|
||||
- CC_SHA1_Init( &hash->u.sha1_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- CC_SHA256_Init( &hash->u.sha256_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- CC_SHA384_Init( &hash->u.sha512_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- CC_SHA512_Init( &hash->u.sha512_ctx );
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", alg_id );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_update( struct hash_impl *hash, enum alg_id alg_id,
|
||||
- UCHAR *input, ULONG size )
|
||||
-{
|
||||
- switch (alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- CC_MD5_Update( &hash->u.md5_ctx, input, size );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA1:
|
||||
- CC_SHA1_Update( &hash->u.sha1_ctx, input, size );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- CC_SHA256_Update( &hash->u.sha256_ctx, input, size );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- CC_SHA384_Update( &hash->u.sha512_ctx, input, size );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- CC_SHA512_Update( &hash->u.sha512_ctx, input, size );
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", alg_id );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
- UCHAR *output, ULONG size )
|
||||
-{
|
||||
- switch (alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- CC_MD5_Final( output, &hash->u.md5_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA1:
|
||||
- CC_SHA1_Final( output, &hash->u.sha1_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- CC_SHA256_Final( output, &hash->u.sha256_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- CC_SHA384_Final( output, &hash->u.sha512_ctx );
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- CC_SHA512_Final( output, &hash->u.sha512_ctx );
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", alg_id );
|
||||
- break;
|
||||
- }
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-#elif defined(HAVE_GNUTLS_HASH)
|
||||
-struct hash_impl
|
||||
-{
|
||||
- gnutls_hash_hd_t hash_handle;
|
||||
-};
|
||||
-
|
||||
-static NTSTATUS hash_init( struct hash_impl *hash, enum alg_id alg_id )
|
||||
-{
|
||||
- gnutls_digest_algorithm_t alg;
|
||||
-
|
||||
- if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
|
||||
-
|
||||
- switch (alg_id)
|
||||
- {
|
||||
- case ALG_ID_MD5:
|
||||
- alg = GNUTLS_DIG_MD5;
|
||||
- break;
|
||||
- case ALG_ID_SHA1:
|
||||
- alg = GNUTLS_DIG_SHA1;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA256:
|
||||
- alg = GNUTLS_DIG_SHA256;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA384:
|
||||
- alg = GNUTLS_DIG_SHA384;
|
||||
- break;
|
||||
-
|
||||
- case ALG_ID_SHA512:
|
||||
- alg = GNUTLS_DIG_SHA512;
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- ERR( "unhandled id %u\n", alg_id );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
-
|
||||
- if (pgnutls_hash_init( &hash->hash_handle, alg )) return STATUS_INTERNAL_ERROR;
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_update( struct hash_impl *hash, enum alg_id alg_id,
|
||||
- UCHAR *input, ULONG size )
|
||||
-{
|
||||
- if (pgnutls_hash( hash->hash_handle, input, size )) return STATUS_INTERNAL_ERROR;
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
- UCHAR *output, ULONG size )
|
||||
-{
|
||||
- pgnutls_hash_deinit( hash->hash_handle, output );
|
||||
- return STATUS_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-#else
|
||||
struct hash_impl
|
||||
{
|
||||
union
|
||||
@@ -572,7 +402,6 @@ static NTSTATUS hash_finish( struct hash_impl *hash, enum alg_id alg_id,
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
-#endif
|
||||
|
||||
struct hash
|
||||
{
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,70 +0,0 @@
|
||||
From 3dc21336baced97a110773ac9e72db210a56af82 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 20 Dec 2016 03:59:19 +0100
|
||||
Subject: bcrypt: Implement BCryptDuplicateHash.
|
||||
|
||||
FIXME: Should we check for NULL pointers?
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 2 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 18 ++++++++++++++++++
|
||||
dlls/ncrypt/ncrypt.spec | 2 +-
|
||||
3 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index 962953e509b..9ecd21d767c 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -11,7 +11,7 @@
|
||||
@ stdcall BCryptDestroyHash(ptr)
|
||||
@ stdcall BCryptDestroyKey(ptr)
|
||||
@ stub BCryptDestroySecret
|
||||
-@ stub BCryptDuplicateHash
|
||||
+@ stdcall BCryptDuplicateHash(ptr ptr ptr long long)
|
||||
@ stub BCryptDuplicateKey
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long)
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 4f09948096c..3eb0135b37c 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -672,6 +672,24 @@ end:
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+NTSTATUS WINAPI BCryptDuplicateHash( BCRYPT_HASH_HANDLE handle, BCRYPT_HASH_HANDLE *handle_copy,
|
||||
+ UCHAR *object, ULONG object_count, ULONG flags )
|
||||
+{
|
||||
+ struct hash *hash_orig = handle;
|
||||
+ struct hash *hash_copy;
|
||||
+
|
||||
+ TRACE( "%p, %p, %p, %u, %u\n", handle, handle_copy, object, object_count, flags );
|
||||
+
|
||||
+ if (!hash_orig || hash_orig->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
|
||||
+ if (!(hash_copy = HeapAlloc( GetProcessHeap(), 0, sizeof(*hash_copy) )))
|
||||
+ return STATUS_NO_MEMORY;
|
||||
+
|
||||
+ memcpy( hash_copy, hash_orig, sizeof(*hash_orig) );
|
||||
+
|
||||
+ *handle_copy = hash_copy;
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
+
|
||||
NTSTATUS WINAPI BCryptDestroyHash( BCRYPT_HASH_HANDLE handle )
|
||||
{
|
||||
struct hash *hash = handle;
|
||||
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
|
||||
index 60b7eb37075..1a78853bf49 100644
|
||||
--- a/dlls/ncrypt/ncrypt.spec
|
||||
+++ b/dlls/ncrypt/ncrypt.spec
|
||||
@@ -13,7 +13,7 @@
|
||||
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
|
||||
@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
|
||||
@ stub BCryptDestroySecret
|
||||
-@ stub BCryptDuplicateHash
|
||||
+@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
|
||||
@ stub BCryptDuplicateKey
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -1,83 +0,0 @@
|
||||
From 873d431347aa25effc70e47566e562c122a5edc8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 04:23:31 +0100
|
||||
Subject: bcrypt: Handle NULL pointers in BCryptDuplicateHash and add tests.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 1 +
|
||||
dlls/bcrypt/tests/bcrypt.c | 26 +++++++++++++++++++++++++-
|
||||
2 files changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index a9006a4..d1516cc 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -681,6 +681,7 @@ NTSTATUS WINAPI BCryptDuplicateHash( BCRYPT_HASH_HANDLE handle, BCRYPT_HASH_HAND
|
||||
TRACE( "%p, %p, %p, %u, %u\n", handle, handle_copy, object, object_count, flags );
|
||||
|
||||
if (!hash_orig || hash_orig->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
|
||||
+ if (!handle_copy) return STATUS_INVALID_PARAMETER;
|
||||
if (!(hash_copy = HeapAlloc( GetProcessHeap(), 0, sizeof(*hash_copy) )))
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 997b298..bfe3a7e 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -33,6 +33,7 @@ static NTSTATUS (WINAPI *pBCryptCreateHash)(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDL
|
||||
ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHash)(BCRYPT_ALG_HANDLE, UCHAR *, ULONG, UCHAR *, ULONG, UCHAR *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHashData)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
+static NTSTATUS (WINAPI *pBCryptDuplicateHash)(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptFinishHash)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDestroyHash)(BCRYPT_HASH_HANDLE);
|
||||
static NTSTATUS (WINAPI *pBCryptGenRandom)(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
@@ -173,7 +174,7 @@ static void test_sha1(void)
|
||||
static const char expected[] = "961fa64958818f767707072755d7018dcd278e94";
|
||||
static const char expected_hmac[] = "2472cf65d0e090618d769d3e46f0d9446cf212da";
|
||||
BCRYPT_ALG_HANDLE alg;
|
||||
- BCRYPT_HASH_HANDLE hash;
|
||||
+ BCRYPT_HASH_HANDLE hash, hash2;
|
||||
UCHAR buf[512], buf_hmac[1024], sha1[20], sha1_hmac[20];
|
||||
ULONG size, len;
|
||||
char str[41];
|
||||
@@ -260,6 +261,28 @@ static void test_sha1(void)
|
||||
test_hash_length(hash, 20);
|
||||
test_alg_name(hash, "SHA1");
|
||||
|
||||
+ ret = pBCryptDuplicateHash(NULL, &hash2, NULL, 0, 0);
|
||||
+ ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
|
||||
+
|
||||
+ ret = pBCryptDuplicateHash(hash, NULL, NULL, 0, 0);
|
||||
+ ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
|
||||
+
|
||||
+ hash2 = (void *)0xdeadbeef;
|
||||
+ ret = pBCryptDuplicateHash(hash, &hash2, NULL, 0, 0);
|
||||
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* < Win 7 */, "got %08x\n", ret);
|
||||
+
|
||||
+ if (ret == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ memset(sha1_hmac, 0, sizeof(sha1_hmac));
|
||||
+ ret = pBCryptFinishHash(hash2, sha1_hmac, sizeof(sha1_hmac), 0);
|
||||
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
+ format_hash( sha1_hmac, sizeof(sha1_hmac), str );
|
||||
+ ok(!strcmp(str, expected_hmac), "got %s\n", str);
|
||||
+
|
||||
+ ret = pBCryptDestroyHash(hash2);
|
||||
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
+ }
|
||||
+
|
||||
memset(sha1_hmac, 0, sizeof(sha1_hmac));
|
||||
ret = pBCryptFinishHash(hash, sha1_hmac, sizeof(sha1_hmac), 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
@@ -1179,6 +1202,7 @@ START_TEST(bcrypt)
|
||||
pBCryptCreateHash = (void *)GetProcAddress(module, "BCryptCreateHash");
|
||||
pBCryptHash = (void *)GetProcAddress(module, "BCryptHash");
|
||||
pBCryptHashData = (void *)GetProcAddress(module, "BCryptHashData");
|
||||
+ pBCryptDuplicateHash = (void *)GetProcAddress(module, "BCryptDuplicateHash");
|
||||
pBCryptFinishHash = (void *)GetProcAddress(module, "BCryptFinishHash");
|
||||
pBCryptDestroyHash = (void *)GetProcAddress(module, "BCryptDestroyHash");
|
||||
pBCryptGenRandom = (void *)GetProcAddress(module, "BCryptGenRandom");
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 9f68ea60cf840c9366aefe1ab486e9d1ee192843 Mon Sep 17 00:00:00 2001
|
||||
From a93745453350f9eabcab0f49528c3f027a303c24 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.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 32 ++++++++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
dlls/bcrypt/bcrypt_main.c | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index d1516cc..8a5161b 100644
|
||||
index d0a1b074b50..deab6f28bd9 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -450,16 +450,16 @@ static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *
|
||||
@@ -440,15 +440,15 @@ static NTSTATUS generic_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ index d1516cc..8a5161b 100644
|
||||
+static NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size )
|
||||
{
|
||||
NTSTATUS status;
|
||||
ULONG value;
|
||||
|
||||
- status = generic_alg_property( id, prop, buf, size, ret_size );
|
||||
+ status = generic_alg_property( alg->id, prop, buf, size, ret_size );
|
||||
@@ -31,17 +30,8 @@ index d1516cc..8a5161b 100644
|
||||
{
|
||||
case ALG_ID_AES:
|
||||
if (!strcmpW( prop, BCRYPT_BLOCK_LENGTH ))
|
||||
@@ -540,7 +540,7 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
|
||||
default:
|
||||
- FIXME( "unsupported algorithm %u\n", id );
|
||||
+ FIXME( "unsupported algorithm %u\n", alg->id );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -555,11 +555,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
|
||||
return STATUS_SUCCESS;
|
||||
@@ -484,11 +484,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
-static NTSTATUS get_hash_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size )
|
||||
@@ -54,7 +44,7 @@ index d1516cc..8a5161b 100644
|
||||
if (status == STATUS_NOT_IMPLEMENTED)
|
||||
FIXME( "unsupported property %s\n", debugstr_w(prop) );
|
||||
return status;
|
||||
@@ -579,12 +579,12 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
@@ -508,12 +508,12 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
case MAGIC_ALG:
|
||||
{
|
||||
const struct algorithm *alg = (const struct algorithm *)object;
|
||||
@@ -69,7 +59,7 @@ index d1516cc..8a5161b 100644
|
||||
}
|
||||
default:
|
||||
WARN( "unknown magic %08x\n", object->magic );
|
||||
@@ -783,34 +783,34 @@ struct key
|
||||
@@ -697,34 +697,34 @@ struct key
|
||||
ULONG secret_len;
|
||||
};
|
||||
|
||||
@@ -110,7 +100,7 @@ index d1516cc..8a5161b 100644
|
||||
key->handle = 0; /* initialized on first use */
|
||||
key->secret = buffer;
|
||||
key->secret_len = secret_len;
|
||||
@@ -906,7 +906,7 @@ struct key
|
||||
@@ -820,7 +820,7 @@ struct key
|
||||
ULONG block_size;
|
||||
};
|
||||
|
||||
@@ -119,7 +109,7 @@ index d1516cc..8a5161b 100644
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
@@ -955,7 +955,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
|
||||
@@ -869,7 +869,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;
|
||||
|
||||
@@ -129,5 +119,5 @@ index d1516cc..8a5161b 100644
|
||||
HeapFree( GetProcessHeap(), 0, key );
|
||||
return status;
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 5313398cdabe97a17b21e2d9f25a191da7bd9434 Mon Sep 17 00:00:00 2001
|
||||
From 2f57d906c55bdc99f476b6547f67d864e7210f16 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 06:08:33 +0100
|
||||
Subject: bcrypt: Implement BCryptSetProperty for algorithms.
|
||||
@@ -9,7 +9,7 @@ Subject: bcrypt: Implement BCryptSetProperty for algorithms.
|
||||
2 files changed, 67 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 8a5161b..4757878 100644
|
||||
index deab6f28bd9..595d36d7dbe 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -153,6 +153,12 @@ enum alg_id
|
||||
@@ -23,9 +23,9 @@ index 8a5161b..4757878 100644
|
||||
+};
|
||||
+
|
||||
#define MAX_HASH_OUTPUT_BYTES 64
|
||||
#define MAX_HASH_BLOCK_BITS 1024
|
||||
|
||||
static const struct {
|
||||
@@ -172,6 +178,7 @@ struct algorithm
|
||||
@@ -175,6 +181,7 @@ struct algorithm
|
||||
{
|
||||
struct object hdr;
|
||||
enum alg_id id;
|
||||
@@ -33,7 +33,7 @@ index 8a5161b..4757878 100644
|
||||
BOOL hmac;
|
||||
};
|
||||
|
||||
@@ -265,6 +272,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
@@ -255,6 +262,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
if (!(alg = HeapAlloc( GetProcessHeap(), 0, sizeof(*alg) ))) return STATUS_NO_MEMORY;
|
||||
alg->hdr.magic = MAGIC_ALG;
|
||||
alg->id = alg_id;
|
||||
@@ -41,8 +41,8 @@ index 8a5161b..4757878 100644
|
||||
alg->hmac = flags & BCRYPT_ALG_HANDLE_HMAC_FLAG;
|
||||
|
||||
*handle = alg;
|
||||
@@ -555,6 +563,40 @@ static NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop
|
||||
return STATUS_SUCCESS;
|
||||
@@ -484,6 +492,40 @@ static NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS set_alg_property( struct algorithm *alg, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
|
||||
@@ -82,7 +82,7 @@ index 8a5161b..4757878 100644
|
||||
static NTSTATUS get_hash_property( const struct hash *hash, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size )
|
||||
{
|
||||
NTSTATUS status;
|
||||
@@ -595,8 +637,28 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
@@ -524,8 +566,28 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
|
||||
NTSTATUS WINAPI BCryptSetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHAR *value,
|
||||
ULONG size, ULONG flags )
|
||||
{
|
||||
@@ -114,10 +114,10 @@ index 8a5161b..4757878 100644
|
||||
|
||||
NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE *handle, UCHAR *object, ULONG objectlen,
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 699a995..d850738 100644
|
||||
index abf59c8404d..08a83aaf7a5 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -889,7 +889,7 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
@@ -776,7 +776,7 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
|
||||
ret = pBCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
|
||||
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
|
||||
@@ -126,7 +126,7 @@ index 699a995..d850738 100644
|
||||
|
||||
size = 0xdeadbeef;
|
||||
ret = pBCryptEncrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0);
|
||||
@@ -1078,7 +1078,7 @@ static void test_BCryptEncrypt(void)
|
||||
@@ -965,7 +965,7 @@ static void test_BCryptEncrypt(void)
|
||||
todo_wine ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
|
||||
|
||||
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM), 0);
|
||||
@@ -135,7 +135,7 @@ index 699a995..d850738 100644
|
||||
|
||||
size = 0;
|
||||
ret = BCryptGetProperty(aes, BCRYPT_AUTH_TAG_LENGTH, NULL, 0, &size, 0);
|
||||
@@ -1306,7 +1306,7 @@ static void test_BCryptDecrypt(void)
|
||||
@@ -1193,7 +1193,7 @@ static void test_BCryptDecrypt(void)
|
||||
******************/
|
||||
|
||||
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM), 0);
|
||||
@@ -145,5 +145,5 @@ index 699a995..d850738 100644
|
||||
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
||||
ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From f7749755c11e54d1e75cd05b6656d2c474ade8ae Mon Sep 17 00:00:00 2001
|
||||
From 6de382845ffbb12d514a0ece9483a72b34df852e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 06:46:11 +0100
|
||||
Subject: bcrypt: Implement BCryptGetProperty for BCRYPT_CHAINING_MODE.
|
||||
@@ -9,10 +9,10 @@ Subject: bcrypt: Implement BCryptGetProperty for BCRYPT_CHAINING_MODE.
|
||||
2 files changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 4757878..24dee8b 100644
|
||||
index 595d36d7dbe..3ab80a1a31a 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -482,17 +482,18 @@ static NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop
|
||||
@@ -470,17 +470,18 @@ static NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop
|
||||
}
|
||||
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
{
|
||||
@@ -38,13 +38,13 @@ index 4757878..24dee8b 100644
|
||||
+ memcpy( buf, mode, (strlenW(mode) + 1) * sizeof(WCHAR) );
|
||||
+ return STATUS_SUCCESS;
|
||||
}
|
||||
FIXME( "unsupported aes algorithm property %s\n", debugstr_w(prop) );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
break;
|
||||
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index d850738..bbf18c4 100644
|
||||
index 08a83aaf7a5..1a5523726dd 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -842,7 +842,7 @@ static void test_aes(void)
|
||||
@@ -729,7 +729,7 @@ static void test_aes(void)
|
||||
|
||||
size = 0;
|
||||
ret = pBCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode) - 1, &size, 0);
|
||||
@@ -54,5 +54,5 @@ index d850738..bbf18c4 100644
|
||||
|
||||
size = 0;
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user