Skip to content

Commit

Permalink
actually remove _gsskrb5cfx_wrap_length_cfx
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Dec 11, 2015
1 parent f25a4a3 commit a177f5b
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions lib/gssapi/krb5/cfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,75 +40,6 @@
#define CFXSealed (1 << 1)
#define CFXAcceptorSubkey (1 << 2)

/* Only left for test program */
krb5_error_code
_gsskrb5cfx_wrap_length_cfx(krb5_context context,
krb5_crypto crypto,
int conf_req_flag,
int dce_style,
size_t input_length,
size_t *output_length,
size_t *cksumsize,
uint16_t *padlength)
{
krb5_error_code ret;
krb5_cksumtype type;

/* 16-byte header is always first */
*output_length = sizeof(gss_cfx_wrap_token_desc);
*padlength = 0;

ret = krb5_crypto_get_checksum_type(context, crypto, &type);
if (ret)
return ret;

ret = krb5_checksumsize(context, type, cksumsize);
if (ret)
return ret;

if (conf_req_flag) {
size_t padsize;
krb5_enctype enctype;
krb5_boolean aead;

ret = krb5_crypto_getenctype(context, crypto, &enctype);
if (ret)
return ret;

/* Header is concatenated with data before encryption */
aead = _krb5_enctype_is_aead(context, enctype);
if (!aead)
input_length += sizeof(gss_cfx_wrap_token_desc);

/* Don't propagate MS bug for AEAD modes, MS can fix it */
if (dce_style && !aead) {
ret = krb5_crypto_getblocksize(context, crypto, &padsize);
} else {
ret = krb5_crypto_getpadsize(context, crypto, &padsize);
}
if (ret) {
return ret;
}
if (padsize > 1) {
/* XXX check this */
*padlength = padsize - (input_length % padsize);

/* We add the pad ourselves (noted here for completeness only) */
input_length += *padlength;
}

*output_length += krb5_get_wrapped_length(context,
crypto, input_length);
} else {
/* Checksum is concatenated with data */
*output_length += input_length + *cksumsize;
}

assert(*output_length > input_length);

return 0;
}

OM_uint32
_gssapi_wrap_size_cfx(OM_uint32 *minor_status,
const gsskrb5_ctx ctx,
Expand Down

0 comments on commit a177f5b

Please sign in to comment.