lib/krb5: initialize kdc_offset in the memory ccache from the krb5_context

This ensures we inherit the clock skew adjustment from the AS-REQ/REP into the
memory ccache in a similar way done for the file ccache.

This means krb5_cc_get_kdc_offset() will return the correct value and
_krb5_get_cred_kdc_any() uses the adjusted time in the authenticator of
subsequent TGS-REQ.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15676

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme
2024-07-04 15:03:19 +02:00
committed by Jeffrey Altman
parent c2e68593a5
commit a2a765f88e

View File

@@ -233,7 +233,7 @@ mcc_initialize(krb5_context context,
*/
mcc_destroy_internal(context, m);
m->dead = 0;
m->kdc_offset = 0;
m->kdc_offset = context->kdc_sec_offset;
m->mtime = time(NULL);
ret = krb5_copy_principal (context,
primary_principal,