(sub_wrap_size): gss_wrap_size_limit() has req_output_size and

max_input_size around the wrong way -- it returns the output token
size for a given input size, rather than the maximum input size for a
given output token size.

From: Luke Howard <lukeh@PADL.COM>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12352 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-06-05 23:09:13 +00:00
parent a250f3a1da
commit 93d56af0ae
2 changed files with 28 additions and 12 deletions

View File

@@ -68,12 +68,20 @@ sub_wrap_size (
int extrasize
)
{
size_t len, total_len, padlength;
padlength = blocksize - (req_output_size % blocksize);
len = req_output_size + 8 + padlength + extrasize;
gssapi_krb5_encap_length(len, &len, &total_len);
*max_input_size = (OM_uint32)total_len;
return GSS_S_COMPLETE;
size_t len, total_len;
len = 8 + req_output_size + blocksize + extrasize;
gssapi_krb5_encap_length(len, &len, &total_len);
total_len -= req_output_size; /* token length */
if (total_len < req_output_size) {
*max_input_size = (req_output_size - total_len);
(*max_input_size) &= (~(OM_uint32)(blocksize - 1));
} else {
*max_input_size = 0;
}
return GSS_S_COMPLETE;
}
OM_uint32

View File

@@ -68,12 +68,20 @@ sub_wrap_size (
int extrasize
)
{
size_t len, total_len, padlength;
padlength = blocksize - (req_output_size % blocksize);
len = req_output_size + 8 + padlength + extrasize;
gssapi_krb5_encap_length(len, &len, &total_len);
*max_input_size = (OM_uint32)total_len;
return GSS_S_COMPLETE;
size_t len, total_len;
len = 8 + req_output_size + blocksize + extrasize;
gssapi_krb5_encap_length(len, &len, &total_len);
total_len -= req_output_size; /* token length */
if (total_len < req_output_size) {
*max_input_size = (req_output_size - total_len);
(*max_input_size) &= (~(OM_uint32)(blocksize - 1));
} else {
*max_input_size = 0;
}
return GSS_S_COMPLETE;
}
OM_uint32