secur32: Report SecPkgContext_ConnectionInfo in bits, not bytes.

This commit is contained in:
Jacek Caban 2013-02-27 15:36:18 +01:00 committed by Alexandre Julliard
parent 5f3c38ed61
commit 64c84ef5c4
2 changed files with 10 additions and 2 deletions

View File

@ -309,9 +309,9 @@ SECURITY_STATUS schan_imp_get_connection_info(schan_imp_session session,
info->dwProtocol = schannel_get_protocol(proto);
info->aiCipher = schannel_get_cipher_algid(alg);
info->dwCipherStrength = pgnutls_cipher_get_key_size(alg);
info->dwCipherStrength = pgnutls_cipher_get_key_size(alg) * 8;
info->aiHash = schannel_get_mac_algid(mac);
info->dwHashStrength = pgnutls_mac_get_key_size(mac);
info->dwHashStrength = pgnutls_mac_get_key_size(mac) * 8;
info->aiExch = schannel_get_kx_algid(kx);
/* FIXME: info->dwExchStrength? */
info->dwExchStrength = 0;

View File

@ -592,6 +592,7 @@ static void test_communication(void)
CredHandle cred_handle;
CtxtHandle context;
SecPkgContext_StreamSizes sizes;
SecPkgContext_ConnectionInfo conn_info;
CERT_CONTEXT *cert;
SecBufferDesc buffers[2];
@ -754,6 +755,13 @@ static void test_communication(void)
pCertFreeCertificateContext(cert);
}
status = pQueryContextAttributesA(&context, SECPKG_ATTR_CONNECTION_INFO, (void*)&conn_info);
ok(status == SEC_E_OK, "QueryContextAttributesW(SECPKG_ATTR_CONNECTION_INFO) failed: %08x\n", status);
if(status == SEC_E_OK) {
ok(conn_info.dwCipherStrength == 128, "conn_info.dwCipherStrength = %d\n", conn_info.dwCipherStrength);
ok(conn_info.dwHashStrength >= 128, "conn_info.dwHashStrength = %d\n", conn_info.dwHashStrength);
}
pQueryContextAttributesA(&context, SECPKG_ATTR_STREAM_SIZES, &sizes);
reset_buffers(&buffers[0]);