Commit 51571ba5 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ldap: Use SECPKG_ATTR_SESSION_KEY to retrieve the key size.

parent 26c19ea6
......@@ -220,6 +220,14 @@ static int fill_auth_identity( const sasl_interact_t *prompts, SEC_WINNT_AUTH_ID
return SASL_OK;
}
static ULONG get_key_size( CtxtHandle *ctx )
{
SecPkgContext_SessionKey key;
if (QueryContextAttributesA( ctx, SECPKG_ATTR_SESSION_KEY, &key )) return 0;
FreeContextBuffer( key.SessionKey );
return key.SessionKeyLength * 8;
}
int sasl_client_start( sasl_conn_t *handle, const char *mechlist, sasl_interact_t **prompts,
const char **clientout, unsigned int *clientoutlen, const char **mech )
{
......@@ -287,14 +295,9 @@ int sasl_client_step( sasl_conn_t *handle, const char *serverin, unsigned int se
if (status == SEC_I_CONTINUE_NEEDED) return SASL_CONTINUE;
else
{
SecPkgContext_KeyInfoA key;
SecPkgContext_Sizes sizes;
status = QueryContextAttributesA( &conn->ctxt_handle, SECPKG_ATTR_KEY_INFO, &key );
if (status != SEC_E_OK) return SASL_FAIL;
FreeContextBuffer( key.sSignatureAlgorithmName );
FreeContextBuffer( key.sEncryptAlgorithmName );
conn->ssf = key.KeySize;
conn->ssf = get_key_size( &conn->ctxt_handle );
status = QueryContextAttributesA( &conn->ctxt_handle, SECPKG_ATTR_SIZES, &sizes );
if (status != SEC_E_OK) return SASL_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment