if (key == NULL)
return KRB5KDC_ERR_NULL_KEY;
- code = krb5_k_make_checksum(context, 0, key, KRB5_KEYUSAGE_IAKERB_FINISHED,
- conv, &iaf.checksum);
+ code = krb5_k_make_checksum(context, 0, key, KRB5_KEYUSAGE_FINISHED, conv,
+ &iaf.checksum);
if (code != 0)
return code;
if (code != 0)
return code;
- code = krb5_k_verify_checksum(context, key, KRB5_KEYUSAGE_IAKERB_FINISHED,
- conv, &iaf->checksum, &valid);
+ code = krb5_k_verify_checksum(context, key, KRB5_KEYUSAGE_FINISHED, conv,
+ &iaf->checksum, &valid);
if (code == 0 && valid == FALSE)
code = KRB5KRB_AP_ERR_BAD_INTEGRITY;
*/
static krb5_error_code
iakerb_parse_token(iakerb_ctx_id_t ctx,
- int initialContextToken,
const gss_buffer_t token,
krb5_data *realm,
krb5_data **cookie,
krb5_iakerb_header *iah = NULL;
unsigned int bodysize;
uint8_t *body;
- int flags = 0;
krb5_data data;
struct k5input in, seq;
goto cleanup;
}
- if (initialContextToken)
- flags |= G_VFY_TOKEN_HDR_WRAPPER_REQUIRED;
-
body = token->value;
code = g_verify_token_header(gss_mech_iakerb, &bodysize, &body,
- IAKERB_TOK_PROXY, token->length, flags);
+ IAKERB_TOK_PROXY, token->length,
+ G_VFY_TOKEN_HDR_WRAPPER_REQUIRED);
if (code != 0)
goto cleanup;
krb5_data *realm,
krb5_data *cookie,
krb5_data *request,
- int initialContextToken,
gss_buffer_t token)
{
krb5_error_code code;
memcpy(data->data + data->length, request->data, request->length);
data->length += request->length;
- if (initialContextToken)
- tokenSize = g_token_size(gss_mech_iakerb, data->length);
- else
- tokenSize = 2 + data->length;
-
+ tokenSize = g_token_size(gss_mech_iakerb, data->length);
token->value = gssalloc_malloc(tokenSize);
if (token->value == NULL) {
code = ENOMEM;
token->length = tokenSize;
k5_buf_init_fixed(&buf, token->value, token->length);
- if (initialContextToken) {
- g_make_token_header(&buf, gss_mech_iakerb, data->length,
- IAKERB_TOK_PROXY);
- } else {
- k5_buf_add_uint16_be(&buf, IAKERB_TOK_PROXY);
- }
+ g_make_token_header(&buf, gss_mech_iakerb, data->length, IAKERB_TOK_PROXY);
k5_buf_add_len(&buf, data->data, data->length);
assert(buf.len == token->length);
*/
static krb5_error_code
iakerb_acceptor_step(iakerb_ctx_id_t ctx,
- int initialContextToken,
const gss_buffer_t input_token,
gss_buffer_t output_token)
{
goto cleanup;
}
- code = iakerb_parse_token(ctx, initialContextToken, input_token, &realm,
- NULL, &request);
+ code = iakerb_parse_token(ctx, input_token, &realm, NULL, &request);
if (code != 0)
goto cleanup;
} else if (code != 0)
goto cleanup;
- code = iakerb_make_token(ctx, &realm, NULL, &reply, 0, output_token);
+ code = iakerb_make_token(ctx, &realm, NULL, &reply, output_token);
if (code != 0)
goto cleanup;
output_token->value = NULL;
if (input_token != GSS_C_NO_BUFFER && input_token->length > 0) {
- code = iakerb_parse_token(ctx, 0, input_token, NULL, &cookie, &in);
+ code = iakerb_parse_token(ctx, input_token, NULL, &cookie, &in);
if (code != 0)
goto cleanup;
if (out.length != 0) {
assert(ctx->state != IAKERB_AP_REQ);
- code = iakerb_make_token(ctx, &realm, cookie, &out,
- (input_token == GSS_C_NO_BUFFER),
- output_token);
+ code = iakerb_make_token(ctx, &realm, cookie, &out, output_token);
if (code != 0)
goto cleanup;
major_status = GSS_S_DEFECTIVE_TOKEN;
goto cleanup;
}
- code = iakerb_acceptor_step(ctx, initialContextToken,
- input_token, output_token);
+ code = iakerb_acceptor_step(ctx, input_token, output_token);
if (code == (OM_uint32)KRB5_BAD_MSIZE)
major_status = GSS_S_DEFECTIVE_TOKEN;
if (code != 0)
#define PRIM_REAL 0x09 /* Real */
#define PRIM_ENUM 0x0a /* Enumerated type */
#define PRIM_ENCR 0x0b /* Encrypted */
+#define PRIM_UTF8 0x0c /* UTF8String */
#define CONS_SEQ 0x10 /* SEQUENCE/SEQUENCE OF */
#define CONS_SET 0x11 /* SET/SET OF */
#define DEFN_NUMS 0x12 /* Numeric String */
/*
* Only try this printing function with "reasonable" types
*/
- if ((tag < DEFN_NUMS) && (tag != PRIM_OCTS))
+ if ((tag < DEFN_NUMS) && (tag != PRIM_OCTS) && (tag != PRIM_UTF8))
return 0;
for (i=0; i < len; i++)
{ PRIM_REAL, -1, "Real"},
{ PRIM_ENUM, -1, "Enumerated type"},
{ PRIM_ENCR, -1, "Encrypted"},
+ { PRIM_UTF8, -1, "UTF8String"},
{ CONS_SEQ, -1, "Sequence/Sequence Of"},
{ CONS_SET, -1, "Set/Set Of"},
{ DEFN_NUMS, -1, "Numeric String"},