From a2a765f88e9aba3ccb55dc35b31f6dec6a600cff Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 4 Jul 2024 15:03:19 +0200 Subject: [PATCH] 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 Signed-off-by: Ralph Boehme Signed-off-by: Stefan Metzmacher --- lib/krb5/mcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/krb5/mcache.c b/lib/krb5/mcache.c index adcb55097..80b510757 100644 --- a/lib/krb5/mcache.c +++ b/lib/krb5/mcache.c @@ -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,