diff options
author | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
commit | 3a971fe69aad52dfd248901ae796e64a96ae3e37 (patch) | |
tree | ac7b5c62510ffa9f0316643bcb19a3fed3d5bef7 /crypto/heimdal/lib/krb5/context.c | |
parent | 2934fc23653f64b32f4db32233d7eda11ca274f0 (diff) | |
parent | ebfe6dc471c206300fd82c7c0fd145f683aa52f6 (diff) | |
download | FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.zip FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r72445,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/lib/krb5/context.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/context.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/crypto/heimdal/lib/krb5/context.c b/crypto/heimdal/lib/krb5/context.c index fb3fb61..0cfac9a 100644 --- a/crypto/heimdal/lib/krb5/context.c +++ b/crypto/heimdal/lib/krb5/context.c @@ -33,16 +33,12 @@ #include "krb5_locl.h" -RCSID("$Id: context.c,v 1.53 2000/02/11 17:43:43 assar Exp $"); +RCSID("$Id: context.c,v 1.59 2000/12/15 17:11:51 joda Exp $"); #define INIT_FIELD(C, T, E, D, F) \ (C)->E = krb5_config_get_ ## T ## _default ((C), NULL, (D), \ "libdefaults", F, NULL) -#ifdef KRB4 -extern krb5_kt_ops krb4_fkt_ops; -#endif - /* * Set the list of etypes `ret_etypes' from the configuration variable * `name' @@ -89,27 +85,26 @@ init_context_from_config_file(krb5_context context) INIT_FIELD(context, time, kdc_timeout, 3, "kdc_timeout"); INIT_FIELD(context, int, max_retries, 3, "max_retries"); - context->http_proxy = krb5_config_get_string(context, NULL, "libdefaults", - "http_proxy", NULL); + INIT_FIELD(context, string, http_proxy, NULL, "http_proxy"); set_etypes (context, "default_etypes", &context->etypes); set_etypes (context, "default_etypes_des", &context->etypes_des); /* default keytab name */ - context->default_keytab = krb5_config_get_string(context, NULL, - "libdefaults", - "default_keytab_name", - NULL); - if(context->default_keytab == NULL) - context->default_keytab = KEYTAB_DEFAULT; - - context->time_fmt = krb5_config_get_string(context, NULL, "libdefaults", - "time_format", NULL); - if(context->time_fmt == NULL) - context->time_fmt = "%Y-%m-%dT%H:%M:%S"; - context->log_utc = krb5_config_get_bool(context, NULL, "libdefaults", - "log_utc", NULL); + INIT_FIELD(context, string, default_keytab, + KEYTAB_DEFAULT, "default_keytab_name"); + + INIT_FIELD(context, string, time_fmt, + "%Y-%m-%dT%H:%M:%S", "time_format"); + + INIT_FIELD(context, string, date_fmt, + "%Y-%m-%d", "date_format"); + INIT_FIELD(context, bool, log_utc, + FALSE, "log_utc"); + + + /* init dns-proxy slime */ tmp = krb5_config_get_string(context, NULL, "libdefaults", "dns_proxy", NULL); @@ -136,7 +131,6 @@ init_context_from_config_file(krb5_context context) INIT_FIELD(context, bool, scan_interfaces, TRUE, "scan_interfaces"); INIT_FIELD(context, bool, srv_lookup, TRUE, "srv_lookup"); INIT_FIELD(context, bool, srv_try_txt, FALSE, "srv_try_txt"); - INIT_FIELD(context, bool, srv_try_rfc2052, TRUE, "srv_try_rfc2052"); INIT_FIELD(context, int, fcache_vno, 0, "fcache_version"); context->cc_ops = NULL; @@ -148,10 +142,8 @@ init_context_from_config_file(krb5_context context) context->kt_types = NULL; krb5_kt_register (context, &krb5_fkt_ops); krb5_kt_register (context, &krb5_mkt_ops); -#ifdef KRB4 - krb5_kt_register (context, &krb4_fkt_ops); -#endif krb5_kt_register (context, &krb5_akf_ops); + krb5_kt_register (context, &krb4_fkt_ops); return 0; } @@ -187,8 +179,10 @@ krb5_init_context(krb5_context *context) #endif ret = init_context_from_config_file(p); - if(ret) + if(ret) { + krb5_free_context(p); return ret; + } *context = p; return 0; @@ -211,12 +205,17 @@ krb5_free_context(krb5_context context) free(context); } +/* + * set `etype' to a malloced list of the default enctypes + */ + static krb5_error_code default_etypes(krb5_enctype **etype) { krb5_enctype p[] = { ETYPE_DES3_CBC_SHA1, ETYPE_DES3_CBC_MD5, + ETYPE_ARCFOUR_HMAC_MD5, ETYPE_DES_CBC_MD5, ETYPE_DES_CBC_MD4, ETYPE_DES_CBC_CRC, |