secur32: Added SECPKG_ATTR_SUPPORTED_PROTOCOLS tests.
This commit is contained in:
parent
e413b8a505
commit
79c5d5cc17
|
@ -166,6 +166,31 @@ static void test_strength(PCredHandle handle)
|
||||||
trace("strength %d - %d\n", strength.dwMinimumCipherStrength, strength.dwMaximumCipherStrength);
|
trace("strength %d - %d\n", strength.dwMinimumCipherStrength, strength.dwMaximumCipherStrength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_supported_protocols(CredHandle *handle, unsigned exprots)
|
||||||
|
{
|
||||||
|
SecPkgCred_SupportedProtocols protocols;
|
||||||
|
SECURITY_STATUS status;
|
||||||
|
|
||||||
|
status = pQueryCredentialsAttributesA(handle, SECPKG_ATTR_SUPPORTED_PROTOCOLS, &protocols);
|
||||||
|
ok(status == SEC_E_OK, "QueryCredentialsAttributes failed: %08x\n", status);
|
||||||
|
|
||||||
|
if(exprots)
|
||||||
|
ok(protocols.grbitProtocol == exprots, "protocols.grbitProtocol = %x, expected %x\n", protocols.grbitProtocol, exprots);
|
||||||
|
|
||||||
|
trace("Supported protocols:\n");
|
||||||
|
|
||||||
|
#define X(flag, name) do { if(protocols.grbitProtocol & flag) { trace(name "\n"); protocols.grbitProtocol &= ~flag; } }while(0)
|
||||||
|
X(SP_PROT_SSL2_CLIENT, "SSL 2 client");
|
||||||
|
X(SP_PROT_SSL3_CLIENT, "SSL 3 client");
|
||||||
|
X(SP_PROT_TLS1_0_CLIENT, "TLS 1.0 client");
|
||||||
|
X(SP_PROT_TLS1_1_CLIENT, "TLS 1.1 client");
|
||||||
|
X(SP_PROT_TLS1_2_CLIENT, "TLS 1.2 client");
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
if(protocols.grbitProtocol)
|
||||||
|
trace("Unknown flags: %x\n", protocols.grbitProtocol);
|
||||||
|
}
|
||||||
|
|
||||||
static void testAcquireSecurityContext(void)
|
static void testAcquireSecurityContext(void)
|
||||||
{
|
{
|
||||||
BOOL has_schannel = FALSE;
|
BOOL has_schannel = FALSE;
|
||||||
|
@ -261,8 +286,13 @@ static void testAcquireSecurityContext(void)
|
||||||
st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_OUTBOUND,
|
st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_OUTBOUND,
|
||||||
NULL, NULL, NULL, NULL, &cred, NULL);
|
NULL, NULL, NULL, NULL, &cred, NULL);
|
||||||
ok(st == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", st);
|
ok(st == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", st);
|
||||||
if(st == SEC_E_OK)
|
if(st == SEC_E_OK) {
|
||||||
|
st = pQueryCredentialsAttributesA(&cred, SECPKG_ATTR_SUPPORTED_PROTOCOLS, NULL);
|
||||||
|
ok(st == SEC_E_INTERNAL_ERROR, "QueryCredentialsAttributes failed: %08x, expected SEC_E_INTERNAL_ERROR\n", st);
|
||||||
|
|
||||||
|
test_supported_protocols(&cred, 0);
|
||||||
pFreeCredentialsHandle(&cred);
|
pFreeCredentialsHandle(&cred);
|
||||||
|
}
|
||||||
memset(&cred, 0, sizeof(cred));
|
memset(&cred, 0, sizeof(cred));
|
||||||
st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_OUTBOUND,
|
st = pAcquireCredentialsHandleA(NULL, unisp_name_a, SECPKG_CRED_OUTBOUND,
|
||||||
NULL, NULL, NULL, NULL, &cred, &exp);
|
NULL, NULL, NULL, NULL, &cred, &exp);
|
||||||
|
@ -650,6 +680,8 @@ static void test_communication(void)
|
||||||
ok(status == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", status);
|
ok(status == SEC_E_OK, "AcquireCredentialsHandleA failed: %08x\n", status);
|
||||||
if (status != SEC_E_OK) return;
|
if (status != SEC_E_OK) return;
|
||||||
|
|
||||||
|
test_supported_protocols(&cred_handle, SP_PROT_SSL3_CLIENT);
|
||||||
|
|
||||||
/* Initialize the connection */
|
/* Initialize the connection */
|
||||||
init_buffers(&buffers[0], 4, buf_size);
|
init_buffers(&buffers[0], 4, buf_size);
|
||||||
init_buffers(&buffers[1], 4, buf_size);
|
init_buffers(&buffers[1], 4, buf_size);
|
||||||
|
|
Loading…
Reference in New Issue