Skip to content
Snippets Groups Projects
Commit 2e288006 authored by Jon Robertson's avatar Jon Robertson
Browse files

Added ability to delete enctypes from a keytab.

Added patch from Alf Wachsmann to add a command allowing the deletion of
enctypes from an existing keytab.
parent 9ef61287
No related branches found
No related tags found
No related merge requests found
...@@ -891,6 +891,39 @@ getKeytypes(spp) ...@@ -891,6 +891,39 @@ getKeytypes(spp)
OUTPUT: OUTPUT:
RETVAL RETVAL
void
delKeytypes(spp,enctype)
sprincipal_t *spp
char *enctype
CODE:
{
krb5_key_data *new_key_data = malloc(spp->principal.n_key_data * sizeof(*new_key_data));
krb5_enctype *etypes = malloc(sizeof(*etypes));
int i, j;
krb5_string_to_enctype(spp->handle->context, enctype, etypes);
for (i = 0, j = 0; i < spp->principal.n_key_data; ++i) {
krb5_key_data *key = &spp->principal.key_data[i];
if (*etypes == key->key_data_type[0]) {
int16_t ignore = 1;
kadm5_free_key_data (spp->handle, &ignore, key);
} else {
new_key_data[j++] = *key;
}
}
free (spp->principal.key_data);
spp->principal.n_key_data = j;
spp->principal.key_data = new_key_data;
spp->mask |= KADM5_KEY_DATA;
spp->handle->modcount++;
}
SV * SV *
getPassword(spp) getPassword(spp)
sprincipal_t *spp sprincipal_t *spp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment