Added patch to recognize sha256/384/512 KEY OIDs.

This commit is contained in:
Sebastian Lackner 2017-01-24 05:04:18 +01:00
parent f93bdfd5fb
commit fa1d5938f2
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,52 @@
From 80ed5b05271aed72ae87ecfc354dce8cca5efd19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 24 Jan 2017 03:47:25 +0100
Subject: crypt32: Recognize sha256/384/512 KEY OIDs.
---
dlls/crypt32/oid.c | 6 ++++++
include/wincrypt.h | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/dlls/crypt32/oid.c b/dlls/crypt32/oid.c
index d5c29534c23..7c07b9fcd99 100644
--- a/dlls/crypt32/oid.c
+++ b/dlls/crypt32/oid.c
@@ -1053,6 +1053,9 @@ static const WCHAR rc2[] = { 'r','c','2',0 };
static const WCHAR rc4[] = { 'r','c','4',0 };
static const WCHAR sha[] = { 's','h','a',0 };
static const WCHAR sha1[] = { 's','h','a','1',0 };
+static const WCHAR sha256[] = { 's','h','a','2','5','6',0 };
+static const WCHAR sha384[] = { 's','h','a','3','8','4',0 };
+static const WCHAR sha512[] = { 's','h','a','5','1','2',0 };
static const WCHAR RSA[] = { 'R','S','A',0 };
static const WCHAR RSA_KEYX[] = { 'R','S','A','_','K','E','Y','X',0 };
static const WCHAR RSA_SIGN[] = { 'R','S','A','_','S','I','G','N',0 };
@@ -1157,6 +1160,9 @@ static const struct OIDInfoConstructor {
{ 1, szOID_RSA_MD5, CALG_MD5, md5, NULL },
{ 1, szOID_RSA_MD4, CALG_MD4, md4, NULL },
{ 1, szOID_RSA_MD2, CALG_MD2, md2, NULL },
+ { 1, szOID_NIST_sha256, CALG_SHA_256, sha256, NULL },
+ { 1, szOID_NIST_sha384, CALG_SHA_384, sha384, NULL },
+ { 1, szOID_NIST_sha512, CALG_SHA_512, sha512, NULL },
{ 2, szOID_OIWSEC_desCBC, CALG_DES, des, NULL },
{ 2, szOID_RSA_DES_EDE3_CBC, CALG_3DES, tripledes, NULL },
diff --git a/include/wincrypt.h b/include/wincrypt.h
index 88b4b65d4c1..14705708f2b 100644
--- a/include/wincrypt.h
+++ b/include/wincrypt.h
@@ -3149,6 +3149,10 @@ typedef struct _CTL_FIND_SUBJECT_PARA
#define szOID_NETSCAPE_DATA_TYPE "2.16.840.1.113730.2"
#define szOID_NETSCAPE_CERT_SEQUENCE "2.16.840.1.113730.2.5"
+#define szOID_NIST_sha256 "2.16.840.1.101.3.4.2.1"
+#define szOID_NIST_sha384 "2.16.840.1.101.3.4.2.2"
+#define szOID_NIST_sha512 "2.16.840.1.101.3.4.2.3"
+
/* Bits for szOID_NETSCAPE_CERT_TYPE */
#define NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE 0x80
#define NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE 0x40
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: Recognize sha256/384/512 KEY OIDs

View File

@ -109,6 +109,7 @@ patch_enable_all ()
enable_crypt32_CMS_Certificates="$1"
enable_crypt32_Certificate_Check="$1"
enable_crypt32_CryptUnprotectMemory="$1"
enable_crypt32_SHA_OIDs="$1"
enable_d3d10_1_Forwards="$1"
enable_d3d11_Deferred_Context="$1"
enable_d3d11_ID3D11Texture1D="$1"
@ -543,6 +544,9 @@ patch_enable ()
crypt32-CryptUnprotectMemory)
enable_crypt32_CryptUnprotectMemory="$2"
;;
crypt32-SHA_OIDs)
enable_crypt32_SHA_OIDs="$2"
;;
d3d10_1-Forwards)
enable_d3d10_1_Forwards="$2"
;;
@ -3089,6 +3093,18 @@ if test "$enable_crypt32_CryptUnprotectMemory" -eq 1; then
) >> "$patchlist"
fi
# Patchset crypt32-SHA_OIDs
# |
# | Modified files:
# | * dlls/crypt32/oid.c, include/wincrypt.h
# |
if test "$enable_crypt32_SHA_OIDs" -eq 1; then
patch_apply crypt32-SHA_OIDs/0001-crypt32-Recognize-sha256-384-512-KEY-OIDs.patch
(
printf '%s\n' '+ { "Michael Müller", "crypt32: Recognize sha256/384/512 KEY OIDs.", 1 },';
) >> "$patchlist"
fi
# Patchset d3d10_1-Forwards
# |
# | Modified files: