crypt32: Fix some tests on Windows 98.
This commit is contained in:
parent
7cc615e631
commit
95b8f49dfd
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue