add krb5_keytype_to_enctypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4182 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -148,6 +148,31 @@ krb5_etype_to_string(krb5_context context,
|
||||
return 0;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
krb5_keytype_to_etypes(krb5_context context,
|
||||
krb5_keytype keytype,
|
||||
krb5_enctype **etypes)
|
||||
{
|
||||
krb5_enctype *tmp;
|
||||
struct encryption_type *e;
|
||||
int i;
|
||||
|
||||
*etypes = malloc((num_etypes + 1) * sizeof(*etypes));
|
||||
if (*etypes == NULL)
|
||||
return ENOMEM;
|
||||
i = 0;
|
||||
for (e = em; e < em + num_etypes; ++e)
|
||||
if (e->keytype == keytype)
|
||||
(*etypes)[i++] = e->type;
|
||||
tmp = realloc (*etypes, i * sizeof(*etypes));
|
||||
if (tmp == NULL) {
|
||||
free (*etypes);
|
||||
return ENOMEM;
|
||||
}
|
||||
*etypes = tmp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
krb5_etype_to_keytype(krb5_context context,
|
||||
krb5_enctype etype,
|
||||
|
Reference in New Issue
Block a user