Blame SOURCES/Omit-PA_FOR_USER-if-we-can-t-compute-its-checksum.patch

0ba406
From e1b2c967266b14bc37e5ed11e6c0525bd259e0bb Mon Sep 17 00:00:00 2001
9c4c6b
From: Isaac Boukris <iboukris@gmail.com>
9c4c6b
Date: Sat, 6 Jun 2020 11:03:37 +0200
9c4c6b
Subject: [PATCH] Omit PA_FOR_USER if we can't compute its checksum
9c4c6b
9c4c6b
OpenSSL in FIPS mode will refuse to perform hmac-md5.  Omit the legacy
9c4c6b
PA_FOR_USER element in this case rather than failing out.
9c4c6b
9c4c6b
[ghudson@mit.edu: minor code and comment edits; wrote commit message]
9c4c6b
9c4c6b
ticket: 8912 (new)
9c4c6b
(cherry picked from commit 03f122bdb22cfa53c7d855ed929c9541e56365e0)
9c4c6b
(cherry picked from commit 086de78292b8ae89aba8a72926831124da44205d)
9c4c6b
---
9c4c6b
 src/lib/krb5/krb/s4u_creds.c | 7 +++++++
9c4c6b
 1 file changed, 7 insertions(+)
9c4c6b
9c4c6b
diff --git a/src/lib/krb5/krb/s4u_creds.c b/src/lib/krb5/krb/s4u_creds.c
9c4c6b
index fc5c886d6..d8f486dc6 100644
9c4c6b
--- a/src/lib/krb5/krb/s4u_creds.c
9c4c6b
+++ b/src/lib/krb5/krb/s4u_creds.c
9c4c6b
@@ -534,6 +534,13 @@ krb5_get_self_cred_from_kdc(krb5_context context,
9c4c6b
         if (s4u_user.user_id.user != NULL && s4u_user.user_id.user->length) {
9c4c6b
             code = build_pa_for_user(context, tgtptr, &s4u_user.user_id,
9c4c6b
                                      &in_padata[1]);
9c4c6b
+            /*
9c4c6b
+             * If we couldn't compute the hmac-md5 checksum, send only the
9c4c6b
+             * KRB5_PADATA_S4U_X509_USER; this will still work against modern
9c4c6b
+             * Windows and MIT KDCs.
9c4c6b
+             */
9c4c6b
+            if (code == KRB5_CRYPTO_INTERNAL)
9c4c6b
+                code = 0;
9c4c6b
             if (code != 0) {
9c4c6b
                 krb5_free_pa_data(context, in_padata);
9c4c6b
                 goto cleanup;