From 1ff1285235de1329af330bdbb20025a6a47c71af Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 17 Aug 1997 16:38:07 +0000 Subject: [PATCH] (gss_accept_sec_context): don't always pass server == NULL to krb5_rd_req. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3045 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/accept_sec_context.c | 14 +++++++++----- lib/gssapi/krb5/accept_sec_context.c | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/gssapi/accept_sec_context.c b/lib/gssapi/accept_sec_context.c index c2dd39ce0..1ea9ecfb0 100644 --- a/lib/gssapi/accept_sec_context.c +++ b/lib/gssapi/accept_sec_context.c @@ -64,9 +64,11 @@ OM_uint32 gss_accept_sec_context gssapi_krb5_init (); - *context_handle = malloc(sizeof(**context_handle)); - if (*context_handle == NULL) - return GSS_S_FAILURE; + if (*context_handle != GSS_C_NO_CONTEXT) { + *context_handle = malloc(sizeof(**context_handle)); + if (*context_handle == GSS_C_NO_CONTEXT) + return GSS_S_FAILURE; + } (*context_handle)->auth_context = NULL; (*context_handle)->source = NULL; @@ -102,8 +104,10 @@ OM_uint32 gss_accept_sec_context kret = krb5_rd_req (gssapi_krb5_context, &(*context_handle)->auth_context, &indata, - /*server*/ NULL, /* XXX */ - NULL, + (acceptor_cred_handle == GSS_C_NO_CREDENTIAL) ? NULL + : acceptor_cred_handle->principal, + (acceptor_cred_handle == GSS_C_NO_CREDENTIAL) ? NULL + : acceptor_cred_handle->keytab, &ap_options, &ticket); if (kret) { diff --git a/lib/gssapi/krb5/accept_sec_context.c b/lib/gssapi/krb5/accept_sec_context.c index c2dd39ce0..1ea9ecfb0 100644 --- a/lib/gssapi/krb5/accept_sec_context.c +++ b/lib/gssapi/krb5/accept_sec_context.c @@ -64,9 +64,11 @@ OM_uint32 gss_accept_sec_context gssapi_krb5_init (); - *context_handle = malloc(sizeof(**context_handle)); - if (*context_handle == NULL) - return GSS_S_FAILURE; + if (*context_handle != GSS_C_NO_CONTEXT) { + *context_handle = malloc(sizeof(**context_handle)); + if (*context_handle == GSS_C_NO_CONTEXT) + return GSS_S_FAILURE; + } (*context_handle)->auth_context = NULL; (*context_handle)->source = NULL; @@ -102,8 +104,10 @@ OM_uint32 gss_accept_sec_context kret = krb5_rd_req (gssapi_krb5_context, &(*context_handle)->auth_context, &indata, - /*server*/ NULL, /* XXX */ - NULL, + (acceptor_cred_handle == GSS_C_NO_CREDENTIAL) ? NULL + : acceptor_cred_handle->principal, + (acceptor_cred_handle == GSS_C_NO_CREDENTIAL) ? NULL + : acceptor_cred_handle->keytab, &ap_options, &ticket); if (kret) {