diff options
| author | Greg Hudson <ghudson@mit.edu> | 2011-09-21 16:28:54 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2011-09-21 16:28:54 +0000 |
| commit | 237e57c297708c8009cf2af4833b78abc4e05bbc (patch) | |
| tree | 14a0837807841de1b1211b1ecb7a69131c24d476 /src/include | |
| parent | e3e006d3aedccb88d5238d0175c81a6bf535c18f (diff) | |
| download | krb5-237e57c297708c8009cf2af4833b78abc4e05bbc.tar.gz krb5-237e57c297708c8009cf2af4833b78abc4e05bbc.tar.xz krb5-237e57c297708c8009cf2af4833b78abc4e05bbc.zip | |
Add KRB5_TL_STRING_ATTRS and libkdb5 accessors
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25214 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/kdb.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/include/kdb.h b/src/include/kdb.h index b666225e6..31f48b151 100644 --- a/src/include/kdb.h +++ b/src/include/kdb.h @@ -145,6 +145,13 @@ typedef struct _krb5_tl_data { krb5_octet * tl_data_contents; } krb5_tl_data; +/* String attributes (currently stored inside tl-data) map C string keys to + * values. They can be set via kadmin and consumed by KDC plugins. */ +typedef struct krb5_string_attr_st { + char *key; + char *value; +} krb5_string_attr; + /* * If this ever changes up the version number and make the arrays be as * big as necessary. @@ -235,6 +242,10 @@ typedef struct __krb5_key_salt_tuple { #define KRB5_TL_ACTKVNO 0x0009 #define KRB5_TL_MKEY_AUX 0x000a +/* String attributes may not always be represented in tl-data. kadmin clients + * must use the modify_strings and get_strings RPCs. */ +#define KRB5_TL_STRING_ATTRS 0x000b + #define KRB5_TL_PAC_LOGON_INFO 0x0100 /* NDR encoded validation info */ #define KRB5_TL_SERVER_REFERRAL 0x0200 /* ASN.1 encoded ServerReferralInfo */ #define KRB5_TL_SVR_REFERRAL_DATA 0x0300 /* ASN.1 encoded PA-SVR-REFERRAL-DATA */ @@ -538,6 +549,23 @@ krb5_dbe_lookup_last_admin_unlock( krb5_context context, krb5_db_entry * entry, krb5_timestamp * stamp); +/* Retrieve the set of string attributes in entry, in no particular order. + * Free *strings_out with krb5_dbe_free_strings when done. */ +krb5_error_code +krb5_dbe_get_strings(krb5_context context, krb5_db_entry *entry, + krb5_string_attr **strings_out, int *count_out); + +/* Retrieve a single string attribute from entry, or NULL if there is no + * attribute for key. Free *value_out with krb5_dbe_free_string when done. */ +krb5_error_code +krb5_dbe_get_string(krb5_context context, krb5_db_entry *entry, + const char *key, char **value_out); + +/* Change or add a string attribute in entry, or delete it if value is NULL. */ +krb5_error_code +krb5_dbe_set_string(krb5_context context, krb5_db_entry *entry, + const char *key, const char *value); + krb5_error_code krb5_dbe_delete_tl_data( krb5_context context, krb5_db_entry * entry, @@ -741,6 +769,12 @@ krb5_dbe_free_mkey_aux_list(krb5_context, krb5_mkey_aux_node *); void krb5_dbe_free_tl_data(krb5_context, krb5_tl_data *); +void +krb5_dbe_free_strings(krb5_context, krb5_string_attr *, int count); + +void +krb5_dbe_free_string(krb5_context, char *); + #define KRB5_KDB_DEF_FLAGS 0 #define KDB_MAX_DB_NAME 128 |
