Add krb5_princ_type() and krb5_princ_size() that appear in the MIT

API but not in Heimdal, and add commented out empty versions of
krb5_princ_set_realm_length(), krb5_princ_set_realm_data(),
krb5_princ_name(), and krb5_princ_component(), which also appear
in the MIT API, but which cannot be implemented in Heimdal until
a change is made to how some data is represented internally (as
these API functions expose that, as foolish as that is, but
that's how MIT did it, and some applications use it).
This commit is contained in:
thorpej 2000-08-09 23:27:19 +00:00
parent 22bda73efd
commit 24ceace29d
3 changed files with 78 additions and 2 deletions

View File

@ -1766,6 +1766,11 @@ krb5_password_key_proc __P((
krb5_const_pointer keyseed,
krb5_keyblock **key));
NAME_TYPE
krb5_princ_type __P((
krb5_context context,
krb5_principal principal));
krb5_realm*
krb5_princ_realm __P((
krb5_context context,
@ -1777,6 +1782,11 @@ krb5_princ_set_realm __P((
krb5_principal principal,
krb5_realm *realm));
unsigned int
krb5_princ_size __P((
krb5_context context,
krb5_principal principal));
krb5_error_code
krb5_principal2principalname __P((
PrincipalName *p,

View File

@ -40,7 +40,7 @@
#endif
#include "resolve.h"
RCSID("$Id: principal.c,v 1.1.1.2 2000/08/02 19:59:37 assar Exp $");
RCSID("$Id: principal.c,v 1.2 2000/08/09 23:27:21 thorpej Exp $");
#define princ_num_comp(P) ((P)->name.name_string.len)
#define princ_type(P) ((P)->name.name_type)
@ -330,6 +330,72 @@ krb5_princ_set_realm(krb5_context context,
princ_realm(principal) = *realm;
}
#if 0
/*
* XXX Implemented in MIT Kerberos, but not here. MIT Kerberos
* XXX internally represents realms as krb5_data, whereas we
* XXX use C strings, so it's not particularly straightforward
* XXX for us.
*/
void
krb5_princ_set_realm_length(krb5_context context,
krb5_principal principal,
int length)
{
/* XXX XXX XXX */
}
void
krb5_princ_set_realm_data(krb5_context context,
krb5_principal principal,
char *data)
{
/* XXX XXX XXX */
}
#endif
unsigned int
krb5_princ_size(krb5_context context,
krb5_principal principal)
{
return (principal->name.name_string.len);
}
NAME_TYPE
krb5_princ_type(krb5_context context,
krb5_principal principal)
{
return (principal->name.name_type);
}
#if 0
/*
* XXX Implemented in MIT Kerberos, but not here. MIT Kerberos
* XXX internally represents principal name components as krb5_data,
* XXX whereas we use C strings, so it's not particularly
* XXX straightforward for us.
*/
krb5_data *
krb5_princ_name(krb5_context context,
krb5_principal principal)
{
return (principal->name.name_string.val);
}
krb5_data *
krb5_princ_component(krb5_context context,
krb5_principal principal,
int idx)
{
return (&principal->name.name_string.val[idx]);
}
#endif
krb5_error_code
krb5_build_principal(krb5_context context,

View File

@ -1,2 +1,2 @@
major=12
minor=0
minor=1