Remove crypt32-ECDSA_Cert_Chains

These test are what remains of the origial patchset, and they
are very unlikly to upstreamed.
This commit is contained in:
Alistair Leslie-Hughes 2018-08-27 09:02:52 +10:00
parent 3dcb983637
commit e8ba49a434
6 changed files with 0 additions and 368 deletions

View File

@ -1,2 +1 @@
Fixes: [42704] Implement BCryptDeriveKeyPBKDF2
Depends: crypt32-ECDSA_Cert_Chains

View File

@ -1,2 +1 @@
Fixes: [45312] Fix issue for Assassin's Creed : Syndicate
Depends: crypt32-ECDSA_Cert_Chains

View File

@ -1,196 +0,0 @@
From 484fbc0054dadaf4a410ae3497ccf3338ef7d81c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 27 Sep 2017 18:31:07 +0200
Subject: crypt32/tests: Basic tests for decoding ECDSA signed certificate.
---
dlls/crypt32/tests/encode.c | 168 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 168 insertions(+)
diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index a4daec0..729f3e4 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -8509,6 +8509,173 @@ static void testPortPublicKeyInfo(void)
ok(ret,"CryptAcquireContextA failed\n");
}
+static const BYTE eccCert[] = {
+0x30,0x82,0x01,0x46,0x30,0x81,0xec,0x02,0x09,0x00,0xe7,0x6b,
+0x26,0x86,0x0a,0x82,0xff,0xe9,0x30,0x0a,0x06,0x08,0x2a,0x86,
+0x48,0xce,0x3d,0x04,0x03,0x02,0x30,0x2b,0x31,0x0b,0x30,0x09,
+0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x0d,0x30,
+0x0b,0x06,0x03,0x55,0x04,0x0a,0x0c,0x04,0x57,0x69,0x6e,0x65,
+0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x03,0x0c,0x04,0x57,
+0x69,0x6e,0x65,0x30,0x1e,0x17,0x0d,0x31,0x37,0x30,0x39,0x32,
+0x37,0x31,0x33,0x34,0x31,0x30,0x34,0x5a,0x17,0x0d,0x32,0x37,
+0x30,0x39,0x32,0x35,0x31,0x33,0x34,0x31,0x30,0x34,0x5a,0x30,
+0x2b,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,
+0x44,0x45,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x0c,
+0x04,0x54,0x65,0x73,0x74,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,
+0x04,0x03,0x0c,0x04,0x54,0x65,0x73,0x74,0x30,0x59,0x30,0x13,
+0x06,0x07,0x2a,0x86,0x48,0xce,0x3d,0x02,0x01,0x06,0x08,0x2a,
+0x86,0x48,0xce,0x3d,0x03,0x01,0x07,0x03,0x42,0x00,0x04,0xed,
+0xfc,0x77,0xd8,0xb9,0xe7,0xf3,0xf8,0xce,0x13,0xb8,0x7f,0x0f,
+0x78,0xea,0x73,0x87,0x29,0x10,0xe1,0x6d,0x10,0xce,0x57,0x60,
+0x3b,0x3e,0xb4,0x5f,0x0d,0x20,0xc1,0xeb,0x6d,0x74,0xe9,0x7b,
+0x11,0x51,0x9a,0x00,0xe8,0xe9,0x12,0x84,0xb9,0x07,0x7e,0x7b,
+0x62,0x67,0x12,0x67,0x08,0xe5,0x2e,0x27,0xce,0xa2,0x57,0x15,
+0xad,0xc5,0x1f,0x30,0x0a,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,
+0x04,0x03,0x02,0x03,0x49,0x00,0x30,0x46,0x02,0x21,0x00,0xd7,
+0x29,0xce,0x5a,0xef,0x74,0x85,0xd1,0x18,0x5f,0x6e,0xf1,0xba,
+0x53,0xd4,0xcd,0xdd,0xe0,0x5d,0xf1,0x5e,0x48,0x51,0xea,0x63,
+0xc0,0xe8,0xe2,0xf6,0xfa,0x4c,0xaf,0x02,0x21,0x00,0xe3,0x94,
+0x15,0x3b,0x6c,0x71,0x6e,0x44,0x22,0xcb,0xa0,0x88,0xcd,0x0a,
+0x5a,0x50,0x29,0x7c,0x5c,0xd6,0x6c,0xd2,0xe0,0x7f,0xcd,0x02,
+0x92,0x21,0x4c,0x2c,0x92,0xee };
+static const BYTE ecdsaSig[] = {
+0x30,0x46,0x02,0x21,0x00,0xd7,0x29,0xce,0x5a,0xef,0x74,0x85,
+0xd1,0x18,0x5f,0x6e,0xf1,0xba,0x53,0xd4,0xcd,0xdd,0xe0,0x5d,
+0xf1,0x5e,0x48,0x51,0xea,0x63,0xc0,0xe8,0xe2,0xf6,0xfa,0x4c,
+0xaf,0x02,0x21,0x00,0xe3,0x94,0x15,0x3b,0x6c,0x71,0x6e,0x44,
+0x22,0xcb,0xa0,0x88,0xcd,0x0a,0x5a,0x50,0x29,0x7c,0x5c,0xd6,
+0x6c,0xd2,0xe0,0x7f,0xcd,0x02,0x92,0x21,0x4c,0x2c,0x92,0xee };
+static const BYTE eccPubKey[] = {
+0x30,0x59,0x30,0x13,0x06,0x07,0x2a,0x86,0x48,0xce,0x3d,0x02,
+0x01,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x03,0x01,0x07,0x03,
+0x42,0x00,0x04,0xed,0xfc,0x77,0xd8,0xb9,0xe7,0xf3,0xf8,0xce,
+0x13,0xb8,0x7f,0x0f,0x78,0xea,0x73,0x87,0x29,0x10,0xe1,0x6d,
+0x10,0xce,0x57,0x60,0x3b,0x3e,0xb4,0x5f,0x0d,0x20,0xc1,0xeb,
+0x6d,0x74,0xe9,0x7b,0x11,0x51,0x9a,0x00,0xe8,0xe9,0x12,0x84,
+0xb9,0x07,0x7e,0x7b,0x62,0x67,0x12,0x67,0x08,0xe5,0x2e,0x27,
+0xce,0xa2,0x57,0x15,0xad,0xc5,0x1f };
+
+static void testECDSACert(void)
+{
+ DWORD decode_flags = CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG;
+ CERT_SIGNED_CONTENT_INFO *info;
+ CERT_PUBLIC_KEY_INFO *pubkey;
+ CERT_ECC_SIGNATURE *ecc_sig;
+ LPSTR *ecc_curve;
+ DWORD size;
+ BOOL ret;
+ int i;
+
+ info = NULL;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT, eccCert, sizeof(eccCert), decode_flags,
+ NULL, &info, &size);
+ ok(ret, "CryptDecodeObjectEx failed with %d\n", GetLastError());
+
+ ok(!strcmp(info->SignatureAlgorithm.pszObjId, szOID_ECDSA_SHA256),
+ "Expected 1.2.840.10045.4.3.2, got %s\n", info->SignatureAlgorithm.pszObjId);
+ ok(!info->SignatureAlgorithm.Parameters.cbData,
+ "Expected no parameter data, got %d bytes\n", info->SignatureAlgorithm.Parameters.cbData);
+ ok(!info->SignatureAlgorithm.Parameters.pbData,
+ "Expected no parameter data, got %p pointer\n", info->SignatureAlgorithm.Parameters.pbData);
+
+ ok(info->Signature.cbData == sizeof(ecdsaSig),
+ "Expected %d bytes, got %d\n", (int)sizeof(ecdsaSig), info->Signature.cbData);
+ ok(info->Signature.pbData != NULL, "Got NULL pointer\n");
+ ok(!info->Signature.cUnusedBits, "Expected no unused bytes, got %d\n", info->Signature.cUnusedBits);
+ for (i = 0; i < info->Signature.cbData; i++)
+ {
+ ok(ecdsaSig[i] == info->Signature.pbData[i], "Expected %02x, got %02x at offset %d\n",
+ ecdsaSig[i], info->Signature.pbData[i], i);
+ }
+
+ ecc_sig = NULL;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, X509_ECC_SIGNATURE, info->Signature.pbData,
+ info->Signature.cbData, decode_flags, NULL, &ecc_sig, &size);
+ todo_wine ok(ret, "CryptDecodeObjectEx failed with %d\n", GetLastError());
+ if (ret)
+ {
+ ok(ecc_sig->r.cbData == 32, "Expected 32 bytes, got %d\n", ecc_sig->r.cbData);
+ ok(ecc_sig->r.pbData != NULL, "Got NULL pointer\n");
+ ok(ecc_sig->s.cbData == 32, "Expected 32 bytes, got %d\n", ecc_sig->s.cbData);
+ ok(ecc_sig->s.pbData != NULL, "Got NULL pointer\n");
+ for (i = 0; i < ecc_sig->r.cbData; i++)
+ {
+ ok(ecdsaSig[4+32-i] == ecc_sig->r.pbData[i], "Expected %02x, got %02x at offset %d\n",
+ ecdsaSig[4+32-i], ecc_sig->r.pbData[i], i);
+ }
+ for (i = 0; i < ecc_sig->s.cbData; i++)
+ {
+ ok(ecdsaSig[4+35+32-i] == ecc_sig->s.pbData[i], "Expected %02x, got %02x at offset %d\n",
+ ecdsaSig[4+35+32-i], ecc_sig->s.pbData[i], i);
+ }
+ LocalFree(ecc_sig);
+ }
+
+ LocalFree(info);
+
+ info = NULL;
+ decode_flags &= ~CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, X509_CERT, eccCert, sizeof(eccCert), decode_flags,
+ NULL, &info, &size);
+ ok(ret, "CryptDecodeObjectEx failed with %d\n", GetLastError());
+
+ ok(info->Signature.cbData == sizeof(ecdsaSig),
+ "Expected %d bytes, got %d\n", (int)sizeof(ecdsaSig), info->Signature.cbData);
+ ok(info->Signature.pbData != NULL, "Got NULL pointer\n");
+ ok(!info->Signature.cUnusedBits, "Expected no unused bytes, got %d\n", info->Signature.cUnusedBits);
+ for (i = 0; i < info->Signature.cbData; i++)
+ {
+ ok(ecdsaSig[sizeof(ecdsaSig)-i-1] == info->Signature.pbData[i], "Expected %02x, got %02x at offset %d\n",
+ ecdsaSig[sizeof(ecdsaSig)-i-1], info->Signature.pbData[i], i);
+ }
+
+ LocalFree(info);
+
+ pubkey = NULL;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, X509_PUBLIC_KEY_INFO, eccPubKey, sizeof(eccPubKey),
+ decode_flags, NULL, &pubkey, &size);
+ ok(ret, "CryptDecodeObjectEx failed with %d\n", GetLastError());
+
+ ok(!strcmp(pubkey->Algorithm.pszObjId, szOID_ECC_PUBLIC_KEY),
+ "Expected 1.2.840.10045.2.1, got %s\n", pubkey->Algorithm.pszObjId);
+ ok(pubkey->Algorithm.Parameters.cbData == 10,
+ "Expected 10 bytes parameters, got %d bytes\n", pubkey->Algorithm.Parameters.cbData);
+ ok(pubkey->Algorithm.Parameters.pbData != NULL,
+ "Expected pointer to parameters, got NULL\n");
+
+ ecc_curve = NULL;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, X509_OBJECT_IDENTIFIER, pubkey->Algorithm.Parameters.pbData,
+ pubkey->Algorithm.Parameters.cbData, decode_flags, NULL, &ecc_curve, &size);
+ todo_wine ok(ret || broken(GetLastError() == ERROR_FILE_NOT_FOUND /* < Vista */),
+ "CryptDecodeObjectEx failed with %d\n", GetLastError());
+ if (ret)
+ {
+ ok(!strcmp(*ecc_curve, szOID_ECC_CURVE_P256), "Expected 1.2.840.10045.3.1.7, got %s\n", *ecc_curve);
+ LocalFree(ecc_curve);
+ }
+
+ ecc_curve = NULL;
+ ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, szOID_ECC_PUBLIC_KEY, pubkey->Algorithm.Parameters.pbData,
+ pubkey->Algorithm.Parameters.cbData, decode_flags, NULL, &ecc_curve, &size);
+ todo_wine ok(ret || broken(GetLastError() == ERROR_FILE_NOT_FOUND /* < Vista */),
+ "CryptDecodeObjectEx failed with %d\n", GetLastError());
+ if (ret)
+ {
+ ok(!strcmp(*ecc_curve, szOID_ECC_CURVE_P256), "Expected 1.2.840.10045.3.1.7, got %s\n", *ecc_curve);
+ LocalFree(ecc_curve);
+ }
+
+ ok(pubkey->PublicKey.cbData == 65, "Expected 32 bytes parameters, got %d bytes\n", pubkey->PublicKey.cbData);
+ ok(pubkey->PublicKey.pbData != NULL, "Expected pointer to parameters, got NULL\n");
+ for (i = 0; i < pubkey->PublicKey.cbData; i++)
+ {
+ ok(eccPubKey[26+i] == pubkey->PublicKey.pbData[i], "Expected %02x, got %02x at offset %d\n",
+ eccPubKey[26+i], pubkey->PublicKey.pbData[i], i);
+ }
+
+ LocalFree(pubkey);
+}
+
START_TEST(encode)
{
static const DWORD encodings[] = { X509_ASN_ENCODING, PKCS_7_ASN_ENCODING,
@@ -8602,4 +8769,5 @@ START_TEST(encode)
test_decodeRsaPrivateKey(encodings[i]);
}
testPortPublicKeyInfo();
+ testECDSACert();
}
--
2.7.4

View File

@ -1,128 +0,0 @@
From 5c702d06817514162fa7bbc09bbc135db6319d7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 Sep 2017 03:08:58 +0200
Subject: crypt32/tets: Add test for verifying an ecdsa chain.
---
dlls/crypt32/tests/chain.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c
index e2a7633..2b69fd5 100644
--- a/dlls/crypt32/tests/chain.c
+++ b/dlls/crypt32/tests/chain.c
@@ -2889,6 +2889,59 @@ static const BYTE chain31_1[] = {
0x43,0x08,0xe5,0x78,0x2b,0x95,0xf3,0x75,0xb6,0x88,0xf0,0x6b,0x5c,0x5b,0x50,
0x04,0x91,0x3b,0x89,0x5a,0x60,0x1f,0xfc,0x36,0x53,0x32,0x36,0x0a,0x4d,0x03,
0x2c,0xd7 };
+static const BYTE ecc_crt[] = {
+0x30,0x82,0x01,0x46,0x30,0x81,0xec,0x02,0x09,0x00,0xe7,0x6b,0x26,0x86,0x0a,
+0x82,0xff,0xe9,0x30,0x0a,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x04,0x03,0x02,
+0x30,0x2b,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,
+0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x0c,0x04,0x57,0x69,0x6e,0x65,
+0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x03,0x0c,0x04,0x57,0x69,0x6e,0x65,
+0x30,0x1e,0x17,0x0d,0x31,0x37,0x30,0x39,0x32,0x37,0x31,0x33,0x34,0x31,0x30,
+0x34,0x5a,0x17,0x0d,0x32,0x37,0x30,0x39,0x32,0x35,0x31,0x33,0x34,0x31,0x30,
+0x34,0x5a,0x30,0x2b,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,
+0x44,0x45,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x0c,0x04,0x54,0x65,
+0x73,0x74,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x03,0x0c,0x04,0x54,0x65,
+0x73,0x74,0x30,0x59,0x30,0x13,0x06,0x07,0x2a,0x86,0x48,0xce,0x3d,0x02,0x01,
+0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x03,0x01,0x07,0x03,0x42,0x00,0x04,0xed,
+0xfc,0x77,0xd8,0xb9,0xe7,0xf3,0xf8,0xce,0x13,0xb8,0x7f,0x0f,0x78,0xea,0x73,
+0x87,0x29,0x10,0xe1,0x6d,0x10,0xce,0x57,0x60,0x3b,0x3e,0xb4,0x5f,0x0d,0x20,
+0xc1,0xeb,0x6d,0x74,0xe9,0x7b,0x11,0x51,0x9a,0x00,0xe8,0xe9,0x12,0x84,0xb9,
+0x07,0x7e,0x7b,0x62,0x67,0x12,0x67,0x08,0xe5,0x2e,0x27,0xce,0xa2,0x57,0x15,
+0xad,0xc5,0x1f,0x30,0x0a,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x04,0x03,0x02,
+0x03,0x49,0x00,0x30,0x46,0x02,0x21,0x00,0xd7,0x29,0xce,0x5a,0xef,0x74,0x85,
+0xd1,0x18,0x5f,0x6e,0xf1,0xba,0x53,0xd4,0xcd,0xdd,0xe0,0x5d,0xf1,0x5e,0x48,
+0x51,0xea,0x63,0xc0,0xe8,0xe2,0xf6,0xfa,0x4c,0xaf,0x02,0x21,0x00,0xe3,0x94,
+0x15,0x3b,0x6c,0x71,0x6e,0x44,0x22,0xcb,0xa0,0x88,0xcd,0x0a,0x5a,0x50,0x29,
+0x7c,0x5c,0xd6,0x6c,0xd2,0xe0,0x7f,0xcd,0x02,0x92,0x21,0x4c,0x2c,0x92,0xee };
+static const BYTE ecc_ca[] = {
+0x30,0x82,0x01,0x9f,0x30,0x82,0x01,0x46,0xa0,0x03,0x02,0x01,0x02,0x02,0x09,
+0x00,0xf1,0x54,0xae,0x21,0x2e,0x4d,0x31,0x9f,0x30,0x0a,0x06,0x08,0x2a,0x86,
+0x48,0xce,0x3d,0x04,0x03,0x02,0x30,0x2b,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,
+0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,
+0x0c,0x04,0x57,0x69,0x6e,0x65,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x03,
+0x0c,0x04,0x57,0x69,0x6e,0x65,0x30,0x1e,0x17,0x0d,0x31,0x37,0x30,0x39,0x32,
+0x37,0x31,0x33,0x33,0x39,0x31,0x35,0x5a,0x17,0x0d,0x32,0x37,0x30,0x39,0x32,
+0x35,0x31,0x33,0x33,0x39,0x31,0x35,0x5a,0x30,0x2b,0x31,0x0b,0x30,0x09,0x06,
+0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,
+0x04,0x0a,0x0c,0x04,0x57,0x69,0x6e,0x65,0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,
+0x04,0x03,0x0c,0x04,0x57,0x69,0x6e,0x65,0x30,0x59,0x30,0x13,0x06,0x07,0x2a,
+0x86,0x48,0xce,0x3d,0x02,0x01,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x03,0x01,
+0x07,0x03,0x42,0x00,0x04,0x3b,0x3c,0x34,0xc8,0x3f,0x15,0xea,0x02,0x68,0x46,
+0x69,0xdf,0x0c,0xa6,0xee,0x7a,0xd9,0x82,0x08,0x9b,0x37,0x53,0x42,0xf3,0x13,
+0x63,0xda,0x65,0x79,0xe8,0x04,0x9e,0x8c,0x77,0xc4,0x33,0x77,0xd9,0x5a,0x7f,
+0x60,0x7b,0x98,0xce,0xf3,0x96,0x56,0xd6,0xb5,0x8d,0x87,0x7a,0x00,0x2b,0xf3,
+0x70,0xb3,0x90,0x73,0xa0,0x56,0x06,0x3b,0x22,0xa3,0x53,0x30,0x51,0x30,0x1d,
+0x06,0x03,0x55,0x1d,0x0e,0x04,0x16,0x04,0x14,0x26,0xef,0x6f,0xe4,0xb5,0x24,
+0x2f,0x68,0x49,0x84,0xd9,0x89,0xa6,0xab,0x0c,0xf8,0x6d,0xf5,0xe5,0x0c,0x30,
+0x1f,0x06,0x03,0x55,0x1d,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x26,0xef,0x6f,
+0xe4,0xb5,0x24,0x2f,0x68,0x49,0x84,0xd9,0x89,0xa6,0xab,0x0c,0xf8,0x6d,0xf5,
+0xe5,0x0c,0x30,0x0f,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,0x05,0x30,
+0x03,0x01,0x01,0xff,0x30,0x0a,0x06,0x08,0x2a,0x86,0x48,0xce,0x3d,0x04,0x03,
+0x02,0x03,0x47,0x00,0x30,0x44,0x02,0x20,0x2b,0x6b,0x23,0x42,0x32,0xf2,0xcb,
+0x71,0xd7,0x5c,0xfa,0x5e,0x6c,0x19,0x31,0xd6,0x74,0xf7,0xc0,0xf8,0xc6,0x39,
+0x38,0xe9,0x79,0x4d,0x84,0x44,0x40,0x13,0x8e,0x43,0x02,0x20,0x34,0xc7,0x61,
+0xbb,0x18,0x1c,0x85,0x34,0xe3,0x4c,0x30,0x28,0x42,0x0e,0x06,0x65,0x68,0x1d,
+0x76,0x53,0x24,0xa0,0x27,0xa5,0x84,0x3b,0x2d,0xf3,0xec,0x27,0x60,0xb2 };
+
typedef struct _CONST_DATA_BLOB
{
@@ -3086,6 +3139,8 @@ static SYSTEMTIME jun2013 = { 2013, 6, 5, 6, 0, 0, 0, 0 };
static SYSTEMTIME oct2016 = { 2016, 10, 6, 1, 0, 0, 0, 0 };
/* Wednesday, Nov 17, 2016 */
static SYSTEMTIME nov2016 = { 2016, 11, 3, 17, 0, 0, 0, 0 };
+/* Wednesday, Nov 17, 2017 */
+static SYSTEMTIME nov2017 = { 2017, 11, 3, 17, 0, 0, 0, 0 };
typedef struct _ChainCheck
{
@@ -3873,6 +3928,25 @@ static ChainCheck chainCheckEmbeddedNullBroken = {
CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS },
1, simpleStatus27Broken },
0 };
+static CONST_DATA_BLOB chainECDSA[] = {
+ { sizeof(ecc_ca), ecc_ca },
+ { sizeof(ecc_crt), ecc_crt },
+};
+static const CERT_TRUST_STATUS elementStatusECDSA[] = {
+ { CERT_TRUST_NO_ERROR, CERT_TRUST_HAS_NAME_MATCH_ISSUER },
+ { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_KEY_MATCH_ISSUER | CERT_TRUST_IS_SELF_SIGNED },
+};
+static const SimpleChainStatusCheck simpleStatusECDSA[] = {
+ { sizeof(elementStatusECDSA) / sizeof(elementStatusECDSA[0]), elementStatusECDSA },
+};
+static ChainCheck chainCheckECDSA = {
+ { sizeof(chainECDSA) / sizeof(chainECDSA[0]), chainECDSA },
+ {
+ { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_PREFERRED_ISSUER },
+ { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 },
+ 1, simpleStatusECDSA
+ }, TODO_ERROR
+};
#define test_name_blob(a,b) _test_name_blob(__LINE__,a,b)
static void _test_name_blob(unsigned line, CERT_NAME_BLOB *blob, const char *exdata)
@@ -4167,6 +4241,16 @@ static void testGetCertChain(void)
ok(!chain->TrustStatus.dwErrorStatus, "chain->TrustStatus.dwErrorStatus = %x\n", chain->TrustStatus.dwErrorStatus);
pCertFreeCertificateChain(chain);
+ /* Test with ECDSA certificate */
+ chain = getChain(NULL, &chainCheckECDSA.certs, 0, TRUE, &nov2017, FALSE, 0);
+ if (chain)
+ {
+ todo_wine ok(chain->TrustStatus.dwErrorStatus == CERT_TRUST_IS_UNTRUSTED_ROOT,
+ "unexpected chain error status %08x\n", chain->TrustStatus.dwErrorStatus);
+ checkChainStatus(chain, &chainCheckECDSA.status, chainCheckECDSA.todo, "chainCheckECDSA", 0);
+ pCertFreeCertificateChain(chain);
+ }
+
/* Test HCCE_LOCAL_MACHINE */
ret = CertGetCertificateChain(HCCE_LOCAL_MACHINE, cert, &fileTime, store, &para, 0, NULL, &chain);
ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError());
--
2.7.4

View File

@ -1 +0,0 @@
Fixes: [35902] Implement support for validating ECDSA certificate chains

View File

@ -103,7 +103,6 @@ patch_enable_all ()
enable_configure_Absolute_RPATH="$1"
enable_crypt32_CMS_Certificates="$1"
enable_crypt32_CryptUnprotectMemory="$1"
enable_crypt32_ECDSA_Cert_Chains="$1"
enable_crypt32_MS_Root_Certs="$1"
enable_d2d1_ID2D1Factory1="$1"
enable_d3d11_Deferred_Context="$1"
@ -483,9 +482,6 @@ patch_enable ()
crypt32-CryptUnprotectMemory)
enable_crypt32_CryptUnprotectMemory="$2"
;;
crypt32-ECDSA_Cert_Chains)
enable_crypt32_ECDSA_Cert_Chains="$2"
;;
crypt32-MS_Root_Certs)
enable_crypt32_MS_Root_Certs="$2"
;;
@ -2263,20 +2259,6 @@ if test "$enable_nvapi_Stub_DLL" -eq 1; then
enable_nvcuda_CUDA_Support=1
fi
if test "$enable_bcrypt_BCryptGenerateKeyPair" -eq 1; then
if test "$enable_crypt32_ECDSA_Cert_Chains" -gt 1; then
abort "Patchset crypt32-ECDSA_Cert_Chains disabled, but bcrypt-BCryptGenerateKeyPair depends on that."
fi
enable_crypt32_ECDSA_Cert_Chains=1
fi
if test "$enable_bcrypt_BCryptDeriveKeyPBKDF2" -eq 1; then
if test "$enable_crypt32_ECDSA_Cert_Chains" -gt 1; then
abort "Patchset crypt32-ECDSA_Cert_Chains disabled, but bcrypt-BCryptDeriveKeyPBKDF2 depends on that."
fi
enable_crypt32_ECDSA_Cert_Chains=1
fi
if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
if test "$enable_Staging" -gt 1; then
abort "Patchset Staging disabled, but advapi32-Token_Integrity_Level depends on that."
@ -2659,28 +2641,8 @@ if test "$enable_avifile_dll16_AVIStreamGetFrame" -eq 1; then
) >> "$patchlist"
fi
# Patchset crypt32-ECDSA_Cert_Chains
# |
# | This patchset fixes the following Wine bugs:
# | * [#35902] Implement support for validating ECDSA certificate chains
# |
# | Modified files:
# | * dlls/crypt32/tests/chain.c, dlls/crypt32/tests/encode.c
# |
if test "$enable_crypt32_ECDSA_Cert_Chains" -eq 1; then
patch_apply crypt32-ECDSA_Cert_Chains/0006-crypt32-tests-Basic-tests-for-decoding-ECDSA-signed-.patch
patch_apply crypt32-ECDSA_Cert_Chains/0012-crypt32-tets-Add-test-for-verifying-an-ecdsa-chain.patch
(
printf '%s\n' '+ { "Michael Müller", "crypt32/tests: Basic tests for decoding ECDSA signed certificate.", 1 },';
printf '%s\n' '+ { "Michael Müller", "crypt32/tets: Add test for verifying an ecdsa chain.", 1 },';
) >> "$patchlist"
fi
# Patchset bcrypt-BCryptDeriveKeyPBKDF2
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * crypt32-ECDSA_Cert_Chains
# |
# | This patchset fixes the following Wine bugs:
# | * [#42704] Implement BCryptDeriveKeyPBKDF2
# |
@ -2696,9 +2658,6 @@ fi
# Patchset bcrypt-BCryptGenerateKeyPair
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * crypt32-ECDSA_Cert_Chains
# |
# | This patchset fixes the following Wine bugs:
# | * [#45312] Fix issue for Assassin's Creed : Syndicate
# |