summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorZhanna Tsitkov <tsitkova@mit.edu>2008-08-20 21:09:14 +0000
committerZhanna Tsitkov <tsitkova@mit.edu>2008-08-20 21:09:14 +0000
commitdac88c2b08c7c4cab30b842008dc6fd0f2b4f1ff (patch)
tree4065cf84935a72c2a79016c3083b04a3693a1102 /src/lib/krb5
parent4c8485b11bb27a3763a8f0058547ee7ac84556fe (diff)
downloadkrb5-dac88c2b08c7c4cab30b842008dc6fd0f2b4f1ff.tar.gz
krb5-dac88c2b08c7c4cab30b842008dc6fd0f2b4f1ff.tar.xz
krb5-dac88c2b08c7c4cab30b842008dc6fd0f2b4f1ff.zip
lean client changes
All changes are under LEAN_CLIENT macro. Application server functionality is disabled. Ticket:new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20680 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/keytab/kt_file.c6
-rw-r--r--src/lib/krb5/keytab/kt_memory.c4
-rw-r--r--src/lib/krb5/keytab/kt_srvtab.c6
-rw-r--r--src/lib/krb5/keytab/ktadd.c6
-rw-r--r--src/lib/krb5/keytab/ktbase.c6
-rw-r--r--src/lib/krb5/keytab/ktdefault.c5
-rw-r--r--src/lib/krb5/keytab/ktfns.c6
-rw-r--r--src/lib/krb5/keytab/ktfr_entry.c5
-rw-r--r--src/lib/krb5/keytab/ktremove.c5
-rw-r--r--src/lib/krb5/keytab/read_servi.c5
-rw-r--r--src/lib/krb5/krb/gic_keytab.c5
-rw-r--r--src/lib/krb5/krb/gic_pwd.c1
-rw-r--r--src/lib/krb5/krb/in_tkt_sky.c4
-rw-r--r--src/lib/krb5/krb/rd_req.c10
-rw-r--r--src/lib/krb5/krb/rd_req_dec.c4
-rw-r--r--src/lib/krb5/krb/ser_ctx.c7
-rw-r--r--src/lib/krb5/krb/srv_dec_tkt.c5
-rw-r--r--src/lib/krb5/krb5_libinit.c4
-rw-r--r--src/lib/krb5/os/accessor.c10
19 files changed, 85 insertions, 19 deletions
diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c
index 357bb12465..cd2298ba54 100644
--- a/src/lib/krb5/keytab/kt_file.c
+++ b/src/lib/krb5/keytab/kt_file.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/kt_file.c
*
- * Copyright 1990,1991,1995,2007 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,1995,2007,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -25,6 +25,8 @@
*
*/
+#ifndef LEAN_CLIENT
+
#include "k5-int.h"
#include <stdio.h>
@@ -1768,3 +1770,5 @@ krb5_ktfileint_find_slot(krb5_context context, krb5_keytab id, krb5_int32 *size_
return 0;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/kt_memory.c b/src/lib/krb5/keytab/kt_memory.c
index bf9634e53a..eb1dd77e03 100644
--- a/src/lib/krb5/keytab/kt_memory.c
+++ b/src/lib/krb5/keytab/kt_memory.c
@@ -28,6 +28,8 @@
#include "kt-int.h"
#include <stdio.h>
+#ifndef LEAN_CLIENT
+
#define HEIMDAL_COMPATIBLE
/*
@@ -674,3 +676,5 @@ const struct _krb5_kt_ops krb5_mkt_ops = {
NULL
};
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c
index 77546446e0..2bc4603454 100644
--- a/src/lib/krb5/keytab/kt_srvtab.c
+++ b/src/lib/krb5/keytab/kt_srvtab.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/srvtab/kts_resolv.c
*
- * Copyright 1990,1991,2002,2007 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2002,2007,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -27,6 +27,8 @@
#include "k5-int.h"
#include <stdio.h>
+#ifndef LEAN_CLIENT
+
/*
* Constants
*/
@@ -472,3 +474,5 @@ krb5_ktsrvint_read_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry
return 0;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/ktadd.c b/src/lib/krb5/keytab/ktadd.c
index b7c1b92164..360dd64cd7 100644
--- a/src/lib/krb5/keytab/ktadd.c
+++ b/src/lib/krb5/keytab/ktadd.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktadd.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -29,6 +29,8 @@
#include "k5-int.h"
+#ifndef LEAN_CLIENT
+
krb5_error_code KRB5_CALLCONV
krb5_kt_add_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry)
{
@@ -37,3 +39,5 @@ krb5_kt_add_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry *entr
else
return KRB5_KT_NOWRITE;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c
index 3e4f6a6be6..b68b351c6a 100644
--- a/src/lib/krb5/keytab/ktbase.c
+++ b/src/lib/krb5/keytab/ktbase.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktbase.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -53,6 +53,8 @@
#include "k5-thread.h"
#include "kt-int.h"
+#ifndef LEAN_CLIENT
+
extern const krb5_kt_ops krb5_ktf_ops;
extern const krb5_kt_ops krb5_ktf_writable_ops;
extern const krb5_kt_ops krb5_kts_ops;
@@ -283,3 +285,5 @@ krb5_ser_keytab_init(krb5_context kcontext)
{
return(krb5_register_serializer(kcontext, &krb5_keytab_ser_entry));
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/ktdefault.c b/src/lib/krb5/keytab/ktdefault.c
index 971f29f599..3d7ee0946c 100644
--- a/src/lib/krb5/keytab/ktdefault.c
+++ b/src/lib/krb5/keytab/ktdefault.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktdefault.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -30,6 +30,7 @@
#include "k5-int.h"
#include <stdio.h>
+#ifndef LEAN_CLIENT
krb5_error_code KRB5_CALLCONV
krb5_kt_default(krb5_context context, krb5_keytab *id)
{
@@ -41,5 +42,5 @@ krb5_kt_default(krb5_context context, krb5_keytab *id)
return krb5_kt_resolve(context, defname, id);
}
-
+#endif /* LEAN_CLIENT */
diff --git a/src/lib/krb5/keytab/ktfns.c b/src/lib/krb5/keytab/ktfns.c
index 24d8eb267b..9239f3d167 100644
--- a/src/lib/krb5/keytab/ktfns.c
+++ b/src/lib/krb5/keytab/ktfns.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktfns.c
*
- * Copyright 2001 by the Massachusetts Institute of Technology.
+ * Copyright 2001,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -28,6 +28,8 @@
* Dispatch methods for keytab code.
*/
+#ifndef LEAN_CLIENT
+
#include "k5-int.h"
const char * KRB5_CALLCONV
@@ -94,3 +96,5 @@ krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab,
{
return krb5_x((keytab)->ops->end_get,(context, keytab, cursor));
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/ktfr_entry.c b/src/lib/krb5/keytab/ktfr_entry.c
index b4305e21af..e046232546 100644
--- a/src/lib/krb5/keytab/ktfr_entry.c
+++ b/src/lib/krb5/keytab/ktfr_entry.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktfr_entry.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -26,6 +26,7 @@
*
* krb5_kt_free_entry()
*/
+#ifndef LEAN_CLIENT
#include "k5-int.h"
@@ -48,3 +49,5 @@ krb5_kt_free_entry (krb5_context context, krb5_keytab_entry *entry)
{
return krb5_free_keytab_entry_contents (context, entry);
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/ktremove.c b/src/lib/krb5/keytab/ktremove.c
index d101a70651..4ba6063f72 100644
--- a/src/lib/krb5/keytab/ktremove.c
+++ b/src/lib/krb5/keytab/ktremove.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/ktremove.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -26,6 +26,7 @@
*
* krb5_kt_remove_entry()
*/
+#ifndef LEAN_CLIENT
#include "k5-int.h"
@@ -37,3 +38,5 @@ krb5_kt_remove_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry *e
else
return KRB5_KT_NOWRITE;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/keytab/read_servi.c b/src/lib/krb5/keytab/read_servi.c
index 3455300ab0..6638a5a927 100644
--- a/src/lib/krb5/keytab/read_servi.c
+++ b/src/lib/krb5/keytab/read_servi.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/keytab/read_servi.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -29,6 +29,7 @@
* It handles all of the opening and closing of the keytab
* internally.
*/
+#ifndef LEAN_CLIENT
#include "k5-int.h"
@@ -79,3 +80,5 @@ krb5_kt_read_service_key(krb5_context context, krb5_pointer keyprocarg, krb5_pri
return (KSUCCESS);
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/krb/gic_keytab.c b/src/lib/krb5/krb/gic_keytab.c
index cae04955ae..7e60b2d198 100644
--- a/src/lib/krb5/krb/gic_keytab.c
+++ b/src/lib/krb5/krb/gic_keytab.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/krb/gic_keytab.c
*
- * Copyright (C) 2002, 2003 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2002, 2003, 2008 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
@@ -23,6 +23,7 @@
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
+#ifndef LEAN_CLIENT
#include "k5-int.h"
@@ -217,3 +218,5 @@ krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options,
return retval;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c
index dd3f011d9a..094eb79f5b 100644
--- a/src/lib/krb5/krb/gic_pwd.c
+++ b/src/lib/krb5/krb/gic_pwd.c
@@ -378,7 +378,6 @@ cleanup:
break;
delta = (*last_req)->value - now;
-
if (delta < 3600)
snprintf(banner, sizeof(banner),
"Warning: Your password will expire in less than one hour on %s",
diff --git a/src/lib/krb5/krb/in_tkt_sky.c b/src/lib/krb5/krb/in_tkt_sky.c
index 75edb55da4..d98411fd7a 100644
--- a/src/lib/krb5/krb/in_tkt_sky.c
+++ b/src/lib/krb5/krb/in_tkt_sky.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/krb/in_tkt_sky.c
*
- * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -98,8 +98,10 @@ krb5_get_in_tkt_with_skey(krb5_context context, krb5_flags options,
skey_keyproc, (krb5_const_pointer)key,
krb5_kdc_rep_decrypt_proc, 0, creds,
ccache, ret_as_reply);
+#ifndef LEAN_CLIENT
else
return krb5_get_in_tkt_with_keytab(context, options, addrs, ktypes,
pre_auth_types, NULL, ccache,
creds, ret_as_reply);
+#endif /* LEAN_CLIENT */
}
diff --git a/src/lib/krb5/krb/rd_req.c b/src/lib/krb5/krb/rd_req.c
index 28f4f93641..6a479496fa 100644
--- a/src/lib/krb5/krb/rd_req.c
+++ b/src/lib/krb5/krb/rd_req.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/krb/rd_req.c
*
- * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -58,14 +58,16 @@ krb5_rd_req(krb5_context context, krb5_auth_context *auth_context,
if (!krb5_is_ap_req(inbuf))
return KRB5KRB_AP_ERR_MSG_TYPE;
+#ifndef LEAN_CLIENT
if ((retval = decode_krb5_ap_req(inbuf, &request))) {
switch (retval) {
case KRB5_BADMSGTYPE:
return KRB5KRB_AP_ERR_BADVERSION;
default:
return(retval);
- }
+ }
}
+#endif /* LEAN_CLIENT */
/* Get an auth context if necessary. */
new_auth_context = NULL;
@@ -89,18 +91,22 @@ krb5_rd_req(krb5_context context, krb5_auth_context *auth_context,
goto cleanup_auth_context;
}
+#ifndef LEAN_CLIENT
/* Get a keytab if necessary. */
if (keytab == NULL) {
if ((retval = krb5_kt_default(context, &new_keytab)))
goto cleanup_auth_context;
keytab = new_keytab;
}
+#endif /* LEAN_CLIENT */
retval = krb5_rd_req_decoded(context, auth_context, request, server,
keytab, ap_req_options, ticket);
+#ifndef LEAN_CLIENT
if (new_keytab != NULL)
(void) krb5_kt_close(context, new_keytab);
+#endif /* LEAN_CLIENT */
cleanup_auth_context:
if (new_auth_context && retval) {
diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c
index d672b8b7e9..ed707d11ed 100644
--- a/src/lib/krb5/krb/rd_req_dec.c
+++ b/src/lib/krb5/krb/rd_req_dec.c
@@ -87,15 +87,19 @@ krb5_rd_req_decrypt_tkt_part(krb5_context context, const krb5_ap_req *req,
enctype = req->ticket->enc_part.enctype;
+#ifndef LEAN_CLIENT
if ((retval = krb5_kt_get_entry(context, keytab, req->ticket->server,
req->ticket->enc_part.kvno,
enctype, &ktent)))
return retval;
+#endif /* LEAN_CLIENT */
retval = krb5_decrypt_tkt_part(context, &ktent.key, req->ticket);
/* Upon error, Free keytab entry first, then return */
+#ifndef LEAN_CLIENT
(void) krb5_kt_free_entry(context, &ktent);
+#endif /* LEAN_CLIENT */
return retval;
}
diff --git a/src/lib/krb5/krb/ser_ctx.c b/src/lib/krb5/krb/ser_ctx.c
index 322f1825b5..6a1fb1b498 100644
--- a/src/lib/krb5/krb/ser_ctx.c
+++ b/src/lib/krb5/krb/ser_ctx.c
@@ -62,12 +62,14 @@ static krb5_error_code krb5_oscontext_externalize
(krb5_context, krb5_pointer, krb5_octet **, size_t *);
static krb5_error_code krb5_oscontext_internalize
(krb5_context,krb5_pointer *, krb5_octet **, size_t *);
+#ifndef LEAN_CLIENT
krb5_error_code profile_ser_size
(krb5_context, krb5_pointer, size_t *);
krb5_error_code profile_ser_externalize
(krb5_context, krb5_pointer, krb5_octet **, size_t *);
krb5_error_code profile_ser_internalize
(krb5_context,krb5_pointer *, krb5_octet **, size_t *);
+#endif /* LEAN_CLIENT */
/* Local data */
static const krb5_ser_entry krb5_context_ser_entry = {
@@ -82,13 +84,14 @@ static const krb5_ser_entry krb5_oscontext_ser_entry = {
krb5_oscontext_externalize, /* Externalize routine */
krb5_oscontext_internalize /* Internalize routine */
};
+#ifndef LEAN_CLIENT
static const krb5_ser_entry krb5_profile_ser_entry = {
PROF_MAGIC_PROFILE, /* Type */
profile_ser_size, /* Sizer routine */
profile_ser_externalize, /* Externalize routine */
profile_ser_internalize /* Internalize routine */
};
-
+#endif /* LEAN_CLIENT */
/*
* krb5_context_size() - Determine the size required to externalize the
* krb5_context.
@@ -610,7 +613,9 @@ krb5_ser_context_init(krb5_context kcontext)
kret = krb5_register_serializer(kcontext, &krb5_context_ser_entry);
if (!kret)
kret = krb5_register_serializer(kcontext, &krb5_oscontext_ser_entry);
+#ifndef LEAN_CLIENT
if (!kret)
kret = krb5_register_serializer(kcontext, &krb5_profile_ser_entry);
+#endif /* LEAN_CLIENT */
return(kret);
}
diff --git a/src/lib/krb5/krb/srv_dec_tkt.c b/src/lib/krb5/krb/srv_dec_tkt.c
index e994ac9950..b5cf260f2c 100644
--- a/src/lib/krb5/krb/srv_dec_tkt.c
+++ b/src/lib/krb5/krb/srv_dec_tkt.c
@@ -1,7 +1,7 @@
/*
* lib/krb5/krb/srv_dec_tkt.c
*
- * Copyright 2006 by the Massachusetts Institute of Technology.
+ * Copyright 2006, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -38,6 +38,7 @@
#include <k5-int.h>
+#ifndef LEAN_CLIENT
krb5_error_code KRB5_CALLCONV
krb5int_server_decrypt_ticket_keyblock(krb5_context context,
const krb5_keyblock *key,
@@ -92,3 +93,5 @@ krb5_server_decrypt_ticket_keytab(krb5_context context,
(void) krb5_kt_free_entry(context, &ktent);
return retval;
}
+#endif /* LEAN_CLIENT */
+
diff --git a/src/lib/krb5/krb5_libinit.c b/src/lib/krb5/krb5_libinit.c
index e82891a57d..94187781c8 100644
--- a/src/lib/krb5/krb5_libinit.c
+++ b/src/lib/krb5/krb5_libinit.c
@@ -44,9 +44,11 @@ int krb5int_lib_init(void)
err = krb5int_rc_finish_init();
if (err)
return err;
+#ifndef LEAN_CLIENT
err = krb5int_kt_initialize();
if (err)
return err;
+#endif /* LEAN_CLIENT */
err = krb5int_cc_initialize();
if (err)
return err;
@@ -83,7 +85,9 @@ void krb5int_lib_fini(void)
k5_mutex_destroy(&krb5int_us_time_mutex);
krb5int_cc_finalize();
+#ifndef LEAN_CLIENT
krb5int_kt_finalize();
+#endif /* LEAN_CLIENT */
krb5int_rc_terminate();
#if defined(_WIN32) || defined(USE_CCAPI)
diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c
index c0cc495c61..1593468cd4 100644
--- a/src/lib/krb5/os/accessor.c
+++ b/src/lib/krb5/os/accessor.c
@@ -79,8 +79,14 @@ krb5int_accessor(krb5int_access *internals, krb5_int32 version)
#undef SC
S (krb5int_c_mandatory_cksumtype, krb5int_c_mandatory_cksumtype),
- S (krb5_ser_pack_int64, krb5_ser_pack_int64),
- S (krb5_ser_unpack_int64, krb5_ser_unpack_int64),
+#ifndef LEAN_CLIENT
+#define SC(FIELD, VAL) S(FIELD, VAL)
+#else /* disable */
+#define SC(FIELD, VAL) S(FIELD, 0)
+#endif
+ SC (krb5_ser_pack_int64, krb5_ser_pack_int64),
+ SC (krb5_ser_unpack_int64, krb5_ser_unpack_int64),
+#undef SC
#ifdef ENABLE_LDAP
#define SC(FIELD, VAL) S(FIELD, VAL)