Blame SOURCES/Ignore-bad-enctypes-in-krb5_string_to_keysalts.patch

f7a442
From 42e29f27ce64fece2839bcce910813e97ca31210 Mon Sep 17 00:00:00 2001
d13f53
From: Robbie Harwood <rharwood@redhat.com>
d13f53
Date: Wed, 15 Jul 2020 15:42:20 -0400
d13f53
Subject: [PATCH] Ignore bad enctypes in krb5_string_to_keysalts()
d13f53
d13f53
Fixes a problem where the presence of legacy/unrecognized keysalts in
d13f53
supported_enctypes would prevent the kadmin programs from starting.
d13f53
d13f53
[ghudson@mit.edu: ideally we would put a warning in the kadmind log,
d13f53
but that is difficult to do when the parsing is done inside a library.
d13f53
Even adding a trace log is difficult because the kadm5 str_conv
d13f53
functions do not accept contexts.]
d13f53
d13f53
ticket: 8929 (new)
d13f53
(cherry picked from commit be5396ada0e8dabd68bd0aceb733cfca39a609bc)
d13f53
(cherry picked from commit 3f873868fb08b77da2d30e164a0ef6c71c17c607)
d13f53
---
d13f53
 src/lib/kadm5/str_conv.c | 7 ++++---
d13f53
 1 file changed, 4 insertions(+), 3 deletions(-)
d13f53
d13f53
diff --git a/src/lib/kadm5/str_conv.c b/src/lib/kadm5/str_conv.c
d13f53
index 7cf51d316..798295606 100644
d13f53
--- a/src/lib/kadm5/str_conv.c
d13f53
+++ b/src/lib/kadm5/str_conv.c
d13f53
@@ -340,9 +340,10 @@ krb5_string_to_keysalts(const char *string, const char *tupleseps,
d13f53
     while ((ksp = strtok_r(p, tseps, &tlasts)) != NULL) {
d13f53
         /* Pass a null pointer to subsequent calls to strtok_r(). */
d13f53
         p = NULL;
d13f53
-        ret = string_to_keysalt(ksp, ksaltseps, &etype, &stype);
d13f53
-        if (ret)
d13f53
-            goto cleanup;
d13f53
+
d13f53
+        /* Discard unrecognized keysalts. */
d13f53
+        if (string_to_keysalt(ksp, ksaltseps, &etype, &stype) != 0)
d13f53
+            continue;
d13f53
 
d13f53
         /* Ignore duplicate keysalts if caller asks. */
d13f53
         if (!dups && krb5_keysalt_is_present(ksalts, nksalts, etype, stype))