From f21b177f19edb6610ce460bc09cf6cfe2318e96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 29 Sep 2017 18:49:09 +0200 Subject: [PATCH 30/36] include: Add ecdsa and asymmetric key related bcrypt definitions. --- include/bcrypt.h | 28 ++++++++++++++++++++++++++++ include/ntstatus.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/include/bcrypt.h b/include/bcrypt.h index d0b29c7cdd..bf47576ab0 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -61,6 +61,8 @@ typedef LONG NTSTATUS; #define BCRYPT_OPAQUE_KEY_BLOB (const WCHAR []){'O','p','a','q','u','e','K','e','y','B','l','o','b',0} #define BCRYPT_KEY_DATA_BLOB (const WCHAR []){'K','e','y','D','a','t','a','B','l','o','b',0} #define BCRYPT_AES_WRAP_KEY_BLOB (const WCHAR []){'R','f','c','3','5','6','5','K','e','y','W','r','a','p','B','l','o','b',0} +#define BCRYPT_ECCPUBLIC_BLOB (const WCHAR []){'E','C','C','P','U','B','L','I','C','B','L','O','B',0} +#define BCRYPT_ECCPRIVATE_BLOB (const WCHAR []){'E','C','C','P','R','I','V','A','T','E','B','L','O','B',0} #define MS_PRIMITIVE_PROVIDER (const WCHAR [])\ {'M','i','c','r','o','s','o','f','t',' ','P','r','i','m','i','t','i','v','e',' ','P','r','o','v','i','d','e','r',0} @@ -76,6 +78,9 @@ 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_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} #define BCRYPT_CHAIN_MODE_NA (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','N','/','A',0} #define BCRYPT_CHAIN_MODE_CBC (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','B','C',0} @@ -84,6 +89,13 @@ typedef LONG NTSTATUS; #define BCRYPT_CHAIN_MODE_CCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','C','M',0} #define BCRYPT_CHAIN_MODE_GCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','G','C','M',0} +#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345 +#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC 0x32534345 +#define BCRYPT_ECDSA_PUBLIC_P384_MAGIC 0x33534345 +#define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345 +#define BCRYPT_ECDSA_PUBLIC_P521_MAGIC 0x35534345 +#define BCRYPT_ECDSA_PRIVATE_P521_MAGIC 0x36534345 + typedef struct _BCRYPT_ALGORITHM_IDENTIFIER { LPWSTR pszName; @@ -115,6 +127,22 @@ typedef struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO ULONG dwFlags; } BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO, *PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO; +typedef struct _BCRYPT_ECCKEY_BLOB +{ + ULONG dwMagic; + ULONG cbKey; +} BCRYPT_ECCKEY_BLOB, *PBCRYPT_ECCKEY_BLOB; + +typedef struct _BCRYPT_PKCS1_PADDING_INFO +{ + LPCWSTR pszAlgId; +} BCRYPT_PKCS1_PADDING_INFO; + +#define BCRYPT_PAD_NONE 0x00000001 +#define BCRYPT_PAD_PKCS1 0x00000002 +#define BCRYPT_PAD_OAEP 0x00000004 +#define BCRYPT_PAD_PSS 0x00000008 + #define BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION 1 #define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001 diff --git a/include/ntstatus.h b/include/ntstatus.h index 7026de7f85..735b6c2c41 100644 --- a/include/ntstatus.h +++ b/include/ntstatus.h @@ -990,6 +990,8 @@ #define STATUS_WOW_ASSERTION ((NTSTATUS) 0xC0009898) +#define STATUS_INVALID_SIGNATURE ((NTSTATUS) 0xC000A000) +#define STATUS_HMAC_NOT_SUPPORTED ((NTSTATUS) 0xC000A001) #define STATUS_AUTH_TAG_MISMATCH ((NTSTATUS) 0xC000A002) #define RPC_NT_INVALID_STRING_BINDING ((NTSTATUS) 0xC0020001) -- 2.16.1