static void test_special(krb5_context context, krb5_crypto crypto, int integ, size_t testsize) { krb5_error_code ret; size_t rsize; OM_uint32 max_wrap_size; size_t cksumsize; uint16_t padsize; ret = _gsskrb5cfx_max_wrap_length_cfx(context, crypto, integ, testsize, &max_wrap_size); if (ret) krb5_errx(context, 1, "_gsskrb5cfx_max_wrap_length_cfx: %d", ret); ret = _gsskrb5cfx_wrap_length_cfx(context, crypto, integ, max_wrap_size, &rsize, &cksumsize, &padsize); if (ret) krb5_errx(context, 1, "_gsskrb5cfx_wrap_length_cfx: %d", ret); if (testsize < rsize) krb5_errx(context, 1, "testsize (%d) < rsize (%d) for max_wrap_size %d", (int)testsize, (int)rsize, (int)max_wrap_size); }
static void test_range(const struct range *r, int integ, krb5_context context, krb5_crypto crypto) { krb5_error_code ret; size_t size, rsize; struct gsskrb5_ctx ctx; for (size = r->lower; size < r->upper; size++) { size_t cksumsize; uint16_t padsize; OM_uint32 minor; OM_uint32 max_wrap_size; ctx.crypto = crypto; ret = _gssapi_wrap_size_cfx(&minor, &ctx, context, integ, 0, size, &max_wrap_size); if (ret) krb5_errx(context, 1, "_gsskrb5cfx_max_wrap_length_cfx: %d", ret); if (max_wrap_size == 0) continue; ret = _gsskrb5cfx_wrap_length_cfx(context, crypto, integ, 0, max_wrap_size, &rsize, &cksumsize, &padsize); if (ret) krb5_errx(context, 1, "_gsskrb5cfx_wrap_length_cfx: %d", ret); if (size < rsize) krb5_errx(context, 1, "size (%d) < rsize (%d) for max_wrap_size %d", (int)size, (int)rsize, (int)max_wrap_size); } }