summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-27 16:36:00 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-27 16:36:00 +0000
commit8acb29c6f3259749c85985c2df6b0cbd870c52f6 (patch)
tree0a79e57cf8714e3a10df69586ce445abe7c36a31 /src/include
parent6f207872f88b0c63e0ec81041f8c54b6b68f73f5 (diff)
downloadkrb5-8acb29c6f3259749c85985c2df6b0cbd870c52f6.tar.gz
krb5-8acb29c6f3259749c85985c2df6b0cbd870c52f6.tar.xz
krb5-8acb29c6f3259749c85985c2df6b0cbd870c52f6.zip
Based on patch from lxs, with some changes:
Add several new gcc warning flags, used in the KfM build process. Put declarations before code. Fix a bunch of signed/unsigned type mixes, mostly by changing variable types to unsigned int. Fix constness in handling name of default ccache name. Make sure functions get declared with prototypes: krb5int_pthread_loaded krb5int_gmt_mktime krb5int_aes_encrypt krb5int_aes_decrypt gssint_mecherrmap_init gssint_mecherramp_get. Don't shadow global names: stat accept index open encrypt. Fix variable shadowing in LDAP ASN.1 support. Don't define unused krb5int_local_addresses. Don't export internal krb5_change_set_password. Fix error return indications from gssint_oid_to_mech. Create and use k5-gmt_mktime.h to provide one global declaration of krb5int_gmt_mktime, needed before we've generated krb5.h on some platforms. Not incorporated from initial patch: const changes in function signatures. ticket: 6096 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20697 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/k5-gmt_mktime.h51
-rw-r--r--src/include/k5-int.h11
-rw-r--r--src/include/k5-thread.h12
3 files changed, 66 insertions, 8 deletions
diff --git a/src/include/k5-gmt_mktime.h b/src/include/k5-gmt_mktime.h
new file mode 100644
index 000000000..d9d1d1e5a
--- /dev/null
+++ b/src/include/k5-gmt_mktime.h
@@ -0,0 +1,51 @@
+/*
+ * include/k5-gmt_mktime.h
+ *
+ * Copyright 2008 Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ *
+ * GMT struct tm conversion
+ *
+ * Because of ordering of things in the UNIX build, we can't just keep
+ * the declaration in k5-int.h and include it in
+ * util/support/gmt_mktime.c, since k5-int.h includes krb5.h which
+ * hasn't been built when gmt_mktime.c gets compiled. Hence this
+ * silly little helper header.
+ */
+
+#ifndef K5_GMT_MKTIME_H
+#define K5_GMT_MKTIME_H
+
+#include "autoconf.h"
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#else
+#include <time.h>
+#endif
+
+time_t krb5int_gmt_mktime (struct tm *);
+
+#endif /* K5_GMT_MKTIME_H */
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 8f9791bb9..545bd983a 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -469,6 +469,8 @@ extern char *strdup (const char *);
#include <stdio.h>
+#include "k5-gmt_mktime.h"
+
struct addrlist;
struct sendto_callback_info;
@@ -733,8 +735,6 @@ krb5_error_code krb5_crypto_us_timeofday
(krb5_int32 *,
krb5_int32 *);
-time_t krb5int_gmt_mktime (struct tm *);
-
#endif /* KRB5_OLD_CRYPTO */
/* this helper fct is in libkrb5, but it makes sense declared here. */
@@ -2195,6 +2195,13 @@ krb5_error_code krb5_decrypt_data
krb5_pointer ivec, krb5_enc_data *data,
krb5_data *enc_data);
+krb5_error_code
+krb5int_aes_encrypt(const krb5_keyblock *key, const krb5_data *ivec,
+ const krb5_data *input, krb5_data *output);
+krb5_error_code
+krb5int_aes_decrypt(const krb5_keyblock *key, const krb5_data *ivec,
+ const krb5_data *input, krb5_data *output);
+
struct _krb5_kt_ops;
struct _krb5_kt { /* should move into k5-int.h */
krb5_magic magic;
diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h
index c70f634d4..0450eb277 100644
--- a/src/include/k5-thread.h
+++ b/src/include/k5-thread.h
@@ -245,6 +245,12 @@ typedef k5_os_nothread_mutex k5_os_mutex;
If we find a platform with non-functional stubs and no weak
references, we may have to resort to some hack like dlsym on the
symbol tables of the current process. */
+extern int krb5int_pthread_loaded(void)
+#ifdef __GNUC__
+ /* We should always get the same answer for the life of the process. */
+ __attribute__((const))
+#endif
+ ;
#if defined(HAVE_PRAGMA_WEAK_REF) && !defined(NO_WEAK_PTHREADS)
# pragma weak pthread_once
# pragma weak pthread_mutex_lock
@@ -253,12 +259,6 @@ typedef k5_os_nothread_mutex k5_os_mutex;
# pragma weak pthread_mutex_init
# pragma weak pthread_self
# pragma weak pthread_equal
-extern int krb5int_pthread_loaded(void)
-#ifdef __GNUC__
- /* We should always get the same answer for the life of the process. */
- __attribute__((const))
-#endif
- ;
# define K5_PTHREADS_LOADED (krb5int_pthread_loaded())
# define USE_PTHREAD_LOCK_ONLY_IF_LOADED