Rebase against d265dd88cd93ce6ffe56c9cfd640b064d7c14e29

This commit is contained in:
Alistair Leslie-Hughes 2018-07-19 08:45:46 +10:00
parent 12be01bfc1
commit 49025c255b
5 changed files with 49 additions and 92 deletions

View File

@ -1,18 +1,19 @@
From 41147c17b99a8e9c556449613228315e16f067b7 Mon Sep 17 00:00:00 2001
From ee38b7a672771d088ee5c4e58300623259020fb6 Mon Sep 17 00:00:00 2001
From: Maxime Lombard <berillions@gmail.com>
Date: Sun, 10 Jun 2018 14:47:01 +0200
Subject: [PATCH 1/3] bcrypt: Add support for algorithm ECDH P256.
---
dlls/bcrypt/bcrypt_main.c | 3 +++
include/bcrypt.h | 1 +
2 files changed, 4 insertions(+)
dlls/bcrypt/bcrypt_internal.h | 1 +
dlls/bcrypt/bcrypt_main.c | 2 ++
include/bcrypt.h | 1 +
3 files changed, 4 insertions(+)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 29a0a785d9..f2f4c93ab8 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -288,6 +288,7 @@ enum alg_id
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
index 11c8b30..fd8cc90 100644
--- a/dlls/bcrypt/bcrypt_internal.h
+++ b/dlls/bcrypt/bcrypt_internal.h
@@ -137,6 +137,7 @@ enum alg_id
ALG_ID_SHA256,
ALG_ID_SHA384,
ALG_ID_SHA512,
@ -20,15 +21,19 @@ index 29a0a785d9..f2f4c93ab8 100644
ALG_ID_ECDSA_P256,
ALG_ID_ECDSA_P384,
};
@@ -322,6 +323,7 @@ alg_props[] =
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 24065c1..003e8f3 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -114,6 +114,7 @@ alg_props[] =
/* ALG_ID_SHA256 */ { 286, 32, 512, BCRYPT_SHA256_ALGORITHM, FALSE },
/* ALG_ID_SHA384 */ { 382, 48, 1024, BCRYPT_SHA384_ALGORITHM, FALSE },
/* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
+ /* ALG_ID_ECDH_P256 */ { 0, 0, 0, BCRYPT_ECDH_P256_ALGORITHM, FALSE },
+ /* ALG_ID_ECDH_P256 */ { 0, 0, 0, BCRYPT_ECDH_P256_ALGORITHM, FALSE },
/* ALG_ID_ECDSA_P256 */ { 0, 0, 0, BCRYPT_ECDSA_P256_ALGORITHM, FALSE },
/* ALG_ID_ECDSA_P384 */ { 0, 0, 0, BCRYPT_ECDSA_P384_ALGORITHM, FALSE },
};
@@ -400,6 +402,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
@@ -184,6 +185,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
else if (!strcmpW( id, BCRYPT_SHA512_ALGORITHM )) alg_id = ALG_ID_SHA512;
@ -37,17 +42,17 @@ index 29a0a785d9..f2f4c93ab8 100644
else if (!strcmpW( id, BCRYPT_ECDSA_P384_ALGORITHM )) alg_id = ALG_ID_ECDSA_P384;
else
diff --git a/include/bcrypt.h b/include/bcrypt.h
index df54f621fa..d39920c3f6 100644
index d3e4b99..676db72 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -81,6 +81,7 @@ typedef LONG NTSTATUS;
#define BCRYPT_SHA256_ALGORITHM (const WCHAR []){'S','H','A','2','5','6',0}
#define BCRYPT_SHA384_ALGORITHM (const WCHAR []){'S','H','A','3','8','4',0}
#define BCRYPT_SHA512_ALGORITHM (const WCHAR []){'S','H','A','5','1','2',0}
+#define BCRYPT_ECDH_P256_ALGORITHM (const WCHAR []){'E','C','D','H','_','P','2','5','6',0}
+#define BCRYPT_ECDH_P256_ALGORITHM (const WCHAR []){'E','C','D','H','_','P','2','5','6',0}
#define BCRYPT_ECDSA_P256_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','2','5','6',0}
#define BCRYPT_ECDSA_P384_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','3','8','4',0}
#define BCRYPT_ECDSA_P521_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','5','2','1',0}
--
2.17.1
1.9.1

View File

@ -1,4 +1,4 @@
From 392cf1c3f3ddb6fa7935a6cd1f16d46004667aab Mon Sep 17 00:00:00 2001
From 8ebad635c033bf41392e23ee50494195fdce73b9 Mon Sep 17 00:00:00 2001
From: Maxime Lombard <berillions@gmail.com>
Date: Sun, 10 Jun 2018 14:50:31 +0200
Subject: [PATCH 2/3] bcrypt: Add BCryptGenerateKeyPair stub.
@ -10,10 +10,10 @@ Subject: [PATCH 2/3] bcrypt: Add BCryptGenerateKeyPair stub.
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index 78824d73b3..ccfec632d6 100644
index f4d9a57..1e81ad1 100644
--- a/dlls/bcrypt/bcrypt.spec
+++ b/dlls/bcrypt/bcrypt.spec
@@ -25,7 +25,7 @@
@@ -26,7 +26,7 @@
@ stdcall BCryptFinishHash(ptr ptr long long)
@ stub BCryptFreeBuffer
@ stdcall BCryptGenRandom(ptr ptr long long)
@ -23,12 +23,12 @@ index 78824d73b3..ccfec632d6 100644
@ stdcall BCryptGetFipsAlgorithmMode(ptr)
@ stdcall BCryptGetProperty(ptr wstr ptr long ptr long)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index f2f4c93ab8..b4ac0168e6 100644
index 003e8f3..0d94634 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -336,6 +336,12 @@ struct algorithm
BOOL hmac;
};
@@ -160,6 +160,12 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
return STATUS_NOT_IMPLEMENTED;
}
+NTSTATUS WINAPI BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE *handle, ULONG input_len, ULONG flags)
+{
@ -36,14 +36,14 @@ index f2f4c93ab8..b4ac0168e6 100644
+ return STATUS_SUCCESS;
+}
+
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG count, ULONG flags)
NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR id, LPCWSTR implementation, DWORD flags )
{
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
const DWORD supported_flags = BCRYPT_ALG_HANDLE_HMAC_FLAG;
diff --git a/include/bcrypt.h b/include/bcrypt.h
index d39920c3f6..e6b7d4a9ac 100644
index 676db72..ce11685 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -223,6 +223,7 @@ NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
@@ -224,6 +224,7 @@ NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
@ -52,5 +52,5 @@ index d39920c3f6..e6b7d4a9ac 100644
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
--
2.17.1
1.9.1

View File

@ -1,4 +1,4 @@
From 85e1f780a0d26d6c1e286c944fbcf25e762633b9 Mon Sep 17 00:00:00 2001
From 046863d1eb6db25555743cbbc257260387b31c19 Mon Sep 17 00:00:00 2001
From: Maxime Lombard <berillions@gmail.com>
Date: Sun, 10 Jun 2018 14:52:31 +0200
Subject: [PATCH 3/3] bcrypt: Add BCryptFinalizeKeyPair stub.
@ -10,10 +10,10 @@ Subject: [PATCH 3/3] bcrypt: Add BCryptFinalizeKeyPair stub.
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index ccfec632d6..891381f2a8 100644
index 1e81ad1..052a099 100644
--- a/dlls/bcrypt/bcrypt.spec
+++ b/dlls/bcrypt/bcrypt.spec
@@ -21,7 +21,7 @@
@@ -22,7 +22,7 @@
@ stub BCryptEnumProviders
@ stub BCryptEnumRegisteredProviders
@ stdcall BCryptExportKey(ptr ptr wstr ptr long ptr long)
@ -23,12 +23,12 @@ index ccfec632d6..891381f2a8 100644
@ stub BCryptFreeBuffer
@ stdcall BCryptGenRandom(ptr ptr long long)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index b4ac0168e6..69037971bf 100644
index 0d94634..40a3405 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -336,6 +336,12 @@ struct algorithm
BOOL hmac;
};
@@ -166,6 +166,12 @@ NTSTATUS WINAPI BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HA
return STATUS_SUCCESS;
}
+NTSTATUS WINAPI BCryptFinalizeKeyPair(BCRYPT_KEY_HANDLE key, ULONG dwflags)
+{
@ -36,14 +36,14 @@ index b4ac0168e6..69037971bf 100644
+ return STATUS_SUCCESS;
+}
+
NTSTATUS WINAPI BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE *handle, ULONG input_len, ULONG flags)
NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR id, LPCWSTR implementation, DWORD flags )
{
FIXME("%p, %p, %u, %08x - stub\n", algorithm, handle, input_len, flags);
const DWORD supported_flags = BCRYPT_ALG_HANDLE_HMAC_FLAG;
diff --git a/include/bcrypt.h b/include/bcrypt.h
index e6b7d4a9ac..b5844a144d 100644
index ce11685..b8e93a6 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -222,6 +222,7 @@ NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
@@ -223,6 +223,7 @@ NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
@ -52,5 +52,5 @@ index e6b7d4a9ac..b5844a144d 100644
NTSTATUS WINAPI BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE *, ULONG, ULONG);
NTSTATUS WINAPI BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
--
2.17.1
1.9.1

View File

@ -1,46 +0,0 @@
From fe0714a56f0b6b69336446c6f68abafba29f57bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 20 Jan 2017 01:39:01 +0100
Subject: ole32: Support reading VT_BOOL, VT_R8 and VT_I8 into propery storage.
---
dlls/ole32/stg_prop.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index f952704c7cd..e90e1ed4eda 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1066,6 +1066,10 @@ static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data,
prop->u.bVal = *data;
TRACE("Read byte 0x%x\n", prop->u.bVal);
break;
+ case VT_BOOL:
+ StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.boolVal);
+ TRACE("Read bool %d\n", prop->u.boolVal);
+ break;
case VT_I2:
StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.iVal);
TRACE("Read short %d\n", prop->u.iVal);
@@ -1084,6 +1088,18 @@ static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data,
StorageUtl_ReadDWord(data, 0, &prop->u.ulVal);
TRACE("Read ulong %d\n", prop->u.ulVal);
break;
+ case VT_I8:
+ StorageUtl_ReadULargeInteger(data, 0, (ULARGE_INTEGER *)&prop->u.hVal);
+ TRACE("Read long long %s\n", wine_dbgstr_longlong(prop->u.hVal.QuadPart));
+ break;
+ case VT_UI8:
+ StorageUtl_ReadULargeInteger(data, 0, &prop->u.uhVal);
+ TRACE("Read ulong long %s\n", wine_dbgstr_longlong(prop->u.uhVal.QuadPart));
+ break;
+ case VT_R8:
+ memcpy(&prop->u.dblVal, data, sizeof(double));
+ TRACE("Read double %f\n", prop->u.dblVal);
+ break;
case VT_LPSTR:
{
DWORD count;
--
2.11.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b03718f09cfad27335b9c13f5eb1152a4794f4b3"
echo "d265dd88cd93ce6ffe56c9cfd640b064d7c14e29"
}
# Show version information
@ -2677,12 +2677,12 @@ fi
# | * [#45312] Fix issue for Assassin's Creed : Syndicate
# |
# | Modified files:
# | * dlls/bcrypt/bcrypt.spec, dlls/bcrypt/bcrypt_main.c, include/bcrypt.h
# | * dlls/bcrypt/bcrypt.spec, dlls/bcrypt/bcrypt_internal.h, dlls/bcrypt/bcrypt_main.c, include/bcrypt.h
# |
if test "$enable_bcrypt_BCryptGenerateKeyPair" -eq 1; then
patch_apply bcrypt-BCryptGenerateKeyPair/0001-Add-support-for-bcrypt-algorithm-ECDH-P256.-Necessar.patch
patch_apply bcrypt-BCryptGenerateKeyPair/0002-Add-support-for-bcrypt-function-BCryptGenerateKeyPai.patch
patch_apply bcrypt-BCryptGenerateKeyPair/0003-Add-support-for-bcrypt-function-BCryptFinalizeKeyPai.patch
patch_apply bcrypt-BCryptGenerateKeyPair/0001-bcrypt-Add-support-for-algorithm-ECDH-P256.patch
patch_apply bcrypt-BCryptGenerateKeyPair/0002-bcrypt-Add-BCryptGenerateKeyPair-stub.patch
patch_apply bcrypt-BCryptGenerateKeyPair/0003-bcrypt-Add-BCryptFinalizeKeyPair-stub.patch
(
printf '%s\n' '+ { "Maxime Lombard", "bcrypt: Add support for algorithm ECDH P256.", 1 },';
printf '%s\n' '+ { "Maxime Lombard", "bcrypt: Add BCryptGenerateKeyPair stub.", 1 },';
@ -5481,11 +5481,9 @@ fi
# |
if test "$enable_ole32_STGPROP" -eq 1; then
patch_apply ole32-STGPROP/0001-ole32-Correctly-parse-unicode-property-storage-dicti.patch
patch_apply ole32-STGPROP/0002-ole32-Support-reading-VT_BOOL-VT_R8-and-VT_I8-into-p.patch
patch_apply ole32-STGPROP/0003-ole32-Implement-returning-a-name-in-IEnumSTATPROPSTG.patch
(
printf '%s\n' '+ { "Michael Müller", "ole32: Correctly parse unicode property storage dictionaries.", 1 },';
printf '%s\n' '+ { "Michael Müller", "ole32: Support reading VT_BOOL, VT_R8 and VT_I8 into propery storage.", 1 },';
printf '%s\n' '+ { "Michael Müller", "ole32: Implement returning a name in IEnumSTATPROPSTG.", 1 },';
) >> "$patchlist"
fi