From 7e6b818fea5541fbedaa68624ca76ebc1fbbf501 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 Aug 2021 11:21:51 +1200 Subject: [PATCH] ktutil: Print the numeric enctype if krb5_enctype_to_string() fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sadly krb5_enctype_to_string() fails when des-cbc-crc encyrption type is removed, leaving a failure the operate rather than falling back to anything useful. So fall back to printing 3 in the absense of anything more useful. A future fix could be to hard-code this mapping in the smb_krb5_enctype_to_string() wrapper. Signed-off-by: Andrew Bartlett Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Fri Aug 6 05:53:44 UTC 2021 on sn-devel-184 --- source4/kdc/ktutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source4/kdc/ktutil.c b/source4/kdc/ktutil.c index 59aa1cf377f..732d247446c 100644 --- a/source4/kdc/ktutil.c +++ b/source4/kdc/ktutil.c @@ -96,11 +96,11 @@ int main (int argc, char **argv) enctype, &enctype_str); if (ret) { - smb_krb5_err(mem_ctx, context, 1, ret, "krb5_enctype_to_string"); + printf("%s (%d)\n", principal, (int)enctype); + } else { + printf("%s (%s)\n", principal, enctype_str); } - printf("%s (%s)\n", principal, enctype_str); - TALLOC_FREE(principal); SAFE_FREE(enctype_str); smb_krb5_kt_free_entry(context, &entry);