From 97d5374e66f13db71b622a26e06271bcedbab31d Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sun, 25 Feb 1996 00:27:20 +0000 Subject: [PATCH] Add support for new V2 call gss_wrap_size_limit() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7532 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/mechglue/ChangeLog | 3 ++ src/lib/gssapi/mechglue/g_seal.c | 46 +++++++++++++++++++++++++++++-- src/lib/gssapi/mechglue/mglueP.h | 10 +++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/lib/gssapi/mechglue/ChangeLog b/src/lib/gssapi/mechglue/ChangeLog index c2a45cd0a..1a9afca67 100644 --- a/src/lib/gssapi/mechglue/ChangeLog +++ b/src/lib/gssapi/mechglue/ChangeLog @@ -1,5 +1,8 @@ Sat Feb 24 16:19:30 1996 Theodore Y. Ts'o + * mglueP.h: + * g_seal.c: Add support for new V2 call gss_wrap_size_limit() + * g_mechname.c (gss_add_mech_name_type): Only mark a name-type as being non-mechanism-specific if the mechanism doesn't match the type currently associated with the name-type. diff --git a/src/lib/gssapi/mechglue/g_seal.c b/src/lib/gssapi/mechglue/g_seal.c index 7512cecc4..99805a422 100644 --- a/src/lib/gssapi/mechglue/g_seal.c +++ b/src/lib/gssapi/mechglue/g_seal.c @@ -28,7 +28,7 @@ #include "mglueP.h" -OM_uint32 +OM_uint32 INTERFACE gss_seal (minor_status, context_handle, conf_req_flag, @@ -83,7 +83,7 @@ gss_buffer_t output_message_buffer; return(GSS_S_NO_CONTEXT); } -OM_uint32 +OM_uint32 INTERFACE gss_wrap (minor_status, context_handle, conf_req_flag, @@ -105,3 +105,45 @@ gss_buffer_t output_message_buffer; (int) qop_req, input_message_buffer, conf_state, output_message_buffer); } + +/* + * New for V2 + */ +OM_uint32 INTERFACE +gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, + qop_req, req_output_size, max_input_size) + OM_uint32 *minor_status; + gss_ctx_id_t context_handle; + int conf_req_flag; + gss_qop_t qop_req; + OM_uint32 req_output_size; + OM_uint32 *max_input_size; +{ + OM_uint32 status; + gss_union_ctx_id_t ctx; + gss_mechanism mech; + + gss_initialize(); + + if (context_handle == GSS_C_NO_CONTEXT) + return GSS_S_NO_CONTEXT; + + /* + * select the approprate underlying mechanism routine and + * call it. + */ + + ctx = (gss_union_ctx_id_t) context_handle; + mech = __gss_get_mechanism (ctx->mech_type); + + if (!mech) + return (GSS_S_NO_CONTEXT); + + if (!mech->gss_wrap_size_limit) + return (GSS_S_BAD_BINDINGS); + + status = mech->gss_wrap_size_limit(mech->context, minor_status, + context_handle, conf_req_flag, qop_req, + req_output_size, max_input_size); + return(status); +} diff --git a/src/lib/gssapi/mechglue/mglueP.h b/src/lib/gssapi/mechglue/mglueP.h index 553064419..0abc81cf2 100644 --- a/src/lib/gssapi/mechglue/mglueP.h +++ b/src/lib/gssapi/mechglue/mglueP.h @@ -316,6 +316,16 @@ typedef struct gss_config { OM_uint32 *, /* minor_status */ gss_OID * /* OID */ )); + OM_uint32 (*gss_wrap_size_limit) + NPROTOTYPE(( + void *, /* context */ + OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + OM_uint32, /* req_output_size */ + OM_uint32 * /* max_input_size */ + )); int (*pname_to_uid) NPROTOTYPE(( void *, /* context */ -- 2.26.2