(acquire_acceptor_cred): check that the acceptor exists in the keytab

before returning ok.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16336 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-12-01 15:50:42 +00:00
parent 449a5b09a7
commit 1cff67e8ce
2 changed files with 18 additions and 0 deletions

View File

@@ -239,12 +239,21 @@ static OM_uint32 acquire_acceptor_cred
{ {
OM_uint32 ret; OM_uint32 ret;
krb5_error_code kret; krb5_error_code kret;
krb5_keytab_entry entry;
kret = 0; kret = 0;
ret = GSS_S_FAILURE; ret = GSS_S_FAILURE;
kret = get_keytab(&handle->keytab); kret = get_keytab(&handle->keytab);
if (kret) if (kret)
goto end; goto end;
/* check that the requested principal exists in the keytab */
kret = krb5_kt_get_entry(gssapi_krb5_context, handle->keytab,
handle->principal, 0, 0, &entry);
if (kret)
goto end;
krb5_kt_free_entry(gssapi_krb5_context, &entry);
ret = GSS_S_COMPLETE; ret = GSS_S_COMPLETE;
end: end:

View File

@@ -239,12 +239,21 @@ static OM_uint32 acquire_acceptor_cred
{ {
OM_uint32 ret; OM_uint32 ret;
krb5_error_code kret; krb5_error_code kret;
krb5_keytab_entry entry;
kret = 0; kret = 0;
ret = GSS_S_FAILURE; ret = GSS_S_FAILURE;
kret = get_keytab(&handle->keytab); kret = get_keytab(&handle->keytab);
if (kret) if (kret)
goto end; goto end;
/* check that the requested principal exists in the keytab */
kret = krb5_kt_get_entry(gssapi_krb5_context, handle->keytab,
handle->principal, 0, 0, &entry);
if (kret)
goto end;
krb5_kt_free_entry(gssapi_krb5_context, &entry);
ret = GSS_S_COMPLETE; ret = GSS_S_COMPLETE;
end: end: