https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e0a47b7b5ffc7d8dd5b88…
commit e0a47b7b5ffc7d8dd5b883875200b56cec8ef923
Author: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
AuthorDate: Thu Dec 30 21:23:49 2021 +0100
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sat Jan 1 15:18:06 2022 +0300
[BCRYPT] Add ECDSA P256 to known algorithms
Add missing structs and handler in BCryptOpenAlgorithmProvider().
Fixes CORE-16741 and similar problems.
---
dll/win32/bcrypt/bcrypt_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dll/win32/bcrypt/bcrypt_main.c b/dll/win32/bcrypt/bcrypt_main.c
index 14523136440..4b80ac0e94a 100644
--- a/dll/win32/bcrypt/bcrypt_main.c
+++ b/dll/win32/bcrypt/bcrypt_main.c
@@ -266,7 +266,8 @@ enum alg_id
ALG_ID_SHA1,
ALG_ID_SHA256,
ALG_ID_SHA384,
- ALG_ID_SHA512
+ ALG_ID_SHA512,
+ ALG_ID_ECDSA_P256,
};
static const struct {
@@ -278,7 +279,8 @@ static const struct {
/* ALG_ID_SHA1 */ { 20, BCRYPT_SHA1_ALGORITHM },
/* ALG_ID_SHA256 */ { 32, BCRYPT_SHA256_ALGORITHM },
/* ALG_ID_SHA384 */ { 48, BCRYPT_SHA384_ALGORITHM },
- /* ALG_ID_SHA512 */ { 64, BCRYPT_SHA512_ALGORITHM }
+ /* ALG_ID_SHA512 */ { 64, BCRYPT_SHA512_ALGORITHM },
+ /* ALG_ID_ECDSA_P256 */ { 0, BCRYPT_ECDSA_P256_ALGORITHM },
};
struct algorithm
@@ -351,6 +353,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;
+ else if (!strcmpW( id, BCRYPT_ECDSA_P256_ALGORITHM )) alg_id = ALG_ID_ECDSA_P256;
else
{
FIXME( "algorithm %s not supported\n", debugstr_w(id) );