]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ktutil: Print the numeric enctype if krb5_enctype_to_string() fails
authorAndrew Bartlett <abartlet@samba.org>
Sun, 1 Aug 2021 23:21:51 +0000 (11:21 +1200)
committerRalph Boehme <slow@samba.org>
Fri, 6 Aug 2021 05:53:44 +0000 (05:53 +0000)
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 <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Aug  6 05:53:44 UTC 2021 on sn-devel-184

source4/kdc/ktutil.c

index 59aa1cf377fa8fcfdf03f3a11a585055d2b09c5c..732d247446c47946f613943a80cd023264f4c28d 100644 (file)
@@ -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);