Jacek Caban : secur32: Report SecPkgContext_ConnectionInfo in bits, not bytes.
Alexandre Julliard
julliard at winehq.org
Wed Feb 27 14:41:58 CST 2013
Module: wine
Branch: master
Commit: 64c84ef5c409c03a8d2ccb993552b3eb976e854d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=64c84ef5c409c03a8d2ccb993552b3eb976e854d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Feb 27 15:36:18 2013 +0100
secur32: Report SecPkgContext_ConnectionInfo in bits, not bytes.
---
dlls/secur32/schannel_gnutls.c | 4 ++--
dlls/secur32/tests/schannel.c | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c
index fa68591..b273e96 100644
--- a/dlls/secur32/schannel_gnutls.c
+++ b/dlls/secur32/schannel_gnutls.c
@@ -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;
diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c
index ddcc87d..7d4c532 100644
--- a/dlls/secur32/tests/schannel.c
+++ b/dlls/secur32/tests/schannel.c
@@ -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]);
More information about the wine-cvs
mailing list