[28619] in Kerberos

home help back first fref pref prev next nref lref last post

Question about the use of AcceptSecurityContext

daemon@ATHENA.MIT.EDU (Markus Moeller)
Wed Oct 31 17:57:29 2007

To: kerberos@mit.edu
From: "Markus Moeller" <huaraz@moeller.plus.com>
Date: Wed, 31 Oct 2007 21:56:40 -0000
Message-ID: <fgatmt$kt4$1@ger.gmane.org>
X-Complaints-To: usenet@ger.gmane.org
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: kerberos-bounces@mit.edu

I am working on a GSS server  application on windows using the below calls. 
The problem I have is that the application crashes in AcceptSecurityContext. 
I noticed when I change context to being non NULL the application doesn't 
crash. I compared with the GSSserver sample and it also uses NULL to start 
with. Any idea what is wrong in the below ?

Thank you
Markus


CredHandle  server_creds;
SecBufferDesc  input_desc;
SecBufferDesc  output_desc;
SecBuffer  send_tok, recv_tok;
CtxtHandle  new_context;
PCtxtHandle  context = NULL;
ULONG      global_asc_flags = ASC_REQ_ALLOCATE_MEMORY | ASC_REQ_MUTUAL_AUTH;
ULONG     * ret_flags=0;
SECURITY_STATUS  maj_stat;
TimeStamp  expiry;


new_context.dwUpper = 0;
new_context.dwLower = 0;

input_desc.cBuffers = 1;
input_desc.ulVersion = SECBUFFER_VERSION;
input_desc.pBuffers = &recv_tok;

output_desc.cBuffers = 1;
output_desc.ulVersion = SECBUFFER_VERSION;
output_desc.pBuffers = &send_tok;

recv_tok.cbBuffer = (unsigned long)inputTokenLength;
recv_tok.BufferType = SECBUFFER_TOKEN;
recv_tok.pvBuffer = (char *)malloc(inputTokenLength);
memcpy(recv_tok.pvBuffer,inputToken,inputTokenLength);

ServiceName="test/hostname";

maj_stat = AcquireCredentialsHandle(ServiceName,
                      "Kerberos",
                     SECPKG_CRED_INBOUND,
                     NULL,                       // no logon id
                     NULL,                       // no auth data
                     NULL,                       // no get key fn
                     NULL,                       // no get key arg
                     &server_creds,
                     &expiry);

if (maj_stat != SEC_E_OK) {
   logSSPIError ("AcquireCredentialsHandle failed", maj_stat);
}

send_tok.cbBuffer = 0;
send_tok.pvBuffer = NULL;
send_tok.BufferType = SECBUFFER_TOKEN;
maj_stat = AcceptSecurityContext( &server_creds,
                                  context,
                                  &input_desc,
                                  global_asc_flags,
                                  SECURITY_NATIVE_DREP,
                                  &new_context,
                                  &output_desc,
                                  ret_flags,
                                  &expiry);




________________________________________________
Kerberos mailing list           Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos

home help back first fref pref prev next nref lref last post