Compare commits

...

47 Commits

Author SHA1 Message Date
Sebastian Lackner
d184fa7831 Release 2.0-rc3. 2016-12-26 22:16:58 +01:00
Sebastian Lackner
ffccd4f5dd Added patch to ignore externally set DC state in gdiplus. 2016-12-26 17:43:42 +01:00
Sebastian Lackner
08fc972c37 uxtheme-CloseThemeClass: Fix reference to bug report. 2016-12-26 17:35:52 +01:00
Sebastian Lackner
dc7f74f24f Added patch to create ProxyEnable key on wineprefix update. 2016-12-26 17:15:36 +01:00
Sebastian Lackner
b372d532ca dxva2-Video_Decoder: Fix compile warning when compiling without libva support. 2016-12-26 16:37:54 +01:00
Sebastian Lackner
8db21bfce6 bcrypt-Improvements: Update patchset and implement support for AES GCM. 2016-12-26 16:23:51 +01:00
Sebastian Lackner
84b08ebde9 Rebase against 1bcd38f788bb5165cc65a830ea912ff4eda50b84. 2016-12-23 04:04:54 +01:00
Sebastian Lackner
e05b5bf8d5 Release 2.0-rc2. 2016-12-21 06:27:01 +01:00
Sebastian Lackner
b95d6468de bcrypt-Improvements: Added patches to fix handling of padding. 2016-12-21 05:16:23 +01:00
Sebastian Lackner
533032bd79 Added patch to implement advapi32.AddMandatoryAce. 2016-12-21 03:47:27 +01:00
Sebastian Lackner
8f67fbfbc3 Added patch to improve TIFF support in windowscodecs.dll. 2016-12-21 02:52:59 +01:00
Sebastian Lackner
846b6ab6b9 Added patch to fix groupbox rectangle calculation and font handling. 2016-12-21 01:34:53 +01:00
Sebastian Lackner
760b632ad6 Added patch to silence FIXME in RtlCaptureStackBackTrace stub function. 2016-12-21 01:13:23 +01:00
Sebastian Lackner
76b0d7c498 Added patch to fix handling of Accept headers in winhttp. 2016-12-21 01:02:00 +01:00
Sebastian Lackner
a6476a7726 msvideo.dll16-DrawDibProfileDisplay: Add reference to bug report. 2016-12-21 00:31:03 +01:00
Sebastian Lackner
2039446ec5 Added patch to accept DISP_E_PARAMNOTFOUND for missing optional param in typelib implementation. 2016-12-21 00:28:39 +01:00
Sebastian Lackner
19e7aeae51 Added patch to protect CloseThemeData from invalid input. 2016-12-20 23:39:26 +01:00
Sebastian Lackner
1740d793d8 Added patchset with various BCrypt improvements. 2016-12-20 22:36:51 +01:00
Sebastian Lackner
e4679ff7ce Added patch to assigns the AC abbreviation to WinBuiltinAnyPackageSid. 2016-12-19 23:32:43 +01:00
Sebastian Lackner
4a70aa313d Added patch to move the auto radio button group logic from BM_SETCHECK to WM_LBUTTONUP handler. 2016-12-19 23:14:53 +01:00
Sebastian Lackner
72d96cb61f Rebase against 56040acaa3f584150b3ab7fc644cd1a81e34fece. 2016-12-17 18:41:09 +01:00
Sebastian Lackner
1117c77d17 Release 2.0-rc1. 2016-12-15 13:52:48 +01:00
Sebastian Lackner
4c4573beff kernel32-UmsStubs: Fix build failure with old versions of GCC. 2016-12-15 07:29:25 +01:00
Sebastian Lackner
0006045c66 wined3d-CSMT_Main: Added patch to fix occlusion query tests. 2016-12-15 05:21:57 +01:00
Sebastian Lackner
56ed08d2e1 wined3d-CSMT_Main: Reenable CSMT patchset. 2016-12-15 03:12:51 +01:00
Sebastian Lackner
206ef39564 Added patch to avoid forcing a combobox repaint on WM_SIZE. 2016-12-12 06:57:32 +01:00
Sebastian Lackner
aeb8488db7 ole32-HGLOBALStream: Add reference to bug report. 2016-12-12 06:08:19 +01:00
Sebastian Lackner
a0e9a41f77 windowscodecs-Palette_Images: Fix a typo (thanks Dmitry Timoshkov). 2016-12-12 06:05:41 +01:00
Sebastian Lackner
7b0d1a2905 windowscodecs-GIF_Encoder: Fix a typo (thanks Dmitry Timoshkov). 2016-12-12 05:12:40 +01:00
Sebastian Lackner
6f120f6a56 Rebase against 4c7f3f8af856888f5ab020b2a32d0b01db0c82f7. 2016-12-12 04:28:52 +01:00
Sebastian Lackner
0d616d719e Rebase against 705c52691a4e8c6224cda5080fb88f257de5fd77. 2016-12-06 21:58:08 +01:00
Sebastian Lackner
5403b21e6a Release 1.9.23. 2016-11-16 06:25:59 +01:00
Sebastian Lackner
c6801a1585 include-Duplicate_Typedef: Ensure winsock2.h is always included first. 2016-11-16 02:49:35 +01:00
Sebastian Lackner
5b403d94e2 Added patch to fix root certificate check in CERT_CHAIN_REVOCATION_CHECK_CHAIN. 2016-11-16 00:07:53 +01:00
Sebastian Lackner
dcc28e042c wined3d-CSMT_Helper: Reenable patchset. 2016-11-15 22:32:47 +01:00
Sebastian Lackner
93ef3b46c8 Added patch to add stub for UiaClientsAreListening. 2016-11-15 22:01:35 +01:00
Sebastian Lackner
2d0f81b3f6 Added patch to implement D3DXComputeTangent. 2016-11-15 21:55:42 +01:00
Sebastian Lackner
7234a34ea2 Added patch to fix MoveFile with source == dest. 2016-11-15 21:40:30 +01:00
Sebastian Lackner
a3fc9d953a Added patch to fix compile error when SOCKADDR is redefined. 2016-11-15 20:05:41 +01:00
Sebastian Lackner
a43657f683 Added patch to set stream to NULL if AVIFileGetStream fails with an error. 2016-11-15 17:07:31 +01:00
Sebastian Lackner
ce0c9566c9 Added patch for arguments check in LoadTypeLibEx. 2016-11-15 17:02:55 +01:00
Sebastian Lackner
fb62a188f4 Added patch to fix a typo in 2bppIndexed to 32bppBGRA conversion routine. 2016-11-15 16:57:53 +01:00
Sebastian Lackner
39bf451aea Compiler_Warnings: Remove no longer needed patch. 2016-11-15 16:53:30 +01:00
Sebastian Lackner
f6177b7d07 openal32-EFX_Extension: Remove patchset. 2016-11-15 16:35:46 +01:00
Sebastian Lackner
4b12b109c4 windowscodecs-GIF_Encoder: Update patchset. 2016-11-15 16:34:07 +01:00
Sebastian Lackner
30ac478614 Rebase against 02d723045ff15d2bda5475b8b6fe212ee3483cd8. 2016-11-14 07:57:06 +01:00
Sebastian Lackner
e3182b014c Rebase against f7187ecbd62f778649e055af61cd2c6786ead7f1. 2016-11-13 20:36:59 +01:00
292 changed files with 11326 additions and 2882 deletions

View File

@@ -1,25 +0,0 @@
From 1d2744df97beb00c40ae4c9d307334f4fe0c253d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 31 Jul 2016 00:01:52 +0200
Subject: include: Avoid shift overflow warning.
---
include/d3dtypes.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/d3dtypes.h b/include/d3dtypes.h
index 75aee55..8a884a8 100644
--- a/include/d3dtypes.h
+++ b/include/d3dtypes.h
@@ -53,7 +53,7 @@ typedef LONG D3DFIXED;
#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
#define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
-#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
+#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
#define D3DRGB(r, g, b) \
(0xff000000 | ( ((LONG)((r) * 255)) << 16) | (((LONG)((g) * 255)) << 8) | (LONG)((b) * 255))
--
2.9.0

View File

@@ -1,17 +1,40 @@
From 869fbc7190eb77e027be4bcd98d938198189c3dd Mon Sep 17 00:00:00 2001
From 744549e1ecc76c3764079d337c09445d01a3527e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 22 Mar 2016 21:58:40 +0100
Subject: dwrite: Avoid implicit cast of interface pointer.
---
dlls/dwrite/font.c | 4 ++--
dlls/dwrite/layout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index d9ddce0..0a90c20 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1684,7 +1684,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontVtbl*)&dwritefontvtbl);
- return CONTAINING_RECORD(iface, struct dwrite_font, IDWriteFont3_iface);
+ return CONTAINING_RECORD((IDWriteFont3 *)iface, struct dwrite_font, IDWriteFont3_iface);
}
static struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
@@ -1692,7 +1692,7 @@ static struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontFaceVtbl*)&dwritefontfacevtbl);
- return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace4_iface);
+ return CONTAINING_RECORD((IDWriteFontFace4 *)iface, struct dwrite_fontface, IDWriteFontFace4_iface);
}
void get_logfont_from_font(IDWriteFont *iface, LOGFONTW *lf)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 38b5e32..24f4abc 100644
index 706ed4e..c76a909 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -5115,7 +5115,7 @@ static const IDWriteTextFormat2Vtbl dwritetextformatvtbl = {
@@ -5196,7 +5196,7 @@ static const IDWriteTextFormat2Vtbl dwritetextformatvtbl = {
static struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
{
return (iface->lpVtbl == (IDWriteTextFormatVtbl*)&dwritetextformatvtbl) ?
@@ -21,5 +44,5 @@ index 38b5e32..24f4abc 100644
HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style,
--
2.7.1
2.9.0

View File

@@ -0,0 +1,185 @@
From 9904ee15d00d0809c12759446c09adc1981e3cf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 29 Aug 2016 19:45:47 +0200
Subject: advapi32: Implement AddMandatoryAce.
---
dlls/advapi32/security.c | 6 ++++--
dlls/advapi32/tests/security.c | 45 ++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/ntdll.spec | 1 +
dlls/ntdll/sec.c | 25 +++++++++++++++++++++++
include/winbase.h | 1 +
include/winternl.h | 1 +
6 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 28331df..45c0f7e 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -1711,10 +1711,12 @@ BOOL WINAPI AddAce(
return set_ntstatus(RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength));
}
+/******************************************************************************
+ * AddMandatoryAce [ADVAPI32.@]
+ */
BOOL WINAPI AddMandatoryAce(ACL *acl, DWORD ace_revision, DWORD ace_flags, DWORD mandatory_policy, PSID label_sid)
{
- FIXME("%p %x %x %x %p - stub\n", acl, ace_revision, ace_flags, mandatory_policy, label_sid);
- return FALSE;
+ return set_ntstatus(RtlAddMandatoryAce(acl, ace_revision, ace_flags, mandatory_policy, SYSTEM_MANDATORY_LABEL_ACE_TYPE, label_sid));
}
/******************************************************************************
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 18f4e04..cdbe4f8 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -65,6 +65,7 @@
static BOOL (WINAPI *pAddAccessAllowedAceEx)(PACL, DWORD, DWORD, DWORD, PSID);
static BOOL (WINAPI *pAddAccessDeniedAceEx)(PACL, DWORD, DWORD, DWORD, PSID);
static BOOL (WINAPI *pAddAuditAccessAceEx)(PACL, DWORD, DWORD, DWORD, PSID, BOOL, BOOL);
+static BOOL (WINAPI *pAddMandatoryAce)(PACL,DWORD,DWORD,DWORD,PSID);
static VOID (WINAPI *pBuildTrusteeWithSidA)( PTRUSTEEA pTrustee, PSID pSid );
static VOID (WINAPI *pBuildTrusteeWithNameA)( PTRUSTEEA pTrustee, LPSTR pName );
static VOID (WINAPI *pBuildTrusteeWithObjectsAndNameA)( PTRUSTEEA pTrustee,
@@ -199,6 +200,7 @@ static void init(void)
pAddAccessAllowedAceEx = (void *)GetProcAddress(hmod, "AddAccessAllowedAceEx");
pAddAccessDeniedAceEx = (void *)GetProcAddress(hmod, "AddAccessDeniedAceEx");
pAddAuditAccessAceEx = (void *)GetProcAddress(hmod, "AddAuditAccessAceEx");
+ pAddMandatoryAce = (void *)GetProcAddress(hmod, "AddMandatoryAce");
pCheckTokenMembership = (void *)GetProcAddress(hmod, "CheckTokenMembership");
pConvertStringSecurityDescriptorToSecurityDescriptorA =
(void *)GetProcAddress(hmod, "ConvertStringSecurityDescriptorToSecurityDescriptorA" );
@@ -6064,6 +6066,48 @@ static void test_default_dacl_owner_sid(void)
CloseHandle( handle );
}
+static void test_integrity(void)
+{
+ static SID low_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
+ {SECURITY_MANDATORY_LOW_RID}};
+ SYSTEM_MANDATORY_LABEL_ACE *ace;
+ char buffer_acl[256];
+ ACL *pAcl = (ACL*)&buffer_acl;
+ BOOL ret, found;
+ DWORD index;
+
+ if (!pAddMandatoryAce)
+ {
+ win_skip("Mandatory integrity labels not supported, skipping test\n");
+ return;
+ }
+
+ ret = InitializeAcl(pAcl, 256, ACL_REVISION);
+ ok(ret, "InitializeAcl failed with %u\n", GetLastError());
+
+ ret = pAddMandatoryAce(pAcl, ACL_REVISION, 0, 0x1234, &low_level);
+ ok(!ret, "AddMandatoryAce succeeded\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER got %u\n", GetLastError());
+
+ ret = pAddMandatoryAce(pAcl, ACL_REVISION, 0, SYSTEM_MANDATORY_LABEL_NO_WRITE_UP, &low_level);
+ ok(ret, "AddMandatoryAce failed with %u\n", GetLastError());
+
+ index = 0;
+ found = FALSE;
+ while (pGetAce( pAcl, index++, (void **)&ace ))
+ {
+ if (ace->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE)
+ {
+ found = TRUE;
+ ok(ace->Header.AceFlags == 0, "Expected 0 as flags, got %x\n", ace->Header.AceFlags);
+ ok(ace->Mask == SYSTEM_MANDATORY_LABEL_NO_WRITE_UP,
+ "Expected SYSTEM_MANDATORY_LABEL_NO_WRITE_UP as flag, got %x\n", ace->Mask);
+ ok(EqualSid(&ace->SidStart, &low_level), "Expected low integrity level\n");
+ }
+ }
+ ok(found, "Could not find mandatory label\n");
+}
+
static void test_AdjustTokenPrivileges(void)
{
TOKEN_PRIVILEGES tp, prev;
@@ -6444,6 +6488,7 @@ START_TEST(security)
test_CreateRestrictedToken();
test_TokenIntegrityLevel();
test_default_dacl_owner_sid();
+ test_integrity();
test_AdjustTokenPrivileges();
test_AddAce();
test_system_security_access();
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 28aa2df..f6f8eba 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -422,6 +422,7 @@
@ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
# @ stub RtlAddCompoundAce
+@ stdcall RtlAddMandatoryAce(ptr long long long long ptr)
# @ stub RtlAddRange
@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long)
@ stdcall RtlAddRefActivationContext(ptr)
diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c
index 3bc52ac..daa2cae 100644
--- a/dlls/ntdll/sec.c
+++ b/dlls/ntdll/sec.c
@@ -1379,6 +1379,31 @@ NTSTATUS WINAPI RtlAddAuditAccessObjectAce(
return STATUS_NOT_IMPLEMENTED;
}
+/**************************************************************************
+ * RtlAddMandatoryAce [NTDLL.@]
+ */
+NTSTATUS WINAPI RtlAddMandatoryAce(
+ IN OUT PACL pAcl,
+ IN DWORD dwAceRevision,
+ IN DWORD dwAceFlags,
+ IN DWORD dwMandatoryFlags,
+ IN DWORD dwAceType,
+ IN PSID pSid)
+{
+ static DWORD valid_flags = SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | SYSTEM_MANDATORY_LABEL_NO_READ_UP |
+ SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP;
+
+ TRACE("(%p,%d,0x%08x,0x%08x,%u,%p)\n",pAcl,dwAceRevision,dwAceFlags,dwMandatoryFlags, dwAceType, pSid);
+
+ if (dwAceType != SYSTEM_MANDATORY_LABEL_ACE_TYPE)
+ return STATUS_INVALID_PARAMETER;
+
+ if (dwMandatoryFlags & ~valid_flags)
+ return STATUS_INVALID_PARAMETER;
+
+ return add_access_ace(pAcl, dwAceRevision, dwAceFlags, dwMandatoryFlags, pSid, dwAceType);
+}
+
/******************************************************************************
* RtlValidAcl [NTDLL.@]
*/
diff --git a/include/winbase.h b/include/winbase.h
index eff5972..42c826d 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -1693,6 +1693,7 @@ WINBASEAPI ATOM WINAPI AddAtomW(LPCWSTR);
#define AddAtom WINELIB_NAME_AW(AddAtom)
WINADVAPI BOOL WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
WINADVAPI BOOL WINAPI AddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
+WINADVAPI BOOL WINAPI AddMandatoryAce(PACL,DWORD,DWORD,DWORD,PSID);
WINBASEAPI VOID WINAPI AddRefActCtx(HANDLE);
WINBASEAPI PVOID WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
WINADVAPI BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
diff --git a/include/winternl.h b/include/winternl.h
index f35091c..c104e6f 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2405,6 +2405,7 @@ NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
+NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
--
2.9.0

View File

@@ -0,0 +1 @@
Fixes: Implement advapi32.AddMandatoryAce

View File

@@ -0,0 +1,26 @@
From e71a9b9a10c2de28a617f9490c3d135b1e12adf1 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 16 Dec 2016 13:20:32 +0800
Subject: advapi32: SDDL assigns the "AC" abbreviation to
WinBuiltinAnyPackageSid.
---
dlls/advapi32/security.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 28331df..3b585aa 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -135,7 +135,7 @@ static const WELLKNOWNSID WellKnownSids[] =
{ {'M','E'}, WinMediumLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_MEDIUM_RID } } },
{ {'H','I'}, WinHighLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_HIGH_RID } } },
{ {'S','I'}, WinSystemLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_SYSTEM_RID } } },
- { {0,0}, WinBuiltinAnyPackageSid, { SID_REVISION, 2, { SECURITY_APP_PACKAGE_AUTHORITY }, { SECURITY_APP_PACKAGE_BASE_RID, SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE } } },
+ { {'A','C'}, WinBuiltinAnyPackageSid, { SID_REVISION, 2, { SECURITY_APP_PACKAGE_AUTHORITY }, { SECURITY_APP_PACKAGE_BASE_RID, SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE } } },
};
/* these SIDs must be constructed as relative to some domain - only the RID is well-known */
--
2.9.0

View File

@@ -0,0 +1,227 @@
From 13a60cc5ea59cc2f18ac19888fe51628f9f0774a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 16 Dec 2016 13:23:15 +0800
Subject: advapi32/tests: Add a test that compares a well-known SID to a SID
created from a SDDL abbreviation.
---
dlls/advapi32/tests/security.c | 130 +++++++++++++++++++++++++++++------------
1 file changed, 92 insertions(+), 38 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 18f4e04..4e1f53b 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2,7 +2,7 @@
* Unit tests for security functions
*
* Copyright (c) 2004 Mike McCormack
- * Copyright (c) 2011 Dmitry Timoshkov
+ * Copyright (c) 2011,2013,2014,2016 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -138,14 +138,6 @@ static HMODULE hmod;
static int myARGC;
static char** myARGV;
-struct strsid_entry
-{
- const char *str;
- DWORD flags;
-};
-#define STRSID_OK 0
-#define STRSID_OPT 1
-
#define SID_SLOTS 4
static char debugsid_str[SID_SLOTS][256];
static int debugsid_index = 0;
@@ -175,12 +167,6 @@ static const char* debugstr_sid(PSID sid)
return res;
}
-struct sidRef
-{
- SID_IDENTIFIER_AUTHORITY auth;
- const char *refStr;
-};
-
static void init(void)
{
HMODULE hntdll;
@@ -297,7 +283,11 @@ static void test_group_equal(HANDLE Handle, PSID expected, int line)
static void test_sid(void)
{
- struct sidRef refs[] = {
+ static struct
+ {
+ SID_IDENTIFIER_AUTHORITY auth;
+ const char *refStr;
+ } refs[] = {
{ { {0x00,0x00,0x33,0x44,0x55,0x66} }, "S-1-860116326-1" },
{ { {0x00,0x00,0x01,0x02,0x03,0x04} }, "S-1-16909060-1" },
{ { {0x00,0x00,0x00,0x01,0x02,0x03} }, "S-1-66051-1" },
@@ -305,24 +295,60 @@ static void test_sid(void)
{ { {0x00,0x00,0x00,0x00,0x00,0x02} }, "S-1-2-1" },
{ { {0x00,0x00,0x00,0x00,0x00,0x0c} }, "S-1-12-1" },
};
- struct strsid_entry strsid_table[] = {
- {"AO", STRSID_OK}, {"RU", STRSID_OK}, {"AN", STRSID_OK}, {"AU", STRSID_OK},
- {"BA", STRSID_OK}, {"BG", STRSID_OK}, {"BO", STRSID_OK}, {"BU", STRSID_OK},
- {"CA", STRSID_OPT}, {"CG", STRSID_OK}, {"CO", STRSID_OK}, {"DA", STRSID_OPT},
- {"DC", STRSID_OPT}, {"DD", STRSID_OPT}, {"DG", STRSID_OPT}, {"DU", STRSID_OPT},
- {"EA", STRSID_OPT}, {"ED", STRSID_OK}, {"WD", STRSID_OK}, {"PA", STRSID_OPT},
- {"IU", STRSID_OK}, {"LA", STRSID_OK}, {"LG", STRSID_OK}, {"LS", STRSID_OK},
- {"SY", STRSID_OK}, {"NU", STRSID_OK}, {"NO", STRSID_OK}, {"NS", STRSID_OK},
- {"PO", STRSID_OK}, {"PS", STRSID_OK}, {"PU", STRSID_OK}, {"RS", STRSID_OPT},
- {"RD", STRSID_OK}, {"RE", STRSID_OK}, {"RC", STRSID_OK}, {"SA", STRSID_OPT},
- {"SO", STRSID_OK}, {"SU", STRSID_OK}};
-
+ static const struct
+ {
+ const char *str;
+ WELL_KNOWN_SID_TYPE sid_type;
+ BOOL optional;
+ } strsid_table[] = {
+ /* Please keep the list sorted. */
+ { "AC", WinBuiltinAnyPackageSid, TRUE },
+ { "AN", WinAnonymousSid },
+ { "AO", WinBuiltinAccountOperatorsSid },
+ { "AU", WinAuthenticatedUserSid },
+ { "BA", WinBuiltinAdministratorsSid },
+ { "BG", WinBuiltinGuestsSid },
+ { "BO", WinBuiltinBackupOperatorsSid },
+ { "BU", WinBuiltinUsersSid },
+ { "CA", WinAccountCertAdminsSid, TRUE},
+ { "CG", WinCreatorGroupSid },
+ { "CO", WinCreatorOwnerSid },
+ { "DA", WinAccountDomainAdminsSid, TRUE},
+ { "DC", WinAccountComputersSid, TRUE},
+ { "DD", WinAccountControllersSid, TRUE},
+ { "DG", WinAccountDomainGuestsSid, TRUE},
+ { "DU", WinAccountDomainUsersSid, TRUE},
+ { "EA", WinAccountEnterpriseAdminsSid, TRUE},
+ { "ED", WinEnterpriseControllersSid },
+ { "IU", WinInteractiveSid },
+ { "LA", WinAccountAdministratorSid },
+ { "LG", WinAccountGuestSid },
+ { "LS", WinLocalServiceSid },
+ { "NO", WinBuiltinNetworkConfigurationOperatorsSid },
+ { "NS", WinNetworkServiceSid },
+ { "NU", WinNetworkSid },
+ { "PA", WinAccountPolicyAdminsSid, TRUE},
+ { "PO", WinBuiltinPrintOperatorsSid },
+ { "PS", WinSelfSid },
+ { "PU", WinBuiltinPowerUsersSid },
+ { "RC", WinRestrictedCodeSid },
+ { "RD", WinBuiltinRemoteDesktopUsersSid },
+ { "RE", WinBuiltinReplicatorSid },
+ { "RS", WinAccountRasAndIasServersSid, TRUE },
+ { "RU", WinBuiltinPreWindows2000CompatibleAccessSid },
+ { "SA", WinAccountSchemaAdminsSid, TRUE },
+ { "SO", WinBuiltinSystemOperatorsSid },
+ { "SU", WinServiceSid },
+ { "SY", WinLocalSystemSid },
+ { "WD", WinWorldSid },
+ };
+ SID_IDENTIFIER_AUTHORITY domain_ident = { SECURITY_NT_AUTHORITY };
const char noSubAuthStr[] = "S-1-5";
unsigned int i;
- PSID psid = NULL;
+ PSID psid, domain_sid;
SID *pisid;
BOOL r;
- LPSTR str = NULL;
+ LPSTR str;
if( !pConvertSidToStringSidA || !pConvertStringSidToSidA )
{
@@ -402,7 +428,7 @@ static void test_sid(void)
}
/* string constant format not supported before XP */
- r = pConvertStringSidToSidA(strsid_table[0].str, &psid);
+ r = pConvertStringSidToSidA("AN", &psid);
if(!r)
{
win_skip("String constant format not supported\n");
@@ -410,25 +436,51 @@ static void test_sid(void)
}
LocalFree(psid);
+ AllocateAndInitializeSid(&domain_ident, 4, SECURITY_NT_NON_UNIQUE, 0, 0, 0, 0, 0, 0, 0, &domain_sid);
+
for(i = 0; i < sizeof(strsid_table) / sizeof(strsid_table[0]); i++)
{
- char *temp;
-
SetLastError(0xdeadbeef);
r = pConvertStringSidToSidA(strsid_table[i].str, &psid);
- if (!(strsid_table[i].flags & STRSID_OPT))
+ if (!(strsid_table[i].optional))
{
ok(r, "%s: got %u\n", strsid_table[i].str, GetLastError());
}
if (r)
{
- if ((winetest_debug > 1) && (pConvertSidToStringSidA(psid, &temp)))
+ char buf[SECURITY_MAX_SID_SIZE];
+ char *sid_string, *well_known_sid_string;
+ DWORD n, size;
+
+ /* zero out domain id before comparison to simplify things */
+ if (strsid_table[i].sid_type == WinAccountAdministratorSid ||
+ strsid_table[i].sid_type == WinAccountGuestSid)
{
- trace(" %s: %s\n", strsid_table[i].str, temp);
- LocalFree(temp);
+ for (n = 1; n <= 3; n++)
+ *GetSidSubAuthority(psid, n) = 0;
}
+
+ r = pConvertSidToStringSidA(psid, &sid_string);
+ ok(r, "%s: ConvertSidToStringSid error %u\n", strsid_table[i].str, GetLastError());
+ if (winetest_debug > 1)
+ trace("%s => %s\n", strsid_table[i].str, sid_string);
+
+ size = sizeof(buf);
+ r = pCreateWellKnownSid(strsid_table[i].sid_type, domain_sid, buf, &size);
+ ok(r, "%u: CreateWellKnownSid(%u) error %u\n", i, strsid_table[i].sid_type, GetLastError());
+
+ r = pConvertSidToStringSidA(buf, &well_known_sid_string);
+ ok(r, "%u: ConvertSidToStringSi(%u) error %u\n", i, strsid_table[i].sid_type, GetLastError());
+ if (winetest_debug > 1)
+ trace("%u => %s\n", strsid_table[i].sid_type, well_known_sid_string);
+
+ ok(strcmp(sid_string, well_known_sid_string) == 0,
+ "%u: (%u) expected %s, got %s\n", i, strsid_table[i].sid_type, well_known_sid_string, sid_string);
+
+ LocalFree(well_known_sid_string);
+ LocalFree(sid_string);
LocalFree(psid);
}
else
@@ -439,6 +491,8 @@ static void test_sid(void)
trace(" %s: couldn't be converted\n", strsid_table[i].str);
}
}
+
+ LocalFree(domain_sid);
}
static void test_trustee(void)
@@ -2288,7 +2342,7 @@ static void test_LookupAccountSid(void)
if (pCreateWellKnownSid && pConvertSidToStringSidA)
{
trace("Well Known SIDs:\n");
- for (i = 0; i <= 60; i++)
+ for (i = 0; i <= 84; i++)
{
size = SECURITY_MAX_SID_SIZE;
if (pCreateWellKnownSid(i, NULL, &max_sid.sid, &size))
--
2.9.0

View File

@@ -0,0 +1 @@
Fixes: [41934] Assigns the AC abbreviation to WinBuiltinAnyPackageSid

View File

@@ -1,4 +1,4 @@
From 4d240f9f1d7b50a2a0206fe965986c967bbacfd7 Mon Sep 17 00:00:00 2001
From bfbe1cfd28797365a7341add7a330568b3846e89 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:07:35 +0100
Subject: ext-ms-win-xaml-pal-l1-1-0: Add dll and add stub for
@@ -15,13 +15,13 @@ Subject: ext-ms-win-xaml-pal-l1-1-0: Add dll and add stub for
create mode 100644 dlls/ext-ms-win-xaml-pal-l1-1-0/main.c
diff --git a/configure.ac b/configure.ac
index 647ea2fe..f3cb281 100644
index 670c2fc..8e44524 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3013,6 +3013,7 @@ WINE_CONFIG_DLL(ext-ms-win-kernel32-package-current-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-message-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-ntuser-uicontext-ext-l1-1-0)
@@ -3025,6 +3025,7 @@ WINE_CONFIG_DLL(ext-ms-win-rtcore-gdi-rgn-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dc-access-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dpi-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-sysparams-l1-1-0)
+WINE_CONFIG_DLL(ext-ms-win-xaml-pal-l1-1-0)
WINE_CONFIG_DLL(faultrep,,[implib])
WINE_CONFIG_TEST(dlls/faultrep/tests)

View File

@@ -1,4 +1,4 @@
From db1db629d2bce149edc99cd534d5e1b5e17a1e82 Mon Sep 17 00:00:00 2001
From 08231829bbfa686e537a0c94f3aa4ede92a7817b 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:12:45 +0100
Subject: ext-ms-win-appmodel-usercontext-l1-1-0: Add dll and add stub for
@@ -15,17 +15,17 @@ Subject: ext-ms-win-appmodel-usercontext-l1-1-0: Add dll and add stub for
create mode 100644 dlls/ext-ms-win-appmodel-usercontext-l1-1-0/main.c
diff --git a/configure.ac b/configure.ac
index f3cb281..7566ca4 100644
index bdd390c..6264ede 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3007,6 +3007,7 @@ WINE_CONFIG_DLL(esent)
@@ -3020,6 +3020,7 @@ WINE_CONFIG_DLL(esent)
WINE_CONFIG_DLL(evr)
WINE_CONFIG_DLL(explorerframe,,[clean])
WINE_CONFIG_TEST(dlls/explorerframe/tests)
+WINE_CONFIG_DLL(ext-ms-win-appmodel-usercontext-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-domainjoin-netjoin-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-gdi-dc-create-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-gdi-devcaps-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-kernel32-package-current-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-gdi-dc-l1-2-0)
diff --git a/dlls/ext-ms-win-appmodel-usercontext-l1-1-0/Makefile.in b/dlls/ext-ms-win-appmodel-usercontext-l1-1-0/Makefile.in
new file mode 100644
index 0000000..16eee75

View File

@@ -1,4 +1,4 @@
From 45055d28aa803d6dcd9fc74da0b1432b05e23abe Mon Sep 17 00:00:00 2001
From 703b9bd81221bd985ec79697e035e60a6fbcbc6d 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:00:39 +0100
Subject: ext-ms-win-ntuser-mouse-l1-1-0: Add dll.
@@ -13,17 +13,17 @@ Subject: ext-ms-win-ntuser-mouse-l1-1-0: Add dll.
create mode 100644 dlls/ext-ms-win-ntuser-mouse-l1-1-0/ext-ms-win-ntuser-mouse-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index c1799d1..1200547 100644
index c5d7a4e..377d146 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3015,6 +3015,7 @@ WINE_CONFIG_DLL(ext-ms-win-gdi-dc-create-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-gdi-devcaps-l1-1-0)
@@ -3020,6 +3020,7 @@ WINE_CONFIG_DLL(ext-ms-win-gdi-draw-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-gdi-render-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-kernel32-package-current-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-message-l1-1-1)
+WINE_CONFIG_DLL(ext-ms-win-ntuser-mouse-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-private-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-ntuser-rectangle-ext-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-uicontext-ext-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dpi-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-xaml-pal-l1-1-0)
diff --git a/dlls/ext-ms-win-ntuser-mouse-l1-1-0/Makefile.in b/dlls/ext-ms-win-ntuser-mouse-l1-1-0/Makefile.in
new file mode 100644
index 0000000..c408dbb
@@ -43,17 +43,17 @@ index 0000000..22128a2
+@ stdcall SetCapture(long) user32.SetCapture
+@ stdcall TrackMouseEvent(ptr) user32.TrackMouseEvent
diff --git a/tools/make_specfiles b/tools/make_specfiles
index a43d5dc..6cb5f53 100755
index 45fa346..576dc5f 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -285,6 +285,7 @@ my @dll_groups =
"api-ms-win-downlevel-user32-l1-1-0",
@@ -286,6 +286,7 @@ my @dll_groups =
"api-ms-win-ntuser-dc-access-l1-1-0",
"api-ms-win-rtcore-ntuser-private-l1-1-0",
"ext-ms-win-ntuser-message-l1-1-1",
+ "ext-ms-win-ntuser-mouse-l1-1-0",
"ext-ms-win-ntuser-private-l1-1-1",
"ext-ms-win-ntuser-rectangle-ext-l1-1-0",
"ext-ms-win-ntuser-uicontext-ext-l1-1-0",
"ext-ms-win-rtcore-ntuser-dpi-l1-1-0",
],
--
2.9.0

View File

@@ -1,4 +1,4 @@
From 85c838f8a6f00f53ddc753c4aea2d288c9f9b599 Mon Sep 17 00:00:00 2001
From bc9d6818548e009b387d32677e19d56018a9f59c 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:02:52 +0100
Subject: ext-ms-win-uxtheme-themes-l1-1-0: Add dll.
@@ -13,13 +13,13 @@ Subject: ext-ms-win-uxtheme-themes-l1-1-0: Add dll.
create mode 100644 dlls/ext-ms-win-uxtheme-themes-l1-1-0/ext-ms-win-uxtheme-themes-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index 1200547..b9920fb 100644
index 377d146..be65d14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3018,6 +3018,7 @@ WINE_CONFIG_DLL(ext-ms-win-ntuser-message-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-ntuser-mouse-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-uicontext-ext-l1-1-0)
@@ -3030,6 +3030,7 @@ WINE_CONFIG_DLL(ext-ms-win-rtcore-gdi-rgn-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dc-access-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dpi-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-sysparams-l1-1-0)
+WINE_CONFIG_DLL(ext-ms-win-uxtheme-themes-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-xaml-pal-l1-1-0)
WINE_CONFIG_DLL(faultrep,,[implib])
@@ -62,10 +62,10 @@ index 0000000..0a96983
+@ stdcall OpenThemeDataEx(ptr wstr long) uxtheme.OpenThemeDataEx
+@ stdcall SetWindowTheme(ptr wstr wstr) uxtheme.SetWindowTheme
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 6cb5f53..0aa6233 100755
index 576dc5f..1dde434 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -317,6 +317,10 @@ my @dll_groups =
@@ -329,6 +329,10 @@ my @dll_groups =
"api-ms-win-core-winrt-string-l1-1-0",
],
[

View File

@@ -1,4 +1,4 @@
From 2d8ce357a32cf96f732338eb5625c1cc88532355 Mon Sep 17 00:00:00 2001
From 3d0de5feeb0cf5863dd355e0e6f271de1665124c 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:05:14 +0100
Subject: api-ms-win-rtcore-ntuser-window-l1-1-0: Add dll
@@ -13,13 +13,13 @@ Subject: api-ms-win-rtcore-ntuser-window-l1-1-0: Add dll
create mode 100644 dlls/api-ms-win-rtcore-ntuser-window-l1-1-0/api-ms-win-rtcore-ntuser-window-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index b9920fb..4308010 100644
index e1dc9f2..82b112b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2790,6 +2790,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-controller-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0)
@@ -2800,6 +2800,7 @@ WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-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-private-l1-1-0)
+WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-window-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-audit-l1-1-1)
WINE_CONFIG_DLL(api-ms-win-security-base-l1-1-0)
@@ -119,17 +119,17 @@ index 0000000..b7575c6
+@ stdcall WaitMessage() user32.WaitMessage
+@ stdcall WindowFromPoint(int64) user32.WindowFromPoint
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 0aa6233..3afaea4 100755
index 0fd0420..89b311e 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -284,6 +284,7 @@ my @dll_groups =
"api-ms-win-core-string-l2-1-0",
@@ -302,6 +302,7 @@ my @dll_groups =
"api-ms-win-downlevel-user32-l1-1-0",
"api-ms-win-ntuser-dc-access-l1-1-0",
"api-ms-win-rtcore-ntuser-private-l1-1-0",
+ "api-ms-win-rtcore-ntuser-window-l1-1-0",
"ext-ms-win-ntuser-message-l1-1-1",
"ext-ms-win-ntuser-mouse-l1-1-0",
"ext-ms-win-ntuser-uicontext-ext-l1-1-0",
"ext-ms-win-ntuser-private-l1-1-1",
--
2.9.0

View File

@@ -1,4 +1,4 @@
From b86c534df0ffdfcbe823eed592e88d242733204a Mon Sep 17 00:00:00 2001
From 6c31a75359f023d3152378144efdee5f34078147 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:06:59 +0100
Subject: ext-ms-win-rtcore-ntuser-syscolors-l1-1-0: Add dll.
@@ -13,17 +13,17 @@ Subject: ext-ms-win-rtcore-ntuser-syscolors-l1-1-0: Add dll.
create mode 100644 dlls/ext-ms-win-rtcore-ntuser-syscolors-l1-1-0/ext-ms-win-rtcore-ntuser-syscolors-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index 4308010..e348625 100644
index e865969..4e7869f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3019,6 +3019,7 @@ WINE_CONFIG_DLL(ext-ms-win-ntuser-message-l1-1-1)
WINE_CONFIG_DLL(ext-ms-win-ntuser-mouse-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-uicontext-ext-l1-1-0)
@@ -3030,6 +3030,7 @@ WINE_CONFIG_DLL(ext-ms-win-rtcore-gdi-object-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-gdi-rgn-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dc-access-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dpi-l1-1-0)
+WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-syscolors-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-sysparams-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-uxtheme-themes-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-xaml-pal-l1-1-0)
WINE_CONFIG_DLL(faultrep,,[implib])
diff --git a/dlls/ext-ms-win-rtcore-ntuser-syscolors-l1-1-0/Makefile.in b/dlls/ext-ms-win-rtcore-ntuser-syscolors-l1-1-0/Makefile.in
new file mode 100644
index 0000000..3e6b6e8
@@ -40,17 +40,17 @@ index 0000000..626c778
+@ stdcall GetSysColor(long) user32.GetSysColor
+@ stdcall SetSysColors(long ptr ptr) user32.SetSysColors
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 3afaea4..e192572 100755
index 40129d0..1230505 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -289,6 +289,7 @@ my @dll_groups =
"ext-ms-win-ntuser-mouse-l1-1-0",
"ext-ms-win-ntuser-uicontext-ext-l1-1-0",
@@ -294,6 +294,7 @@ my @dll_groups =
"ext-ms-win-ntuser-window-l1-1-1",
"ext-ms-win-rtcore-ntuser-dc-access-l1-1-0",
"ext-ms-win-rtcore-ntuser-dpi-l1-1-0",
+ "ext-ms-win-rtcore-ntuser-syscolors-l1-1-0",
"ext-ms-win-rtcore-ntuser-sysparams-l1-1-0",
],
[
"version",
--
2.9.0

View File

@@ -1,4 +1,4 @@
From 50e5a8cff7cfb80c56df1ece4376caa1b4c158e6 Mon Sep 17 00:00:00 2001
From 3aa4751bd2cd9918733772e4a5a6c418bebfe560 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.
@@ -13,17 +13,17 @@ 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 e348625..7bd2367 100644
index 97dfa5e..cd145dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2790,6 +2790,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-controller-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0)
@@ -2799,6 +2799,7 @@ WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-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)
WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-private-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-window-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-audit-l1-1-1)
WINE_CONFIG_DLL(api-ms-win-security-base-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 0000000..956f2f3
@@ -39,17 +39,17 @@ index 0000000..59900a9
@@ -0,0 +1 @@
+@ stdcall RedrawWindow(long ptr long long) user32.RedrawWindow
diff --git a/tools/make_specfiles b/tools/make_specfiles
index e192572..466099d 100755
index a37666c..937a92f 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -284,6 +284,7 @@ my @dll_groups =
@@ -301,6 +301,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",
+ "api-ms-win-rtcore-ntuser-draw-l1-1-0",
"api-ms-win-rtcore-ntuser-private-l1-1-0",
"api-ms-win-rtcore-ntuser-window-l1-1-0",
"ext-ms-win-ntuser-message-l1-1-1",
"ext-ms-win-ntuser-mouse-l1-1-0",
--
2.9.0

View File

@@ -1,74 +0,0 @@
From 623de09b704239ee022242aed2966ece410556c4 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:10:37 +0100
Subject: ext-ms-win-rtcore-ntuser-sysparams-l1-1-0: Add dll.
---
configure.ac | 1 +
.../Makefile.in | 1 +
.../ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec | 20 ++++++++++++++++++++
tools/make_specfiles | 1 +
4 files changed, 23 insertions(+)
create mode 100644 dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/Makefile.in
create mode 100644 dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index 7bd2367..302a94d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3021,6 +3021,7 @@ WINE_CONFIG_DLL(ext-ms-win-ntuser-mouse-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-ntuser-uicontext-ext-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-dpi-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-syscolors-l1-1-0)
+WINE_CONFIG_DLL(ext-ms-win-rtcore-ntuser-sysparams-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-uxtheme-themes-l1-1-0)
WINE_CONFIG_DLL(ext-ms-win-xaml-pal-l1-1-0)
WINE_CONFIG_DLL(faultrep,,[implib])
diff --git a/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/Makefile.in b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/Makefile.in
new file mode 100644
index 0000000..18a0b1f
--- /dev/null
+++ b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/Makefile.in
@@ -0,0 +1 @@
+MODULE = ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.dll
diff --git a/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec
new file mode 100644
index 0000000..ffb8f5b
--- /dev/null
+++ b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec
@@ -0,0 +1,20 @@
+@ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr) user32.ChangeDisplaySettingsExW
+@ stdcall DisplayConfigGetDeviceInfo(ptr) user32.DisplayConfigGetDeviceInfo
+@ stub DisplayConfigSetDeviceInfo
+@ stdcall EnumDisplayDevicesW(ptr long ptr long) user32.EnumDisplayDevicesW
+@ stdcall EnumDisplayMonitors(long ptr ptr long) user32.EnumDisplayMonitors
+@ stdcall EnumDisplaySettingsExW(wstr long ptr long) user32.EnumDisplaySettingsExW
+@ stdcall EnumDisplaySettingsW(wstr long ptr ) user32.EnumDisplaySettingsW
+@ stdcall GetDisplayConfigBufferSizes(long ptr ptr) user32.GetDisplayConfigBufferSizes
+@ stdcall GetMonitorInfoW(long ptr) user32.GetMonitorInfoW
+@ stdcall GetSysColor(long) user32.GetSysColor
+@ stdcall GetSystemMetrics(long) user32.GetSystemMetrics
+@ stdcall IsProcessDPIAware() user32.IsProcessDPIAware
+@ stdcall MonitorFromPoint(int64 long) user32.MonitorFromPoint
+@ stdcall MonitorFromRect(ptr long) user32.MonitorFromRect
+@ stdcall MonitorFromWindow(long long) user32.MonitorFromWindow
+@ stdcall QueryDisplayConfig(long ptr ptr ptr ptr ptr) user32.QueryDisplayConfig
+@ stdcall SetProcessDPIAware() user32.SetProcessDPIAware
+@ stdcall SetSysColors(long ptr ptr) user32.SetSysColors
+@ stdcall SystemParametersInfoA(long long ptr long) user32.SystemParametersInfoA
+@ stdcall SystemParametersInfoW(long long ptr long) user32.SystemParametersInfoW
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 466099d..238feb1 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -291,6 +291,7 @@ my @dll_groups =
"ext-ms-win-ntuser-uicontext-ext-l1-1-0",
"ext-ms-win-rtcore-ntuser-dpi-l1-1-0",
"ext-ms-win-rtcore-ntuser-syscolors-l1-1-0",
+ "ext-ms-win-rtcore-ntuser-sysparams-l1-1-0",
],
[
"version",
--
2.9.0

View File

@@ -0,0 +1,43 @@
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

View File

@@ -0,0 +1,42 @@
From 64ce8c391c3706a2b3ce9b5f8f76710d5751a766 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Oct 2016 17:48:24 +0800
Subject: avifil32: AVIFileGetStream should set stream to NULL in case of an
error.
---
dlls/avifil32/avifile.c | 1 +
dlls/avifil32/tests/api.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index f649d05..7a4caaa 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -316,6 +316,7 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, D
}
/* Sorry, but the specified stream doesn't exist */
+ *avis = NULL;
return AVIERR_NODATA;
}
diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c
index b3d822d..8a00865 100644
--- a/dlls/avifil32/tests/api.c
+++ b/dlls/avifil32/tests/api.c
@@ -373,6 +373,11 @@ static void test_default_data(void)
res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L);
ok(res == 0, "Unable to open file: error=%u\n", res);
+ pStream0 = (void *)0xdeadbeef;
+ res = AVIFileGetStream(pFile, &pStream0, ~0, 0);
+ ok(res == AVIERR_NODATA, "expected AVIERR_NODATA, got %#x\n", res);
+ ok(pStream0 == NULL, "AVIFileGetStream should set stream to NULL\n");
+
res = AVIFileGetStream(pFile, &pStream0, 0, 0);
ok(res == 0, "Unable to open video stream: error=%u\n", res);
--
2.9.0

View File

@@ -0,0 +1 @@
Fixes: [41579] AVIFileGetStream should set stream to NULL in case of an error

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,469 @@
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

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