(krb5_build_authenticator): if the local sequence number is non-zero,
don't generate a new one git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12143 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2003 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -63,22 +63,22 @@ krb5_build_authenticator (krb5_context context,
|
|||||||
copy_Realm(&cred->client->realm, &auth->crealm);
|
copy_Realm(&cred->client->realm, &auth->crealm);
|
||||||
copy_PrincipalName(&cred->client->name, &auth->cname);
|
copy_PrincipalName(&cred->client->name, &auth->cname);
|
||||||
|
|
||||||
{
|
krb5_us_timeofday (context, &auth->ctime, &auth->cusec);
|
||||||
int32_t sec, usec;
|
|
||||||
|
|
||||||
krb5_us_timeofday (context, &sec, &usec);
|
|
||||||
auth->ctime = sec;
|
|
||||||
auth->cusec = usec;
|
|
||||||
}
|
|
||||||
ret = krb5_auth_con_getlocalsubkey(context, auth_context, &auth->subkey);
|
ret = krb5_auth_con_getlocalsubkey(context, auth_context, &auth->subkey);
|
||||||
if(ret)
|
if(ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) {
|
if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) {
|
||||||
|
if(auth_context->local_seqnumber == 0)
|
||||||
krb5_generate_seq_number (context,
|
krb5_generate_seq_number (context,
|
||||||
&cred->session,
|
&cred->session,
|
||||||
&auth_context->local_seqnumber);
|
&auth_context->local_seqnumber);
|
||||||
ALLOC(auth->seq_number, 1);
|
ALLOC(auth->seq_number, 1);
|
||||||
|
if(auth->seq_number == NULL) {
|
||||||
|
ret = ENOMEM;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
*auth->seq_number = auth_context->local_seqnumber;
|
*auth->seq_number = auth_context->local_seqnumber;
|
||||||
} else
|
} else
|
||||||
auth->seq_number = NULL;
|
auth->seq_number = NULL;
|
||||||
@@ -122,7 +122,7 @@ krb5_build_authenticator (krb5_context context,
|
|||||||
free (auth);
|
free (auth);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
fail:
|
fail:
|
||||||
free_Authenticator (auth);
|
free_Authenticator (auth);
|
||||||
free (auth);
|
free (auth);
|
||||||
free (buf);
|
free (buf);
|
||||||
|
Reference in New Issue
Block a user