crypt32: Fix several test failures in win9x.

This commit is contained in:
James Hawkins 2008-09-02 22:46:44 -05:00 committed by Alexandre Julliard
parent 094545079c
commit 12330b433e
1 changed files with 18 additions and 6 deletions

View File

@ -117,13 +117,17 @@ static void testCreateCTL(void)
"expected E_INVALIDARG, got %08x\n", GetLastError()); "expected E_INVALIDARG, got %08x\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ctl = CertCreateCTLContext(X509_ASN_ENCODING, NULL, 0); ctl = CertCreateCTLContext(X509_ASN_ENCODING, NULL, 0);
ok(!ctl && GetLastError() == ERROR_INVALID_DATA, ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == OSS_MORE_INPUT), /* win9x */
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
/* An empty CTL can't be created.. */ /* An empty CTL can't be created.. */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ctl = CertCreateCTLContext(X509_ASN_ENCODING, emptyCTL, sizeof(emptyCTL)); ctl = CertCreateCTLContext(X509_ASN_ENCODING, emptyCTL, sizeof(emptyCTL));
ok(!ctl && GetLastError() == ERROR_INVALID_DATA, ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == OSS_DATA_ERROR), /* win9x */
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
/* Nor can any of these "signed" CTLs whose inner content OID isn't /* Nor can any of these "signed" CTLs whose inner content OID isn't
@ -131,19 +135,25 @@ static void testCreateCTL(void)
*/ */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ctl = CertCreateCTLContext(X509_ASN_ENCODING, signedCTL, sizeof(signedCTL)); ctl = CertCreateCTLContext(X509_ASN_ENCODING, signedCTL, sizeof(signedCTL));
ok(!ctl && GetLastError() == ERROR_INVALID_DATA, ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE), /* win9x */
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ctl = CertCreateCTLContext(X509_ASN_ENCODING, ctlWithOneEntry, ctl = CertCreateCTLContext(X509_ASN_ENCODING, ctlWithOneEntry,
sizeof(ctlWithOneEntry)); sizeof(ctlWithOneEntry));
ok(!ctl && GetLastError() == ERROR_INVALID_DATA, ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == OSS_DATA_ERROR), /* win9x */
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ctl = CertCreateCTLContext(X509_ASN_ENCODING, ctl = CertCreateCTLContext(X509_ASN_ENCODING,
signedCTLWithSubjectAlgorithm, sizeof(signedCTLWithSubjectAlgorithm)); signedCTLWithSubjectAlgorithm, sizeof(signedCTLWithSubjectAlgorithm));
ok(!ctl && GetLastError() == ERROR_INVALID_DATA, ok(!ctl &&
(GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE), /* win9x */
"expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(), "expected ERROR_INVALID_DATA, got %d (0x%08x)\n", GetLastError(),
GetLastError()); GetLastError());
/* This signed CTL with the appropriate inner content type can be decoded. /* This signed CTL with the appropriate inner content type can be decoded.
@ -349,7 +359,9 @@ static void testAddCTLToStore(void)
signedCTLWithCTLInnerContentAndBadSig, signedCTLWithCTLInnerContentAndBadSig,
sizeof(signedCTLWithCTLInnerContentAndBadSig), CERT_STORE_ADD_NEW, sizeof(signedCTLWithCTLInnerContentAndBadSig), CERT_STORE_ADD_NEW,
NULL); NULL);
ok(!ret && GetLastError() == CRYPT_E_EXISTS, ok(!ret &&
(GetLastError() == CRYPT_E_EXISTS ||
GetLastError() == CRYPT_E_NOT_FOUND), /* win9x */
"expected CRYPT_E_EXISTS, got %08x\n", GetLastError()); "expected CRYPT_E_EXISTS, got %08x\n", GetLastError());
CertCloseStore(store, 0); CertCloseStore(store, 0);