(krb5_get_wrapped_length): rewrite into different parts for the
derived and non-derived cases git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8170 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2265,14 +2265,24 @@ krb5_string_to_key_derived(krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static size_t
|
||||||
* Return the size of an encrypted packet of length `data_len'
|
wrapped_length (krb5_context context,
|
||||||
*/
|
krb5_crypto crypto,
|
||||||
|
size_t data_len)
|
||||||
|
{
|
||||||
|
struct encryption_type *et = crypto->et;
|
||||||
|
size_t blocksize = et->blocksize;
|
||||||
|
size_t res;
|
||||||
|
|
||||||
size_t
|
res = et->confoundersize + et->cksumtype->checksumsize + data_len;
|
||||||
krb5_get_wrapped_length (krb5_context context,
|
res = (res + blocksize - 1) / blocksize * blocksize;
|
||||||
krb5_crypto crypto,
|
return res;
|
||||||
size_t data_len)
|
}
|
||||||
|
|
||||||
|
static size_t
|
||||||
|
wrapped_length_dervied (krb5_context context,
|
||||||
|
krb5_crypto crypto,
|
||||||
|
size_t data_len)
|
||||||
{
|
{
|
||||||
struct encryption_type *et = crypto->et;
|
struct encryption_type *et = crypto->et;
|
||||||
size_t blocksize = et->blocksize;
|
size_t blocksize = et->blocksize;
|
||||||
@@ -2284,6 +2294,21 @@ krb5_get_wrapped_length (krb5_context context,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the size of an encrypted packet of length `data_len'
|
||||||
|
*/
|
||||||
|
|
||||||
|
size_t
|
||||||
|
krb5_get_wrapped_length (krb5_context context,
|
||||||
|
krb5_crypto crypto,
|
||||||
|
size_t data_len)
|
||||||
|
{
|
||||||
|
if (derived_crypto (context, crypto))
|
||||||
|
return wrapped_length_dervied (context, crypto, data_len);
|
||||||
|
else
|
||||||
|
return wrapped_length (context, crypto, data_len);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CRYPTO_DEBUG
|
#ifdef CRYPTO_DEBUG
|
||||||
|
|
||||||
static krb5_error_code
|
static krb5_error_code
|
||||||
|
Reference in New Issue
Block a user