Commit 7681c358 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msv1_0: Add support for SECPKG_ATTR_KEY_INFO.

parent 19d18bbb
......@@ -30,6 +30,7 @@
#include "ntsecpkg.h"
#include "rpc.h"
#include "wincred.h"
#include "wincrypt.h"
#include "lmwksta.h"
#include "lmapibuf.h"
#include "lmerr.h"
......@@ -1134,7 +1135,6 @@ static NTSTATUS NTAPI ntlm_SpQueryContextAttributes( LSA_SEC_HANDLE handle, ULON
X(SECPKG_ATTR_ACCESS_TOKEN);
X(SECPKG_ATTR_AUTHORITY);
X(SECPKG_ATTR_DCE_INFO);
X(SECPKG_ATTR_KEY_INFO);
X(SECPKG_ATTR_LIFESPAN);
X(SECPKG_ATTR_NAMES);
X(SECPKG_ATTR_NATIVE_NAMES);
......@@ -1169,6 +1169,42 @@ static NTSTATUS NTAPI ntlm_SpQueryContextAttributes( LSA_SEC_HANDLE handle, ULON
info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE;
return SEC_E_OK;
}
case SECPKG_ATTR_KEY_INFO:
{
struct ntlm_ctx *ctx = (struct ntlm_ctx *)handle;
SecPkgContext_KeyInfoW *info = (SecPkgContext_KeyInfoW *)buf;
SEC_WCHAR *signature_alg;
ULONG signature_size, signature_algid;
if (ctx->flags & FLAG_NEGOTIATE_KEY_EXCHANGE)
{
signature_alg = (SEC_WCHAR *)L"HMAC-MD5";
signature_size = sizeof(L"HMAC-MD5");
signature_algid = 0xffffff76;
}
else
{
signature_alg = (SEC_WCHAR *)L"RSADSI RC4-CRC32";
signature_size = sizeof(L"RSADSI RC4-CRC32");
signature_algid = 0xffffff7c;
}
if (!(info->sSignatureAlgorithmName = RtlAllocateHeap( GetProcessHeap(), 0, signature_size )))
return SEC_E_INSUFFICIENT_MEMORY;
wcscpy( info->sSignatureAlgorithmName, signature_alg );
if (!(info->sEncryptAlgorithmName = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(L"RSADSI RC4") )))
{
RtlFreeHeap( GetProcessHeap(), 0, info->sSignatureAlgorithmName );
return SEC_E_INSUFFICIENT_MEMORY;
}
wcscpy( info->sEncryptAlgorithmName, L"RSADSI RC4" );
info->KeySize = sizeof(ctx->session_key) * 8;
info->SignatureAlgorithm = signature_algid;
info->EncryptAlgorithm = CALG_RC4;
return SEC_E_OK;
}
#undef X
default:
FIXME( "unknown attribute %lu\n", attr );
......
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