Implement gss_krb5_set_allowable_enctypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18974 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -421,13 +421,41 @@ gss_krb5_free_lucid_sec_context(OM_uint32 *minor_status, void *c)
|
||||
*/
|
||||
|
||||
OM_uint32
|
||||
gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status,
|
||||
gss_krb5_set_allowable_enctypes(OM_uint32 *min_status,
|
||||
gss_cred_id_t cred,
|
||||
OM_uint32 num_enctypes,
|
||||
krb5_enctype *enctypes)
|
||||
int32_t *enctypes)
|
||||
{
|
||||
*minor_status = 0;
|
||||
return GSS_S_COMPLETE;
|
||||
OM_uint32 maj_status;
|
||||
gss_buffer_desc buffer;
|
||||
krb5_storage *sp;
|
||||
krb5_data data;
|
||||
|
||||
sp = krb5_storage_emem();
|
||||
if (sp == NULL) {
|
||||
*min_status = ENOMEM;
|
||||
maj_status = GSS_S_FAILURE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
while(*enctypes) {
|
||||
krb5_store_int32(sp, *enctypes);
|
||||
enctypes++;
|
||||
}
|
||||
|
||||
krb5_storage_to_data(sp, &data);
|
||||
|
||||
buffer.value = data.data;
|
||||
buffer.length = data.length;
|
||||
|
||||
maj_status = gss_set_cred_option(min_status,
|
||||
&cred,
|
||||
GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X,
|
||||
&buffer);
|
||||
out:
|
||||
if (sp)
|
||||
krb5_storage_free(sp);
|
||||
return maj_status;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user