crypt32(3/6): accept OSS errors
Juan Lang
juan.lang at gmail.com
Fri Jun 29 15:10:05 CDT 2007
--Juan
-------------- next part --------------
From 43736ea212f9f458e2474317a5ad8cdad75ac088 Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Fri, 29 Jun 2007 12:43:00 -0700
Subject: [PATCH] Accept OSS errors
---
dlls/crypt32/tests/crl.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c
index d47be6d..462d89f 100644
--- a/dlls/crypt32/tests/crl.c
+++ b/dlls/crypt32/tests/crl.c
@@ -87,22 +87,25 @@ static void init_function_pointers(void)
static void testCreateCRL(void)
{
PCCRL_CONTEXT context;
+ DWORD GLE;
context = CertCreateCRLContext(0, NULL, 0);
ok(!context && GetLastError() == E_INVALIDARG,
"Expected E_INVALIDARG, got %08x\n", GetLastError());
context = CertCreateCRLContext(X509_ASN_ENCODING, NULL, 0);
- ok(!context && GetLastError() == CRYPT_E_ASN1_EOD,
- "Expected CRYPT_E_ASN1_EOD, got %08x\n", GetLastError());
+ GLE = GetLastError();
+ ok(!context && (GLE == CRYPT_E_ASN1_EOD || GLE == OSS_MORE_INPUT),
+ "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
context = CertCreateCRLContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert));
- ok(!context && GetLastError() == CRYPT_E_ASN1_CORRUPT,
- "Expected CRYPT_E_ASN1_CORRUPT, got %08x\n", GetLastError());
+ GLE = GetLastError();
+ ok(!context && (GLE == CRYPT_E_ASN1_CORRUPT || GLE == OSS_DATA_ERROR),
+ "Expected CRYPT_E_ASN1_CORRUPT or OSS_DATA_ERROR, got %08x\n", GLE);
context = CertCreateCRLContext(X509_ASN_ENCODING, signedCRL,
sizeof(signedCRL) - 1);
- ok(!context && (GetLastError() == CRYPT_E_ASN1_EOD ||
- GetLastError() == CRYPT_E_ASN1_CORRUPT),
- "Expected CRYPT_E_ASN1_EOD or CRYPT_E_ASN1_CORRUPT, got %08x\n",
- GetLastError());
+ ok(!context && (GLE == CRYPT_E_ASN1_EOD || GLE == CRYPT_E_ASN1_CORRUPT ||
+ GLE == OSS_DATA_ERROR),
+ "Expected CRYPT_E_ASN1_EOD or CRYPT_E_ASN1_CORRUPT or OSS_DATA_ERROR, got %08x\n",
+ GLE);
context = CertCreateCRLContext(X509_ASN_ENCODING, signedCRL,
sizeof(signedCRL));
ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
@@ -120,6 +123,7 @@ static void testAddCRL(void)
CERT_STORE_CREATE_NEW_FLAG, NULL);
PCCRL_CONTEXT context;
BOOL ret;
+ DWORD GLE;
if (!store) return;
@@ -148,11 +152,13 @@ static void testAddCRL(void)
/* No CRL */
ret = CertAddEncodedCRLToStore(0, X509_ASN_ENCODING, NULL, 0, 0, NULL);
- ok(!ret && GetLastError() == CRYPT_E_ASN1_EOD,
- "Expected CRYPT_E_ASN1_EOD, got %08x\n", GetLastError());
+ GLE = GetLastError();
+ ok(!ret && (GLE == CRYPT_E_ASN1_EOD || GLE == OSS_MORE_INPUT),
+ "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, NULL, 0, 0, NULL);
- ok(!ret && GetLastError() == CRYPT_E_ASN1_EOD,
- "Expected CRYPT_E_ASN1_EOD, got %08x\n", GetLastError());
+ GLE = GetLastError();
+ ok(!ret && (GLE == CRYPT_E_ASN1_EOD || GLE == OSS_MORE_INPUT),
+ "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
/* Weird--bad add disposition leads to an access violation in Windows. */
ret = CertAddEncodedCRLToStore(0, X509_ASN_ENCODING, signedCRL,
--
1.4.1
More information about the wine-patches
mailing list