Enable and fix warnings in util/gss-kernel-lib
authorGreg Hudson <ghudson@mit.edu>
Mon, 27 Jun 2011 22:23:23 +0000 (22:23 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 27 Jun 2011 22:23:23 +0000 (22:23 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24995 dc483132-0cff-0310-8789-dd5450dbe970

src/util/gss-kernel-lib/Makefile.in
src/util/gss-kernel-lib/deps
src/util/gss-kernel-lib/kernel_gss.c
src/util/gss-kernel-lib/kernel_gss.h [new file with mode: 0644]
src/util/gss-kernel-lib/t_kgss_common.c
src/util/gss-kernel-lib/t_kgss_kernel.c
src/util/gss-kernel-lib/t_kgss_user.c

index 9887740936a14411d12ea63de56bddac8f8a975a..4b26ce1182c1e096998621599020ea1a655259f8 100644 (file)
@@ -4,7 +4,7 @@ BUILDTOP=$(REL)..$(S)..
 KRB5_RUN_ENV=@KRB5_RUN_ENV@
 
 DEFINES=-DKRB5_KERNEL
-ALL_CFLAGS=$(CFLAGS) $(DEFS) $(DEFINES) -I. -Igssapi
+ALL_CFLAGS=$(CFLAGS) $(WARN_CFLAGS) $(DEFS) $(DEFINES) -I. -Igssapi
 PROG_LIBPATH=-L$(TOPLIBD)
 
 SHLIB_EXPDEPS = \
index 25bf0ec345088dc153e734f734a7d78f760d9c85..0acbb4889ddd6a8aa60b650e4632d1fed0f21678 100644 (file)
@@ -6,9 +6,10 @@ $(OUTPRE)kernel_gss.$(OBJEXT): autoconf.h com_err.h \
   gssapiP_generic.h gssapiP_krb5.h gssapi_err_generic.h \
   gssapi_err_krb5.h gssapi_generic.h k5-buf.h k5-err.h \
   k5-gmt_mktime.h k5-int-pkinit.h k5-int.h k5-platform.h \
-  k5-plugin.h k5-thread.h k5-trace.h kernel_gss.c krb5.h \
-  krb5/authdata_plugin.h krb5/krb5.h krb5/plugin.h krb5/preauth_plugin.h \
-  osconf.h port-sockets.h profile.h socket-utils.h
+  k5-plugin.h k5-thread.h k5-trace.h kernel_gss.c kernel_gss.h \
+  krb5.h krb5/authdata_plugin.h krb5/krb5.h krb5/plugin.h \
+  krb5/preauth_plugin.h osconf.h port-sockets.h profile.h \
+  socket-utils.h
 $(OUTPRE)k5seal.$(OBJEXT): autoconf.h com_err.h gssapi/gssapi.h \
   gssapi/gssapi_ext.h gssapi/gssapi_krb5.h gssapiP_generic.h \
   gssapiP_krb5.h gssapi_err_generic.h gssapi_err_krb5.h \
@@ -106,7 +107,8 @@ $(OUTPRE)t_kgss_common.$(OBJEXT): autoconf.h com_err.h \
   k5-buf.h k5-err.h k5-gmt_mktime.h k5-int-pkinit.h k5-int.h \
   k5-platform.h k5-plugin.h k5-thread.h k5-trace.h krb5.h \
   krb5/authdata_plugin.h krb5/krb5.h krb5/plugin.h krb5/preauth_plugin.h \
-  osconf.h port-sockets.h profile.h socket-utils.h t_kgss_common.c
+  osconf.h port-sockets.h profile.h socket-utils.h t_kgss_common.c \
+  t_kgss_common.h
 $(OUTPRE)t_kgss_user.$(OBJEXT): autoconf.h com_err.h \
   gssapi/gssapi.h gssapi/gssapi_ext.h gssapi/gssapi_krb5.h \
   k5-buf.h k5-err.h k5-gmt_mktime.h k5-int-pkinit.h k5-int.h \
@@ -116,7 +118,10 @@ $(OUTPRE)t_kgss_user.$(OBJEXT): autoconf.h com_err.h \
   t_kgss_user.c
 $(OUTPRE)t_kgss_kernel.$(OBJEXT): autoconf.h com_err.h \
   gssapi/gssapi.h gssapi/gssapi_ext.h gssapi/gssapi_krb5.h \
-  k5-buf.h k5-err.h k5-gmt_mktime.h k5-int-pkinit.h k5-int.h \
-  k5-platform.h k5-plugin.h k5-thread.h k5-trace.h krb5.h \
+  gssapiP_generic.h gssapiP_krb5.h gssapi_err_generic.h \
+  gssapi_err_krb5.h gssapi_generic.h k5-buf.h k5-err.h \
+  k5-gmt_mktime.h k5-int-pkinit.h k5-int.h k5-platform.h \
+  k5-plugin.h k5-thread.h k5-trace.h kernel_gss.h krb5.h \
   krb5/authdata_plugin.h krb5/krb5.h krb5/plugin.h krb5/preauth_plugin.h \
-  osconf.h port-sockets.h profile.h socket-utils.h t_kgss_kernel.c
+  osconf.h port-sockets.h profile.h socket-utils.h t_kgss_common.h \
+  t_kgss_kernel.c
index 9c3ac77ab6a97fafafc445466f381c70dc269add..a0ad8d09d81ef2c641b2816567ab5acb30b9f953 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "gssapiP_krb5.h"
+#include "kernel_gss.h"
 
 /* Normally defined in lib/gssapi/krb5/gssapi_krb5.c. */
 static const gss_OID_desc oid_array[] = {
@@ -44,7 +45,6 @@ static krb5_error_code
 lkey_to_key(const gss_krb5_lucid_key_t *lkey, krb5_key *key_out)
 {
     krb5_keyblock kb;
-    krb5_key key;
 
     kb.enctype = lkey->type;
     kb.length = lkey->length;
diff --git a/src/util/gss-kernel-lib/kernel_gss.h b/src/util/gss-kernel-lib/kernel_gss.h
new file mode 100644 (file)
index 0000000..b99f461
--- /dev/null
@@ -0,0 +1,36 @@
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/* util/gss-kernel-lib/kernel_gss.h - Declarations for kernel GSS library */
+/*
+ * Copyright (C) 2011 by the 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.
+ */
+
+#ifndef KERNEL_GSS_H
+#define KERNEL_GSS_H
+
+#include <gssapi/gssapi_krb5.h>
+
+OM_uint32
+krb5_gss_import_lucid_sec_context(OM_uint32 *minor_status, void *lctx,
+                                  gss_ctx_id_t *context_handle_out);
+
+#endif /* KERNEL_GSS_H */
index 211cecc2bca7870b1d259aa88026b457cc002bbe..49123c66296dfc4c1d1ecd280d71e09e60cbb6b3 100644 (file)
@@ -27,6 +27,7 @@
 #include "k5-int.h"
 #include <unistd.h>
 #include <gssapi/gssapi_krb5.h>
+#include "t_kgss_common.h"
 
 /* Write len bytes of data to fd, aborting on failure. */
 void
index f5914f421cf792773ba5f5001bbacda36ef19a80..b529620d9f1215d3d6065371cb0e29b30f27b927 100644 (file)
@@ -33,6 +33,9 @@
 #include "k5-int.h"
 #include <unistd.h>
 #include "gssapi_krb5.h"
+#include "gssapiP_krb5.h"
+#include "kernel_gss.h"
+#include "t_kgss_common.h"
 
 /* If major represents an error, display an error message and exit. */
 static void
@@ -101,8 +104,6 @@ static void
 read_wrap_token(gss_ctx_id_t ctx)
 {
     OM_uint32 major, minor;
-    unsigned char *data;
-    size_t len;
     gss_buffer_desc wrapped, buf;
 
     read_data(STDIN_FILENO, &wrapped.value, &wrapped.length);
@@ -118,8 +119,6 @@ static void
 read_mic_token(gss_ctx_id_t ctx)
 {
     OM_uint32 major, minor;
-    unsigned char *data;
-    size_t len;
     gss_buffer_desc mic, buf;
 
     read_data(STDIN_FILENO, &mic.value, &mic.length);
index 6c4b638413f03c7431e122f97d6a277e8650f1d8..ebd711e825bff03ec69dc9535adb950c51e4f83a 100644 (file)
@@ -176,7 +176,7 @@ marshal_lucid_context(const gss_krb5_lucid_context_v1_t *lctx,
     } else
         abort();
     assert(krb5int_buf_data(&buf) != NULL);
-    *data_out = krb5int_buf_data(&buf);
+    *data_out = (unsigned char *)krb5int_buf_data(&buf);
     *len_out = krb5int_buf_len(&buf);
 }
 
@@ -289,8 +289,6 @@ static void
 read_wrap_token(gss_ctx_id_t ctx, int fd)
 {
     OM_uint32 major, minor;
-    unsigned char *data;
-    size_t len;
     gss_buffer_desc wrapped, buf;
 
     read_data(fd, &wrapped.value, &wrapped.length);
@@ -306,8 +304,6 @@ static void
 read_mic_token(gss_ctx_id_t ctx, int fd)
 {
     OM_uint32 major, minor;
-    unsigned char *data;
-    size_t len;
     gss_buffer_desc mic, buf;
 
     read_data(fd, &mic.value, &mic.length);