crypt32: Fix some tests on Windows 98.

This commit is contained in:
Juan Lang 2009-02-09 14:39:11 -08:00 committed by Alexandre Julliard
parent 7cc615e631
commit 95b8f49dfd
1 changed files with 13 additions and 8 deletions

View File

@ -135,17 +135,19 @@ 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 && ok((!ctl &&
(GetLastError() == ERROR_INVALID_DATA || (GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE), /* win9x */ GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE /* win9x */)) ||
broken(ctl /* some win98 */),
"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 && ok((!ctl &&
(GetLastError() == ERROR_INVALID_DATA || (GetLastError() == ERROR_INVALID_DATA ||
GetLastError() == OSS_DATA_ERROR), /* win9x */ GetLastError() == CRYPT_E_UNEXPECTED_MSG_TYPE /* win9x */)) ||
broken(ctl /* some win98 */),
"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);
@ -228,12 +230,15 @@ static void testCTLProperties(void)
/* An implicit property */ /* An implicit property */
ret = CertGetCTLContextProperty(ctl, CERT_ACCESS_STATE_PROP_ID, NULL, ret = CertGetCTLContextProperty(ctl, CERT_ACCESS_STATE_PROP_ID, NULL,
&size); &size);
ok(ret, "CertGetCTLContextProperty failed: %08x\n", GetLastError()); ok(ret || broken(GetLastError() == CRYPT_E_NOT_FOUND /* some win98 */),
"CertGetCTLContextProperty failed: %08x\n", GetLastError());
ret = CertGetCTLContextProperty(ctl, CERT_ACCESS_STATE_PROP_ID, &access, ret = CertGetCTLContextProperty(ctl, CERT_ACCESS_STATE_PROP_ID, &access,
&size); &size);
ok(ret, "CertGetCTLContextProperty failed: %08x\n", GetLastError()); ok(ret || broken(GetLastError() == CRYPT_E_NOT_FOUND /* some win98 */),
ok(!(access & CERT_ACCESS_STATE_WRITE_PERSIST_FLAG), "CertGetCTLContextProperty failed: %08x\n", GetLastError());
"Didn't expect a persisted cert\n"); if (ret)
ok(!(access & CERT_ACCESS_STATE_WRITE_PERSIST_FLAG),
"Didn't expect a persisted cert\n");
checkHash(signedCTLWithCTLInnerContent, checkHash(signedCTLWithCTLInnerContent,
sizeof(signedCTLWithCTLInnerContent), CALG_SHA1, ctl, CERT_HASH_PROP_ID); sizeof(signedCTLWithCTLInnerContent), CALG_SHA1, ctl, CERT_HASH_PROP_ID);