Ken Thomases : secur32: Extract schan_imp_get_connection_info function.

Alexandre Julliard julliard at winehq.org
Mon Mar 14 14:29:43 CDT 2011


Module: wine
Branch: master
Commit: f7e598cfc866da7457f9160065987422ccd01ede
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f7e598cfc866da7457f9160065987422ccd01ede

Author: Ken Thomases <ken at codeweavers.com>
Date:   Sun Mar 13 18:57:25 2011 -0500

secur32: Extract schan_imp_get_connection_info function.

---

 dlls/secur32/schannel.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index dd1858d..7b00c1d 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -174,6 +174,25 @@ static unsigned int schan_imp_get_session_cipher_block_size(gnutls_session_t s)
     return schannel_get_cipher_block_size(cipher);
 }
 
+static SECURITY_STATUS schan_imp_get_connection_info(gnutls_session_t s,
+                                                     SecPkgContext_ConnectionInfo *info)
+{
+    gnutls_protocol_t proto = pgnutls_protocol_get_version(s);
+    gnutls_cipher_algorithm_t alg = pgnutls_cipher_get(s);
+    gnutls_mac_algorithm_t mac = pgnutls_mac_get(s);
+    gnutls_kx_algorithm_t kx = pgnutls_kx_get(s);
+
+    info->dwProtocol = schannel_get_protocol(proto);
+    info->aiCipher = schannel_get_cipher_algid(alg);
+    info->dwCipherStrength = pgnutls_cipher_get_key_size(alg);
+    info->aiHash = schannel_get_mac_algid(mac);
+    info->dwHashStrength = pgnutls_mac_get_key_size(mac);
+    info->aiExch = schannel_get_kx_algid(kx);
+    /* FIXME: info->dwExchStrength? */
+    info->dwExchStrength = 0;
+    return SEC_E_OK;
+}
+
 static SECURITY_STATUS schan_imp_get_session_peer_certificate(gnutls_session_t s,
                                                               PCCERT_CONTEXT *cert)
 {
@@ -1045,20 +1064,7 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW(
         case SECPKG_ATTR_CONNECTION_INFO:
         {
             SecPkgContext_ConnectionInfo *info = buffer;
-            gnutls_protocol_t proto = pgnutls_protocol_get_version(ctx->session);
-            gnutls_cipher_algorithm_t alg = pgnutls_cipher_get(ctx->session);
-            gnutls_mac_algorithm_t mac = pgnutls_mac_get(ctx->session);
-            gnutls_kx_algorithm_t kx = pgnutls_kx_get(ctx->session);
-
-            info->dwProtocol = schannel_get_protocol(proto);
-            info->aiCipher = schannel_get_cipher_algid(alg);
-            info->dwCipherStrength = pgnutls_cipher_get_key_size(alg);
-            info->aiHash = schannel_get_mac_algid(mac);
-            info->dwHashStrength = pgnutls_mac_get_key_size(mac);
-            info->aiExch = schannel_get_kx_algid(kx);
-            /* FIXME: info->dwExchStrength? */
-            info->dwExchStrength = 0;
-            return SEC_E_OK;
+            return schan_imp_get_connection_info(ctx->session, info);
         }
 
         default:




More information about the wine-cvs mailing list