Home | History | Annotate | Line # | Download | only in krb5
deprecated.c revision 1.1.1.2
      1      1.1   elric /*	$NetBSD: deprecated.c,v 1.1.1.2 2014/04/24 12:45:49 pettai Exp $	*/
      2      1.1   elric 
      3      1.1   elric /*
      4      1.1   elric  * Copyright (c) 1997 - 2009 Kungliga Tekniska Hgskolan
      5      1.1   elric  * (Royal Institute of Technology, Stockholm, Sweden).
      6      1.1   elric  * All rights reserved.
      7      1.1   elric  *
      8      1.1   elric  * Redistribution and use in source and binary forms, with or without
      9      1.1   elric  * modification, are permitted provided that the following conditions
     10      1.1   elric  * are met:
     11      1.1   elric  *
     12      1.1   elric  * 1. Redistributions of source code must retain the above copyright
     13      1.1   elric  *    notice, this list of conditions and the following disclaimer.
     14      1.1   elric  *
     15      1.1   elric  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1   elric  *    notice, this list of conditions and the following disclaimer in the
     17      1.1   elric  *    documentation and/or other materials provided with the distribution.
     18      1.1   elric  *
     19      1.1   elric  * 3. Neither the name of the Institute nor the names of its contributors
     20      1.1   elric  *    may be used to endorse or promote products derived from this software
     21      1.1   elric  *    without specific prior written permission.
     22      1.1   elric  *
     23      1.1   elric  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
     24      1.1   elric  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25      1.1   elric  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26      1.1   elric  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
     27      1.1   elric  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28      1.1   elric  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29      1.1   elric  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30      1.1   elric  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31      1.1   elric  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32      1.1   elric  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33      1.1   elric  * SUCH DAMAGE.
     34      1.1   elric  */
     35      1.1   elric 
     36  1.1.1.2  pettai #ifdef __GNUC__
     37  1.1.1.2  pettai /* For some GCCs there's no way to shut them up about deprecated functions */
     38  1.1.1.2  pettai #define KRB5_DEPRECATED_FUNCTION(x)
     39  1.1.1.2  pettai #endif
     40      1.1   elric 
     41      1.1   elric #include "krb5_locl.h"
     42      1.1   elric 
     43      1.1   elric #undef __attribute__
     44      1.1   elric #define __attribute__(x)
     45      1.1   elric 
     46      1.1   elric #ifndef HEIMDAL_SMALLER
     47      1.1   elric 
     48      1.1   elric /**
     49      1.1   elric  * Same as krb5_data_free(). MIT compat.
     50      1.1   elric  *
     51      1.1   elric  * Deprecated: use krb5_data_free().
     52      1.1   elric  *
     53      1.1   elric  * @param context Kerberos 5 context.
     54      1.1   elric  * @param data krb5_data to free.
     55      1.1   elric  *
     56      1.1   elric  * @ingroup krb5_deprecated
     57      1.1   elric  */
     58      1.1   elric 
     59      1.1   elric KRB5_LIB_FUNCTION void KRB5_LIB_CALL
     60      1.1   elric krb5_free_data_contents(krb5_context context, krb5_data *data)
     61  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
     62      1.1   elric {
     63      1.1   elric     krb5_data_free(data);
     64      1.1   elric }
     65      1.1   elric 
     66      1.1   elric /**
     67      1.1   elric  * Deprecated: keytypes doesn't exists, they are really enctypes.
     68      1.1   elric  *
     69      1.1   elric  * @ingroup krb5_deprecated
     70      1.1   elric  */
     71      1.1   elric 
     72      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
     73      1.1   elric krb5_keytype_to_enctypes_default (krb5_context context,
     74      1.1   elric 				  krb5_keytype keytype,
     75      1.1   elric 				  unsigned *len,
     76      1.1   elric 				  krb5_enctype **val)
     77  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
     78      1.1   elric {
     79      1.1   elric     unsigned int i, n;
     80      1.1   elric     krb5_enctype *ret;
     81      1.1   elric 
     82      1.1   elric     if (keytype != KEYTYPE_DES || context->etypes_des == NULL)
     83      1.1   elric 	return krb5_keytype_to_enctypes (context, keytype, len, val);
     84      1.1   elric 
     85      1.1   elric     for (n = 0; context->etypes_des[n]; ++n)
     86      1.1   elric 	;
     87      1.1   elric     ret = malloc (n * sizeof(*ret));
     88      1.1   elric     if (ret == NULL && n != 0) {
     89      1.1   elric 	krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
     90      1.1   elric 	return ENOMEM;
     91      1.1   elric     }
     92      1.1   elric     for (i = 0; i < n; ++i)
     93      1.1   elric 	ret[i] = context->etypes_des[i];
     94      1.1   elric     *len = n;
     95      1.1   elric     *val = ret;
     96      1.1   elric     return 0;
     97      1.1   elric }
     98      1.1   elric 
     99      1.1   elric 
    100      1.1   elric static struct {
    101      1.1   elric     const char *name;
    102      1.1   elric     krb5_keytype type;
    103      1.1   elric } keys[] = {
    104      1.1   elric     { "null", ENCTYPE_NULL },
    105      1.1   elric     { "des", ETYPE_DES_CBC_CRC },
    106      1.1   elric     { "des3", ETYPE_OLD_DES3_CBC_SHA1 },
    107      1.1   elric     { "aes-128", ETYPE_AES128_CTS_HMAC_SHA1_96 },
    108      1.1   elric     { "aes-256", ETYPE_AES256_CTS_HMAC_SHA1_96 },
    109      1.1   elric     { "arcfour", ETYPE_ARCFOUR_HMAC_MD5 },
    110      1.1   elric     { "arcfour-56", ETYPE_ARCFOUR_HMAC_MD5_56 }
    111      1.1   elric };
    112      1.1   elric 
    113      1.1   elric static int num_keys = sizeof(keys) / sizeof(keys[0]);
    114      1.1   elric 
    115      1.1   elric /**
    116      1.1   elric  * Deprecated: keytypes doesn't exists, they are really enctypes in
    117      1.1   elric  * most cases, use krb5_enctype_to_string().
    118      1.1   elric  *
    119      1.1   elric  * @ingroup krb5_deprecated
    120      1.1   elric  */
    121      1.1   elric 
    122      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    123      1.1   elric krb5_keytype_to_string(krb5_context context,
    124      1.1   elric 		       krb5_keytype keytype,
    125      1.1   elric 		       char **string)
    126  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    127      1.1   elric {
    128  1.1.1.2  pettai     const char *name = NULL;
    129      1.1   elric     int i;
    130      1.1   elric 
    131      1.1   elric     for(i = 0; i < num_keys; i++) {
    132      1.1   elric 	if(keys[i].type == keytype) {
    133      1.1   elric 	    name = keys[i].name;
    134      1.1   elric 	    break;
    135      1.1   elric 	}
    136      1.1   elric     }
    137      1.1   elric 
    138      1.1   elric     if(i >= num_keys) {
    139      1.1   elric 	krb5_set_error_message(context, KRB5_PROG_KEYTYPE_NOSUPP,
    140      1.1   elric 			       "key type %d not supported", keytype);
    141      1.1   elric 	return KRB5_PROG_KEYTYPE_NOSUPP;
    142      1.1   elric     }
    143      1.1   elric     *string = strdup(name);
    144      1.1   elric     if(*string == NULL) {
    145      1.1   elric 	krb5_set_error_message(context, ENOMEM,
    146      1.1   elric 			       N_("malloc: out of memory", ""));
    147      1.1   elric 	return ENOMEM;
    148      1.1   elric     }
    149      1.1   elric     return 0;
    150      1.1   elric }
    151      1.1   elric 
    152      1.1   elric /**
    153      1.1   elric  * Deprecated: keytypes doesn't exists, they are really enctypes in
    154      1.1   elric  * most cases, use krb5_string_to_enctype().
    155      1.1   elric  *
    156      1.1   elric  * @ingroup krb5_deprecated
    157      1.1   elric  */
    158      1.1   elric 
    159      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    160      1.1   elric krb5_string_to_keytype(krb5_context context,
    161      1.1   elric 		       const char *string,
    162      1.1   elric 		       krb5_keytype *keytype)
    163  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    164      1.1   elric {
    165      1.1   elric     char *end;
    166      1.1   elric     int i;
    167      1.1   elric 
    168      1.1   elric     for(i = 0; i < num_keys; i++)
    169      1.1   elric 	if(strcasecmp(keys[i].name, string) == 0){
    170      1.1   elric 	    *keytype = keys[i].type;
    171      1.1   elric 	    return 0;
    172      1.1   elric 	}
    173      1.1   elric 
    174      1.1   elric     /* check if the enctype is a number */
    175      1.1   elric     *keytype = strtol(string, &end, 0);
    176      1.1   elric     if(*end == '\0' && *keytype != 0) {
    177      1.1   elric 	if (krb5_enctype_valid(context, *keytype) == 0)
    178      1.1   elric 	    return 0;
    179      1.1   elric     }
    180      1.1   elric 
    181      1.1   elric     krb5_set_error_message(context, KRB5_PROG_KEYTYPE_NOSUPP,
    182      1.1   elric 			   "key type %s not supported", string);
    183      1.1   elric     return KRB5_PROG_KEYTYPE_NOSUPP;
    184      1.1   elric }
    185      1.1   elric 
    186      1.1   elric /**
    187      1.1   elric  * Deprecated: use krb5_get_init_creds() and friends.
    188      1.1   elric  *
    189      1.1   elric  * @ingroup krb5_deprecated
    190      1.1   elric  */
    191      1.1   elric 
    192      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_CALLCONV
    193      1.1   elric krb5_password_key_proc (krb5_context context,
    194      1.1   elric 			krb5_enctype type,
    195      1.1   elric 			krb5_salt salt,
    196      1.1   elric 			krb5_const_pointer keyseed,
    197      1.1   elric 			krb5_keyblock **key)
    198  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    199      1.1   elric {
    200      1.1   elric     krb5_error_code ret;
    201      1.1   elric     const char *password = (const char *)keyseed;
    202      1.1   elric     char buf[BUFSIZ];
    203      1.1   elric 
    204      1.1   elric     *key = malloc (sizeof (**key));
    205      1.1   elric     if (*key == NULL) {
    206      1.1   elric 	krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
    207      1.1   elric 	return ENOMEM;
    208      1.1   elric     }
    209      1.1   elric     if (password == NULL) {
    210      1.1   elric 	if(UI_UTIL_read_pw_string (buf, sizeof(buf), "Password: ", 0)) {
    211      1.1   elric 	    free (*key);
    212      1.1   elric 	    krb5_clear_error_message(context);
    213      1.1   elric 	    return KRB5_LIBOS_PWDINTR;
    214      1.1   elric 	}
    215      1.1   elric 	password = buf;
    216      1.1   elric     }
    217      1.1   elric     ret = krb5_string_to_key_salt (context, type, password, salt, *key);
    218      1.1   elric     memset (buf, 0, sizeof(buf));
    219      1.1   elric     return ret;
    220      1.1   elric }
    221      1.1   elric 
    222      1.1   elric /**
    223      1.1   elric  * Deprecated: use krb5_get_init_creds() and friends.
    224      1.1   elric  *
    225      1.1   elric  * @ingroup krb5_deprecated
    226      1.1   elric  */
    227      1.1   elric 
    228      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    229      1.1   elric krb5_get_in_tkt_with_password (krb5_context context,
    230      1.1   elric 			       krb5_flags options,
    231      1.1   elric 			       krb5_addresses *addrs,
    232      1.1   elric 			       const krb5_enctype *etypes,
    233      1.1   elric 			       const krb5_preauthtype *pre_auth_types,
    234      1.1   elric 			       const char *password,
    235      1.1   elric 			       krb5_ccache ccache,
    236      1.1   elric 			       krb5_creds *creds,
    237      1.1   elric 			       krb5_kdc_rep *ret_as_reply)
    238  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    239      1.1   elric {
    240      1.1   elric      return krb5_get_in_tkt (context,
    241      1.1   elric 			     options,
    242      1.1   elric 			     addrs,
    243      1.1   elric 			     etypes,
    244      1.1   elric 			     pre_auth_types,
    245      1.1   elric 			     krb5_password_key_proc,
    246      1.1   elric 			     password,
    247      1.1   elric 			     NULL,
    248      1.1   elric 			     NULL,
    249      1.1   elric 			     creds,
    250      1.1   elric 			     ccache,
    251      1.1   elric 			     ret_as_reply);
    252      1.1   elric }
    253      1.1   elric 
    254      1.1   elric static krb5_error_code KRB5_CALLCONV
    255      1.1   elric krb5_skey_key_proc (krb5_context context,
    256      1.1   elric 		    krb5_enctype type,
    257      1.1   elric 		    krb5_salt salt,
    258      1.1   elric 		    krb5_const_pointer keyseed,
    259      1.1   elric 		    krb5_keyblock **key)
    260      1.1   elric {
    261      1.1   elric     return krb5_copy_keyblock (context, keyseed, key);
    262      1.1   elric }
    263      1.1   elric 
    264      1.1   elric /**
    265      1.1   elric  * Deprecated: use krb5_get_init_creds() and friends.
    266      1.1   elric  *
    267      1.1   elric  * @ingroup krb5_deprecated
    268      1.1   elric  */
    269      1.1   elric 
    270      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    271      1.1   elric krb5_get_in_tkt_with_skey (krb5_context context,
    272      1.1   elric 			   krb5_flags options,
    273      1.1   elric 			   krb5_addresses *addrs,
    274      1.1   elric 			   const krb5_enctype *etypes,
    275      1.1   elric 			   const krb5_preauthtype *pre_auth_types,
    276      1.1   elric 			   const krb5_keyblock *key,
    277      1.1   elric 			   krb5_ccache ccache,
    278      1.1   elric 			   krb5_creds *creds,
    279      1.1   elric 			   krb5_kdc_rep *ret_as_reply)
    280  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    281      1.1   elric {
    282      1.1   elric     if(key == NULL)
    283      1.1   elric 	return krb5_get_in_tkt_with_keytab (context,
    284      1.1   elric 					    options,
    285      1.1   elric 					    addrs,
    286      1.1   elric 					    etypes,
    287      1.1   elric 					    pre_auth_types,
    288      1.1   elric 					    NULL,
    289      1.1   elric 					    ccache,
    290      1.1   elric 					    creds,
    291      1.1   elric 					    ret_as_reply);
    292      1.1   elric     else
    293      1.1   elric 	return krb5_get_in_tkt (context,
    294      1.1   elric 				options,
    295      1.1   elric 				addrs,
    296      1.1   elric 				etypes,
    297      1.1   elric 				pre_auth_types,
    298      1.1   elric 				krb5_skey_key_proc,
    299      1.1   elric 				key,
    300      1.1   elric 				NULL,
    301      1.1   elric 				NULL,
    302      1.1   elric 				creds,
    303      1.1   elric 				ccache,
    304      1.1   elric 				ret_as_reply);
    305      1.1   elric }
    306      1.1   elric 
    307      1.1   elric /**
    308      1.1   elric  * Deprecated: use krb5_get_init_creds() and friends.
    309      1.1   elric  *
    310      1.1   elric  * @ingroup krb5_deprecated
    311      1.1   elric  */
    312      1.1   elric 
    313      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_CALLCONV
    314      1.1   elric krb5_keytab_key_proc (krb5_context context,
    315      1.1   elric 		      krb5_enctype enctype,
    316      1.1   elric 		      krb5_salt salt,
    317      1.1   elric 		      krb5_const_pointer keyseed,
    318      1.1   elric 		      krb5_keyblock **key)
    319  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    320      1.1   elric {
    321      1.1   elric     krb5_keytab_key_proc_args *args  = rk_UNCONST(keyseed);
    322      1.1   elric     krb5_keytab keytab = args->keytab;
    323      1.1   elric     krb5_principal principal  = args->principal;
    324      1.1   elric     krb5_error_code ret;
    325      1.1   elric     krb5_keytab real_keytab;
    326      1.1   elric     krb5_keytab_entry entry;
    327      1.1   elric 
    328      1.1   elric     if(keytab == NULL)
    329      1.1   elric 	krb5_kt_default(context, &real_keytab);
    330      1.1   elric     else
    331      1.1   elric 	real_keytab = keytab;
    332      1.1   elric 
    333      1.1   elric     ret = krb5_kt_get_entry (context, real_keytab, principal,
    334      1.1   elric 			     0, enctype, &entry);
    335      1.1   elric 
    336      1.1   elric     if (keytab == NULL)
    337      1.1   elric 	krb5_kt_close (context, real_keytab);
    338      1.1   elric 
    339      1.1   elric     if (ret)
    340      1.1   elric 	return ret;
    341      1.1   elric 
    342      1.1   elric     ret = krb5_copy_keyblock (context, &entry.keyblock, key);
    343      1.1   elric     krb5_kt_free_entry(context, &entry);
    344      1.1   elric     return ret;
    345      1.1   elric }
    346      1.1   elric 
    347      1.1   elric /**
    348      1.1   elric  * Deprecated: use krb5_get_init_creds() and friends.
    349      1.1   elric  *
    350      1.1   elric  * @ingroup krb5_deprecated
    351      1.1   elric  */
    352      1.1   elric 
    353      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    354      1.1   elric krb5_get_in_tkt_with_keytab (krb5_context context,
    355      1.1   elric 			     krb5_flags options,
    356      1.1   elric 			     krb5_addresses *addrs,
    357      1.1   elric 			     const krb5_enctype *etypes,
    358      1.1   elric 			     const krb5_preauthtype *pre_auth_types,
    359      1.1   elric 			     krb5_keytab keytab,
    360      1.1   elric 			     krb5_ccache ccache,
    361      1.1   elric 			     krb5_creds *creds,
    362      1.1   elric 			     krb5_kdc_rep *ret_as_reply)
    363  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    364      1.1   elric {
    365      1.1   elric     krb5_keytab_key_proc_args a;
    366      1.1   elric 
    367      1.1   elric     a.principal = creds->client;
    368      1.1   elric     a.keytab    = keytab;
    369      1.1   elric 
    370      1.1   elric     return krb5_get_in_tkt (context,
    371      1.1   elric 			    options,
    372      1.1   elric 			    addrs,
    373      1.1   elric 			    etypes,
    374      1.1   elric 			    pre_auth_types,
    375      1.1   elric 			    krb5_keytab_key_proc,
    376      1.1   elric 			    &a,
    377      1.1   elric 			    NULL,
    378      1.1   elric 			    NULL,
    379      1.1   elric 			    creds,
    380      1.1   elric 			    ccache,
    381      1.1   elric 			    ret_as_reply);
    382      1.1   elric }
    383      1.1   elric 
    384      1.1   elric /**
    385      1.1   elric  * Generate a new ccache of type `ops' in `id'.
    386      1.1   elric  *
    387      1.1   elric  * Deprecated: use krb5_cc_new_unique() instead.
    388      1.1   elric  *
    389      1.1   elric  * @return Return an error code or 0, see krb5_get_error_message().
    390      1.1   elric  *
    391      1.1   elric  * @ingroup krb5_ccache
    392      1.1   elric  */
    393      1.1   elric 
    394      1.1   elric 
    395      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    396      1.1   elric krb5_cc_gen_new(krb5_context context,
    397      1.1   elric 		const krb5_cc_ops *ops,
    398      1.1   elric 		krb5_ccache *id)
    399  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    400      1.1   elric {
    401      1.1   elric     return krb5_cc_new_unique(context, ops->prefix, NULL, id);
    402      1.1   elric }
    403      1.1   elric 
    404      1.1   elric /**
    405      1.1   elric  * Deprecated: use krb5_principal_get_realm()
    406      1.1   elric  *
    407      1.1   elric  * @ingroup krb5_deprecated
    408      1.1   elric  */
    409      1.1   elric 
    410      1.1   elric KRB5_LIB_FUNCTION krb5_realm * KRB5_LIB_CALL
    411      1.1   elric krb5_princ_realm(krb5_context context,
    412      1.1   elric 		 krb5_principal principal)
    413  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    414      1.1   elric {
    415      1.1   elric     return &principal->realm;
    416      1.1   elric }
    417      1.1   elric 
    418      1.1   elric 
    419      1.1   elric /**
    420      1.1   elric  * Deprecated: use krb5_principal_set_realm()
    421      1.1   elric  *
    422      1.1   elric  * @ingroup krb5_deprecated
    423      1.1   elric  */
    424      1.1   elric 
    425      1.1   elric KRB5_LIB_FUNCTION void KRB5_LIB_CALL
    426      1.1   elric krb5_princ_set_realm(krb5_context context,
    427      1.1   elric 		     krb5_principal principal,
    428      1.1   elric 		     krb5_realm *realm)
    429  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    430      1.1   elric {
    431      1.1   elric     principal->realm = *realm;
    432      1.1   elric }
    433      1.1   elric 
    434      1.1   elric /**
    435      1.1   elric  * Deprecated: use krb5_free_cred_contents()
    436      1.1   elric  *
    437      1.1   elric  * @ingroup krb5_deprecated
    438      1.1   elric  */
    439      1.1   elric 
    440      1.1   elric /* keep this for compatibility with older code */
    441      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    442      1.1   elric krb5_free_creds_contents (krb5_context context, krb5_creds *c)
    443  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    444      1.1   elric {
    445      1.1   elric     return krb5_free_cred_contents (context, c);
    446      1.1   elric }
    447      1.1   elric 
    448      1.1   elric /**
    449      1.1   elric  * Free the error message returned by krb5_get_error_string().
    450      1.1   elric  *
    451      1.1   elric  * Deprecated: use krb5_free_error_message()
    452      1.1   elric  *
    453      1.1   elric  * @param context Kerberos context
    454      1.1   elric  * @param str error message to free
    455      1.1   elric  *
    456      1.1   elric  * @ingroup krb5_deprecated
    457      1.1   elric  */
    458      1.1   elric 
    459      1.1   elric KRB5_LIB_FUNCTION void KRB5_LIB_CALL
    460      1.1   elric krb5_free_error_string(krb5_context context, char *str)
    461  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    462      1.1   elric {
    463      1.1   elric     krb5_free_error_message(context, str);
    464      1.1   elric }
    465      1.1   elric 
    466      1.1   elric /**
    467      1.1   elric  * Set the error message returned by krb5_get_error_string().
    468      1.1   elric  *
    469      1.1   elric  * Deprecated: use krb5_get_error_message()
    470      1.1   elric  *
    471      1.1   elric  * @param context Kerberos context
    472      1.1   elric  * @param fmt error message to free
    473      1.1   elric  *
    474      1.1   elric  * @return Return an error code or 0.
    475      1.1   elric  *
    476      1.1   elric  * @ingroup krb5_deprecated
    477      1.1   elric  */
    478      1.1   elric 
    479      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    480      1.1   elric krb5_set_error_string(krb5_context context, const char *fmt, ...)
    481      1.1   elric     __attribute__((format (printf, 2, 3)))
    482  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    483      1.1   elric {
    484      1.1   elric     va_list ap;
    485      1.1   elric 
    486      1.1   elric     va_start(ap, fmt);
    487      1.1   elric     krb5_vset_error_message (context, 0, fmt, ap);
    488      1.1   elric     va_end(ap);
    489      1.1   elric     return 0;
    490      1.1   elric }
    491      1.1   elric 
    492      1.1   elric /**
    493      1.1   elric  * Set the error message returned by krb5_get_error_string(),
    494      1.1   elric  * deprecated, use krb5_set_error_message().
    495      1.1   elric  *
    496      1.1   elric  * Deprecated: use krb5_vset_error_message()
    497      1.1   elric  *
    498      1.1   elric  * @param context Kerberos context
    499      1.1   elric  * @param msg error message to free
    500      1.1   elric  *
    501      1.1   elric  * @return Return an error code or 0.
    502      1.1   elric  *
    503      1.1   elric  * @ingroup krb5_deprecated
    504      1.1   elric  */
    505      1.1   elric 
    506      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    507      1.1   elric krb5_vset_error_string(krb5_context context, const char *fmt, va_list args)
    508      1.1   elric     __attribute__ ((format (printf, 2, 0)))
    509  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    510      1.1   elric {
    511      1.1   elric     krb5_vset_error_message(context, 0, fmt, args);
    512      1.1   elric     return 0;
    513      1.1   elric }
    514      1.1   elric 
    515      1.1   elric /**
    516      1.1   elric  * Clear the error message returned by krb5_get_error_string().
    517      1.1   elric  *
    518      1.1   elric  * Deprecated: use krb5_clear_error_message()
    519      1.1   elric  *
    520      1.1   elric  * @param context Kerberos context
    521      1.1   elric  *
    522      1.1   elric  * @ingroup krb5_deprecated
    523      1.1   elric  */
    524      1.1   elric 
    525      1.1   elric KRB5_LIB_FUNCTION void KRB5_LIB_CALL
    526      1.1   elric krb5_clear_error_string(krb5_context context)
    527  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    528      1.1   elric {
    529      1.1   elric     krb5_clear_error_message(context);
    530      1.1   elric }
    531      1.1   elric 
    532      1.1   elric /**
    533      1.1   elric  * Deprecated: use krb5_get_credentials_with_flags().
    534      1.1   elric  *
    535      1.1   elric  * @ingroup krb5_deprecated
    536      1.1   elric  */
    537      1.1   elric 
    538      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    539      1.1   elric krb5_get_cred_from_kdc_opt(krb5_context context,
    540      1.1   elric 			   krb5_ccache ccache,
    541      1.1   elric 			   krb5_creds *in_creds,
    542      1.1   elric 			   krb5_creds **out_creds,
    543      1.1   elric 			   krb5_creds ***ret_tgts,
    544      1.1   elric 			   krb5_flags flags)
    545  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    546      1.1   elric {
    547      1.1   elric     krb5_kdc_flags f;
    548      1.1   elric     f.i = flags;
    549      1.1   elric     return _krb5_get_cred_kdc_any(context, f, ccache,
    550      1.1   elric 				  in_creds, NULL, NULL,
    551      1.1   elric 				  out_creds, ret_tgts);
    552      1.1   elric }
    553      1.1   elric 
    554      1.1   elric /**
    555      1.1   elric  * Deprecated: use krb5_get_credentials_with_flags().
    556      1.1   elric  *
    557      1.1   elric  * @ingroup krb5_deprecated
    558      1.1   elric  */
    559      1.1   elric 
    560      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    561      1.1   elric krb5_get_cred_from_kdc(krb5_context context,
    562      1.1   elric 		       krb5_ccache ccache,
    563      1.1   elric 		       krb5_creds *in_creds,
    564      1.1   elric 		       krb5_creds **out_creds,
    565      1.1   elric 		       krb5_creds ***ret_tgts)
    566  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    567      1.1   elric {
    568      1.1   elric     return krb5_get_cred_from_kdc_opt(context, ccache,
    569      1.1   elric 				      in_creds, out_creds, ret_tgts, 0);
    570      1.1   elric }
    571      1.1   elric 
    572      1.1   elric /**
    573      1.1   elric  * Deprecated: use krb5_xfree().
    574      1.1   elric  *
    575      1.1   elric  * @ingroup krb5_deprecated
    576      1.1   elric  */
    577      1.1   elric 
    578      1.1   elric KRB5_LIB_FUNCTION void KRB5_LIB_CALL
    579      1.1   elric krb5_free_unparsed_name(krb5_context context, char *str)
    580  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    581      1.1   elric {
    582      1.1   elric     krb5_xfree(str);
    583      1.1   elric }
    584      1.1   elric 
    585      1.1   elric /**
    586      1.1   elric  * Deprecated: use krb5_generate_subkey_extended()
    587      1.1   elric  *
    588      1.1   elric  * @ingroup krb5_deprecated
    589      1.1   elric  */
    590      1.1   elric 
    591      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    592      1.1   elric krb5_generate_subkey(krb5_context context,
    593      1.1   elric 		     const krb5_keyblock *key,
    594      1.1   elric 		     krb5_keyblock **subkey)
    595  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    596      1.1   elric {
    597      1.1   elric     return krb5_generate_subkey_extended(context, key, ETYPE_NULL, subkey);
    598      1.1   elric }
    599      1.1   elric 
    600      1.1   elric /**
    601      1.1   elric  * Deprecated: use krb5_auth_con_getremoteseqnumber()
    602      1.1   elric  *
    603      1.1   elric  * @ingroup krb5_deprecated
    604      1.1   elric  */
    605      1.1   elric 
    606      1.1   elric KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    607      1.1   elric krb5_auth_getremoteseqnumber(krb5_context context,
    608      1.1   elric 			     krb5_auth_context auth_context,
    609      1.1   elric 			     int32_t *seqnumber)
    610  1.1.1.2  pettai     KRB5_DEPRECATED_FUNCTION("Use X instead")
    611      1.1   elric {
    612      1.1   elric   *seqnumber = auth_context->remote_seqnumber;
    613      1.1   elric   return 0;
    614      1.1   elric }
    615      1.1   elric 
    616      1.1   elric #endif /* HEIMDAL_SMALLER */
    617