1 /* 2 * Copyright (c) 1997 Kungliga Tekniska H�gskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * 3. Neither the name of the Institute nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34 #include "krb5_locl.h" 35 36 RCSID("$Id: init_creds.c,v 1.2 1999/12/02 17:05:10 joda Exp $"); 37 38 void 39 krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt) 40 { 41 memset (opt, 0, sizeof(*opt)); 42 opt->flags = 0; 43 } 44 45 void 46 krb5_get_init_creds_opt_set_tkt_life(krb5_get_init_creds_opt *opt, 47 krb5_deltat tkt_life) 48 { 49 opt->flags |= KRB5_GET_INIT_CREDS_OPT_TKT_LIFE; 50 opt->tkt_life = tkt_life; 51 } 52 53 void 54 krb5_get_init_creds_opt_set_renew_life(krb5_get_init_creds_opt *opt, 55 krb5_deltat renew_life) 56 { 57 opt->flags |= KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE; 58 opt->renew_life = renew_life; 59 } 60 61 void 62 krb5_get_init_creds_opt_set_forwardable(krb5_get_init_creds_opt *opt, 63 int forwardable) 64 { 65 opt->flags |= KRB5_GET_INIT_CREDS_OPT_FORWARDABLE; 66 opt->forwardable = forwardable; 67 } 68 69 void 70 krb5_get_init_creds_opt_set_proxiable(krb5_get_init_creds_opt *opt, 71 int proxiable) 72 { 73 opt->flags |= KRB5_GET_INIT_CREDS_OPT_PROXIABLE; 74 opt->proxiable = proxiable; 75 } 76 77 void 78 krb5_get_init_creds_opt_set_etype_list(krb5_get_init_creds_opt *opt, 79 krb5_enctype *etype_list, 80 int etype_list_length) 81 { 82 opt->flags |= KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST; 83 opt->etype_list = etype_list; 84 opt->etype_list_length = etype_list_length; 85 } 86 87 void 88 krb5_get_init_creds_opt_set_address_list(krb5_get_init_creds_opt *opt, 89 krb5_addresses *addresses) 90 { 91 opt->flags |= KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST; 92 opt->address_list = addresses; 93 } 94 95 void 96 krb5_get_init_creds_opt_set_preauth_list(krb5_get_init_creds_opt *opt, 97 krb5_preauthtype *preauth_list, 98 int preauth_list_length) 99 { 100 opt->flags |= KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST; 101 opt->preauth_list_length = preauth_list_length; 102 opt->preauth_list = preauth_list; 103 } 104 105 void 106 krb5_get_init_creds_opt_set_salt(krb5_get_init_creds_opt *opt, 107 krb5_data *salt) 108 { 109 opt->flags |= KRB5_GET_INIT_CREDS_OPT_SALT; 110 opt->salt = salt; 111 } 112