From: Greg Hudson Date: Mon, 27 Jun 2011 22:23:23 +0000 (+0000) Subject: Enable and fix warnings in util/gss-kernel-lib X-Git-Tag: krb5-1.10-alpha1~378 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b3306310689d72dd1b6284150f70a068dfd98865;p=krb5.git Enable and fix warnings in util/gss-kernel-lib git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24995 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/gss-kernel-lib/Makefile.in b/src/util/gss-kernel-lib/Makefile.in index 988774093..4b26ce118 100644 --- a/src/util/gss-kernel-lib/Makefile.in +++ b/src/util/gss-kernel-lib/Makefile.in @@ -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 = \ diff --git a/src/util/gss-kernel-lib/deps b/src/util/gss-kernel-lib/deps index 25bf0ec34..0acbb4889 100644 --- a/src/util/gss-kernel-lib/deps +++ b/src/util/gss-kernel-lib/deps @@ -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 diff --git a/src/util/gss-kernel-lib/kernel_gss.c b/src/util/gss-kernel-lib/kernel_gss.c index 9c3ac77ab..a0ad8d09d 100644 --- a/src/util/gss-kernel-lib/kernel_gss.c +++ b/src/util/gss-kernel-lib/kernel_gss.c @@ -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 index 000000000..b99f46177 --- /dev/null +++ b/src/util/gss-kernel-lib/kernel_gss.h @@ -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 + +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 */ diff --git a/src/util/gss-kernel-lib/t_kgss_common.c b/src/util/gss-kernel-lib/t_kgss_common.c index 211cecc2b..49123c662 100644 --- a/src/util/gss-kernel-lib/t_kgss_common.c +++ b/src/util/gss-kernel-lib/t_kgss_common.c @@ -27,6 +27,7 @@ #include "k5-int.h" #include #include +#include "t_kgss_common.h" /* Write len bytes of data to fd, aborting on failure. */ void diff --git a/src/util/gss-kernel-lib/t_kgss_kernel.c b/src/util/gss-kernel-lib/t_kgss_kernel.c index f5914f421..b529620d9 100644 --- a/src/util/gss-kernel-lib/t_kgss_kernel.c +++ b/src/util/gss-kernel-lib/t_kgss_kernel.c @@ -33,6 +33,9 @@ #include "k5-int.h" #include #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); diff --git a/src/util/gss-kernel-lib/t_kgss_user.c b/src/util/gss-kernel-lib/t_kgss_user.c index 6c4b63841..ebd711e82 100644 --- a/src/util/gss-kernel-lib/t_kgss_user.c +++ b/src/util/gss-kernel-lib/t_kgss_user.c @@ -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);