Save the request buffer so that pre-auth mechanism that needs it can
verify the reply. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15933 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2004 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2005 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -45,6 +45,7 @@ typedef struct krb5_get_init_creds_ctx {
|
|||||||
unsigned nonce;
|
unsigned nonce;
|
||||||
unsigned pk_nonce;
|
unsigned pk_nonce;
|
||||||
|
|
||||||
|
krb5_data req_buffer;
|
||||||
AS_REQ as_req;
|
AS_REQ as_req;
|
||||||
int pa_counter;
|
int pa_counter;
|
||||||
|
|
||||||
@@ -1158,6 +1159,7 @@ process_pa_data_to_key(krb5_context context,
|
|||||||
ctx->pk_init_ctx,
|
ctx->pk_init_ctx,
|
||||||
etype,
|
etype,
|
||||||
ctx->pk_nonce,
|
ctx->pk_nonce,
|
||||||
|
&ctx->req_buffer,
|
||||||
pa,
|
pa,
|
||||||
key);
|
key);
|
||||||
#else
|
#else
|
||||||
@@ -1218,7 +1220,6 @@ init_cred_loop(krb5_context context,
|
|||||||
|
|
||||||
ctx->pa_counter = 0;
|
ctx->pa_counter = 0;
|
||||||
while (ctx->pa_counter < MAX_PA_COUNTER) {
|
while (ctx->pa_counter < MAX_PA_COUNTER) {
|
||||||
krb5_data req;
|
|
||||||
|
|
||||||
ctx->pa_counter++;
|
ctx->pa_counter++;
|
||||||
|
|
||||||
@@ -1237,17 +1238,20 @@ init_cred_loop(krb5_context context,
|
|||||||
prompter, prompter_data);
|
prompter, prompter_data);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
ASN1_MALLOC_ENCODE(AS_REQ, req.data, req.length,
|
|
||||||
|
krb5_data_free(&ctx->req_buffer);
|
||||||
|
|
||||||
|
ASN1_MALLOC_ENCODE(AS_REQ,
|
||||||
|
ctx->req_buffer.data, ctx->req_buffer.length,
|
||||||
&ctx->as_req, &len, ret);
|
&ctx->as_req, &len, ret);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
if(len != req.length)
|
if(len != ctx->req_buffer.length)
|
||||||
krb5_abortx(context, "internal error in ASN.1 encoder");
|
krb5_abortx(context, "internal error in ASN.1 encoder");
|
||||||
|
|
||||||
ret = krb5_sendto_kdc_flags (context, &req,
|
ret = krb5_sendto_kdc_flags (context, &ctx->req_buffer,
|
||||||
&creds->client->realm, &resp,
|
&creds->client->realm, &resp,
|
||||||
send_to_kdc_flags);
|
send_to_kdc_flags);
|
||||||
krb5_data_free(&req);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -1336,6 +1340,7 @@ init_cred_loop(krb5_context context,
|
|||||||
krb5_free_keyblock(context, key);
|
krb5_free_keyblock(context, key);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
krb5_data_free(&ctx->req_buffer);
|
||||||
free_METHOD_DATA(&md);
|
free_METHOD_DATA(&md);
|
||||||
memset(&md, 0, sizeof(md));
|
memset(&md, 0, sizeof(md));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user