From 3367d52373aecb83a8b2ff307e6266ea59a5c851 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 6 Feb 1998 03:48:00 +0000 Subject: [PATCH] wrap_size_limit.c (krb5_gss_wrap_size_limit): Fix bug where if the output header size is greater than the maximum requested output size, return 0 rather than a very large unsigned number. :-) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10413 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 7 +++++++ src/lib/gssapi/krb5/wrap_size_limit.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index f242894f4..1626ec2cf 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 5 22:39:44 1998 Theodore Y. Ts'o + + * wrap_size_limit.c (krb5_gss_wrap_size_limit): Fix bug where if + the output header size is greater than the maximum + requested output size, return 0 rather than a very large + unsigned number. :-) + Fri Jan 30 23:07:40 1998 Tom Yu * init_sec_context.c (krb5_gss_init_sec_context): Actually diff --git a/src/lib/gssapi/krb5/wrap_size_limit.c b/src/lib/gssapi/krb5/wrap_size_limit.c index 8c47d0fa6..e883efde1 100644 --- a/src/lib/gssapi/krb5/wrap_size_limit.c +++ b/src/lib/gssapi/krb5/wrap_size_limit.c @@ -68,8 +68,14 @@ krb5_gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, ohlen = g_token_size((gss_OID) ctx->mech_used, (unsigned int) cfsize + ctx->cksum_size + 14); - /* Cannot have trailer length that will cause us to pad over our length */ - *max_input_size = (req_output_size - ohlen) & (~7); + if (ohlen < req_output_size) + /* + * Cannot have trailer length that will cause us to pad over + * our length + */ + *max_input_size = (req_output_size - ohlen) & (~7); + else + *max_input_size = 0; *minor_status = 0; return(GSS_S_COMPLETE); } -- 2.26.2