From 8366f1c53b60c41bd0ce64bce425ab811a62afe0 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 11 Apr 2011 22:23:47 +0000 Subject: [PATCH] Shuffle around some gss-krb5 entry points to eliminate four mostly content-free source files and better separate IOV stuff from non-IOV stuff. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24874 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/Makefile.in | 12 ----- src/lib/gssapi/krb5/k5seal.c | 31 ++++++++++++ src/lib/gssapi/krb5/k5sealiov.c | 68 ++++++++++++++++++++++++++ src/lib/gssapi/krb5/k5unseal.c | 37 ++++++++++++++ src/lib/gssapi/krb5/k5unsealiov.c | 35 +++++++++++++ src/lib/gssapi/krb5/seal.c | 81 ------------------------------- src/lib/gssapi/krb5/sign.c | 77 ----------------------------- src/lib/gssapi/krb5/unseal.c | 66 ------------------------- src/lib/gssapi/krb5/verify.c | 65 ------------------------- 9 files changed, 171 insertions(+), 301 deletions(-) delete mode 100644 src/lib/gssapi/krb5/seal.c delete mode 100644 src/lib/gssapi/krb5/sign.c delete mode 100644 src/lib/gssapi/krb5/unseal.c delete mode 100644 src/lib/gssapi/krb5/verify.c diff --git a/src/lib/gssapi/krb5/Makefile.in b/src/lib/gssapi/krb5/Makefile.in index 0ff0d39b2..5998fc08c 100644 --- a/src/lib/gssapi/krb5/Makefile.in +++ b/src/lib/gssapi/krb5/Makefile.in @@ -74,19 +74,15 @@ SRCS = \ $(srcdir)/rel_oid.c \ $(srcdir)/rel_name.c \ $(srcdir)/s4u_gss_glue.c \ - $(srcdir)/seal.c \ $(srcdir)/set_allowable_enctypes.c \ $(srcdir)/ser_sctx.c \ $(srcdir)/set_ccache.c \ - $(srcdir)/sign.c \ $(srcdir)/store_cred.c \ - $(srcdir)/unseal.c \ $(srcdir)/util_cksum.c \ $(srcdir)/util_crypt.c \ $(srcdir)/util_seed.c \ $(srcdir)/util_seqnum.c \ $(srcdir)/val_cred.c \ - $(srcdir)/verify.c \ $(srcdir)/wrap_size_limit.c @@ -128,19 +124,15 @@ OBJS = \ $(OUTPRE)rel_oid.$(OBJEXT) \ $(OUTPRE)rel_name.$(OBJEXT) \ $(OUTPRE)s4u_gss_glue.$(OBJEXT) \ - $(OUTPRE)seal.$(OBJEXT) \ $(OUTPRE)set_allowable_enctypes.$(OBJEXT) \ $(OUTPRE)ser_sctx.$(OBJEXT) \ $(OUTPRE)set_ccache.$(OBJEXT) \ - $(OUTPRE)sign.$(OBJEXT) \ $(OUTPRE)store_cred.$(OBJEXT) \ - $(OUTPRE)unseal.$(OBJEXT) \ $(OUTPRE)util_cksum.$(OBJEXT) \ $(OUTPRE)util_crypt.$(OBJEXT) \ $(OUTPRE)util_seed.$(OBJEXT) \ $(OUTPRE)util_seqnum.$(OBJEXT) \ $(OUTPRE)val_cred.$(OBJEXT) \ - $(OUTPRE)verify.$(OBJEXT) \ $(OUTPRE)wrap_size_limit.$(OBJEXT) \ $(OUTPRE)gssapi_err_krb5.$(OBJEXT) @@ -185,19 +177,15 @@ STLIBOBJS = \ rel_oid.o \ rel_name.o \ s4u_gss_glue.o \ - seal.o \ set_allowable_enctypes.o \ ser_sctx.o \ set_ccache.o \ - sign.o \ store_cred.o \ - unseal.o \ util_cksum.o \ util_crypt.o \ util_seed.o \ util_seqnum.o \ val_cred.o \ - verify.o \ wrap_size_limit.o \ gssapi_err_krb5.o diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index 46accf1ac..5354434cc 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -392,3 +392,34 @@ kg_seal(minor_status, context_handle, conf_req_flag, qop_req, *minor_status = 0; return(GSS_S_COMPLETE); } + +OM_uint32 +krb5_gss_wrap(minor_status, context_handle, conf_req_flag, + qop_req, input_message_buffer, conf_state, + output_message_buffer) + OM_uint32 *minor_status; + gss_ctx_id_t context_handle; + int conf_req_flag; + gss_qop_t qop_req; + gss_buffer_t input_message_buffer; + int *conf_state; + gss_buffer_t output_message_buffer; +{ + return(kg_seal(minor_status, context_handle, conf_req_flag, + qop_req, input_message_buffer, conf_state, + output_message_buffer, KG_TOK_WRAP_MSG)); +} + +OM_uint32 +krb5_gss_get_mic(minor_status, context_handle, qop_req, + message_buffer, message_token) + OM_uint32 *minor_status; + gss_ctx_id_t context_handle; + gss_qop_t qop_req; + gss_buffer_t message_buffer; + gss_buffer_t message_token; +{ + return(kg_seal(minor_status, context_handle, 0, + qop_req, message_buffer, NULL, + message_token, KG_TOK_MIC_MSG)); +} diff --git a/src/lib/gssapi/krb5/k5sealiov.c b/src/lib/gssapi/krb5/k5sealiov.c index 445cdc79a..8c4ec8bba 100644 --- a/src/lib/gssapi/krb5/k5sealiov.c +++ b/src/lib/gssapi/krb5/k5sealiov.c @@ -499,3 +499,71 @@ kg_seal_iov_length(OM_uint32 *minor_status, return GSS_S_COMPLETE; } + +OM_uint32 +krb5_gss_wrap_iov(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + int conf_req_flag, + gss_qop_t qop_req, + int *conf_state, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_seal_iov(minor_status, context_handle, conf_req_flag, + qop_req, conf_state, + iov, iov_count, KG_TOK_WRAP_MSG); + + return major_status; +} + +OM_uint32 +krb5_gss_wrap_iov_length(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + int conf_req_flag, + gss_qop_t qop_req, + int *conf_state, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_seal_iov_length(minor_status, context_handle, conf_req_flag, + qop_req, conf_state, iov, iov_count); + return major_status; +} + +#if 0 +OM_uint32 +krb5_gss_get_mic_iov(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + gss_qop_t qop_req, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_seal_iov(minor_status, context_handle, FALSE, + qop_req, NULL, + iov, iov_count, KG_TOK_MIC_MSG); + + return major_status; +} + +OM_uint32 +krb5_gss_get_mic_iov_length(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + int conf_req_flag, + gss_qop_t qop_req, + int *conf_state, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_seal_iov_length(minor_status, context_handle, conf_req_flag, + qop_req, conf_state, iov, iov_count); + return major_status; +} +#endif diff --git a/src/lib/gssapi/krb5/k5unseal.c b/src/lib/gssapi/krb5/k5unseal.c index 4e9ee7739..6c5ea0997 100644 --- a/src/lib/gssapi/krb5/k5unseal.c +++ b/src/lib/gssapi/krb5/k5unseal.c @@ -550,3 +550,40 @@ kg_unseal(minor_status, context_handle, input_token_buffer, return ret; } + +OM_uint32 +krb5_gss_unwrap(minor_status, context_handle, + input_message_buffer, output_message_buffer, + conf_state, qop_state) + OM_uint32 *minor_status; + gss_ctx_id_t context_handle; + gss_buffer_t input_message_buffer; + gss_buffer_t output_message_buffer; + int *conf_state; + gss_qop_t *qop_state; +{ + OM_uint32 rstat; + + rstat = kg_unseal(minor_status, context_handle, + input_message_buffer, output_message_buffer, + conf_state, qop_state, KG_TOK_WRAP_MSG); + return(rstat); +} + +OM_uint32 +krb5_gss_verify_mic(minor_status, context_handle, + message_buffer, token_buffer, + qop_state) + OM_uint32 *minor_status; + gss_ctx_id_t context_handle; + gss_buffer_t message_buffer; + gss_buffer_t token_buffer; + gss_qop_t *qop_state; +{ + OM_uint32 rstat; + + rstat = kg_unseal(minor_status, context_handle, + token_buffer, message_buffer, + NULL, qop_state, KG_TOK_MIC_MSG); + return(rstat); +} diff --git a/src/lib/gssapi/krb5/k5unsealiov.c b/src/lib/gssapi/krb5/k5unsealiov.c index 185389d68..f62cf7910 100644 --- a/src/lib/gssapi/krb5/k5unsealiov.c +++ b/src/lib/gssapi/krb5/k5unsealiov.c @@ -648,3 +648,38 @@ kg_unseal_iov(OM_uint32 *minor_status, return code; } + +OM_uint32 +krb5_gss_unwrap_iov(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + int *conf_state, + gss_qop_t *qop_state, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_unseal_iov(minor_status, context_handle, + conf_state, qop_state, + iov, iov_count, KG_TOK_WRAP_MSG); + + return major_status; +} + +#if 0 +OM_uint32 +krb5_gss_verify_mic_iov(OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + gss_qop_t *qop_state, + gss_iov_buffer_desc *iov, + int iov_count) +{ + OM_uint32 major_status; + + major_status = kg_unseal_iov(minor_status, context_handle, + NULL, qop_state, + iov, iov_count, KG_TOK_WRAP_MSG); + + return major_status; +} +#endif diff --git a/src/lib/gssapi/krb5/seal.c b/src/lib/gssapi/krb5/seal.c deleted file mode 100644 index 7f48c7ae6..000000000 --- a/src/lib/gssapi/krb5/seal.c +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* - * Copyright 1993 by OpenVision Technologies, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appears in all copies and - * that both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "gssapiP_krb5.h" - -/* - * $Id$ - */ - -/* V2 interface */ -OM_uint32 -krb5_gss_wrap(minor_status, context_handle, conf_req_flag, - qop_req, input_message_buffer, conf_state, - output_message_buffer) - OM_uint32 *minor_status; - gss_ctx_id_t context_handle; - int conf_req_flag; - gss_qop_t qop_req; - gss_buffer_t input_message_buffer; - int *conf_state; - gss_buffer_t output_message_buffer; -{ - return(kg_seal(minor_status, context_handle, conf_req_flag, - qop_req, input_message_buffer, conf_state, - output_message_buffer, KG_TOK_WRAP_MSG)); -} - -/* AEAD interfaces */ -OM_uint32 -krb5_gss_wrap_iov(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - int conf_req_flag, - gss_qop_t qop_req, - int *conf_state, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_seal_iov(minor_status, context_handle, conf_req_flag, - qop_req, conf_state, - iov, iov_count, KG_TOK_WRAP_MSG); - - return major_status; -} - -OM_uint32 -krb5_gss_wrap_iov_length(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - int conf_req_flag, - gss_qop_t qop_req, - int *conf_state, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_seal_iov_length(minor_status, context_handle, conf_req_flag, - qop_req, conf_state, iov, iov_count); - return major_status; -} diff --git a/src/lib/gssapi/krb5/sign.c b/src/lib/gssapi/krb5/sign.c deleted file mode 100644 index 028423b7c..000000000 --- a/src/lib/gssapi/krb5/sign.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* - * Copyright 1993 by OpenVision Technologies, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appears in all copies and - * that both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "gssapiP_krb5.h" - -/* - * $Id$ - */ - -/* V2 interface */ -OM_uint32 -krb5_gss_get_mic(minor_status, context_handle, qop_req, - message_buffer, message_token) - OM_uint32 *minor_status; - gss_ctx_id_t context_handle; - gss_qop_t qop_req; - gss_buffer_t message_buffer; - gss_buffer_t message_token; -{ - return(kg_seal(minor_status, context_handle, 0, - qop_req, message_buffer, NULL, - message_token, KG_TOK_MIC_MSG)); -} - -#if 0 -OM_uint32 -krb5_gss_get_mic_iov(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - gss_qop_t qop_req, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_seal_iov(minor_status, context_handle, FALSE, - qop_req, NULL, - iov, iov_count, KG_TOK_MIC_MSG); - - return major_status; -} - -OM_uint32 -krb5_gss_get_mic_iov_length(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - int conf_req_flag, - gss_qop_t qop_req, - int *conf_state, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_seal_iov_length(minor_status, context_handle, conf_req_flag, - qop_req, conf_state, iov, iov_count); - return major_status; -} -#endif diff --git a/src/lib/gssapi/krb5/unseal.c b/src/lib/gssapi/krb5/unseal.c deleted file mode 100644 index a764a4565..000000000 --- a/src/lib/gssapi/krb5/unseal.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* - * Copyright 1993 by OpenVision Technologies, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appears in all copies and - * that both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "gssapiP_krb5.h" - -/* - * $Id$ - */ - -/* V2 interface */ -OM_uint32 -krb5_gss_unwrap(minor_status, context_handle, - input_message_buffer, output_message_buffer, - conf_state, qop_state) - OM_uint32 *minor_status; - gss_ctx_id_t context_handle; - gss_buffer_t input_message_buffer; - gss_buffer_t output_message_buffer; - int *conf_state; - gss_qop_t *qop_state; -{ - OM_uint32 rstat; - - rstat = kg_unseal(minor_status, context_handle, - input_message_buffer, output_message_buffer, - conf_state, qop_state, KG_TOK_WRAP_MSG); - return(rstat); -} - -/* AEAD interface */ -OM_uint32 -krb5_gss_unwrap_iov(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - int *conf_state, - gss_qop_t *qop_state, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_unseal_iov(minor_status, context_handle, - conf_state, qop_state, - iov, iov_count, KG_TOK_WRAP_MSG); - - return major_status; -} diff --git a/src/lib/gssapi/krb5/verify.c b/src/lib/gssapi/krb5/verify.c deleted file mode 100644 index e4433534f..000000000 --- a/src/lib/gssapi/krb5/verify.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* - * Copyright 1993 by OpenVision Technologies, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appears in all copies and - * that both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "gssapiP_krb5.h" - -/* - * $Id$ - */ - -/* V2 interface */ -OM_uint32 -krb5_gss_verify_mic(minor_status, context_handle, - message_buffer, token_buffer, - qop_state) - OM_uint32 *minor_status; - gss_ctx_id_t context_handle; - gss_buffer_t message_buffer; - gss_buffer_t token_buffer; - gss_qop_t *qop_state; -{ - OM_uint32 rstat; - - rstat = kg_unseal(minor_status, context_handle, - token_buffer, message_buffer, - NULL, qop_state, KG_TOK_MIC_MSG); - return(rstat); -} - -#if 0 -OM_uint32 -krb5_gss_verify_mic_iov(OM_uint32 *minor_status, - gss_ctx_id_t context_handle, - gss_qop_t *qop_state, - gss_iov_buffer_desc *iov, - int iov_count) -{ - OM_uint32 major_status; - - major_status = kg_unseal_iov(minor_status, context_handle, - NULL, qop_state, - iov, iov_count, KG_TOK_WRAP_MSG); - - return major_status; -} -#endif -- 2.26.2