Blame SOURCES/Remove-incomplete-PKINIT-OCSP-support.patch

963210
From 9ff3ed399f9a5bb0c6101a986798d80ecc7a1b92 Mon Sep 17 00:00:00 2001
963210
From: Robbie Harwood <rharwood@redhat.com>
963210
Date: Mon, 31 Jul 2017 16:03:41 -0400
963210
Subject: [PATCH] Remove incomplete PKINIT OCSP support
963210
963210
pkinit_kdc_ocsp is non-functional in the PKINIT OpenSSL crypto
963210
implementation, so remove most traces of it, including its man page
963210
entry.  If it is present in kdc.conf, error out of PKINIT
963210
initialization instead of silently ignoring the realm entirely.
963210
963210
ticket: 8603 (new)
963210
(cherry picked from commit 3ff426b9048a8024e5c175256c63cd0ad0572320)
963210
---
963210
 doc/admin/conf_files/kdc_conf.rst            |  3 ---
963210
 src/man/kdc.conf.man                         |  3 ---
963210
 src/plugins/preauth/pkinit/pkinit.h          |  2 +-
963210
 src/plugins/preauth/pkinit/pkinit_identity.c | 11 -----------
963210
 src/plugins/preauth/pkinit/pkinit_srv.c      | 12 ++++++++++--
963210
 5 files changed, 11 insertions(+), 20 deletions(-)
963210
963210
diff --git a/doc/admin/conf_files/kdc_conf.rst b/doc/admin/conf_files/kdc_conf.rst
963210
index 13077ecf4..a4b2a5432 100644
963210
--- a/doc/admin/conf_files/kdc_conf.rst
963210
+++ b/doc/admin/conf_files/kdc_conf.rst
963210
@@ -765,9 +765,6 @@ For information about the syntax of some of these options, see
963210
     pkinit is used to authenticate.  This option may be specified
963210
     multiple times.  (New in release 1.14.)
963210
 
963210
-**pkinit_kdc_ocsp**
963210
-    Specifies the location of the KDC's OCSP.
963210
-
963210
 **pkinit_pool**
963210
     Specifies the location of intermediate certificates which may be
963210
     used by the KDC to complete the trust chain between a client's
963210
diff --git a/src/man/kdc.conf.man b/src/man/kdc.conf.man
963210
index 10b333c38..166e68f9a 100644
963210
--- a/src/man/kdc.conf.man
963210
+++ b/src/man/kdc.conf.man
963210
@@ -886,9 +886,6 @@ Specifies an authentication indicator to include in the ticket if
963210
 pkinit is used to authenticate.  This option may be specified
963210
 multiple times.  (New in release 1.14.)
963210
 .TP
963210
-.B \fBpkinit_kdc_ocsp\fP
963210
-Specifies the location of the KDC\(aqs OCSP.
963210
-.TP
963210
 .B \fBpkinit_pool\fP
963210
 Specifies the location of intermediate certificates which may be
963210
 used by the KDC to complete the trust chain between a client\(aqs
963210
diff --git a/src/plugins/preauth/pkinit/pkinit.h b/src/plugins/preauth/pkinit/pkinit.h
963210
index 876db94c3..a49f3078e 100644
963210
--- a/src/plugins/preauth/pkinit/pkinit.h
963210
+++ b/src/plugins/preauth/pkinit/pkinit.h
963210
@@ -73,6 +73,7 @@
963210
 #define KRB5_CONF_PKINIT_IDENTITIES             "pkinit_identities"
963210
 #define KRB5_CONF_PKINIT_IDENTITY               "pkinit_identity"
963210
 #define KRB5_CONF_PKINIT_KDC_HOSTNAME           "pkinit_kdc_hostname"
963210
+/* pkinit_kdc_ocsp has been removed */
963210
 #define KRB5_CONF_PKINIT_KDC_OCSP               "pkinit_kdc_ocsp"
963210
 #define KRB5_CONF_PKINIT_POOL                   "pkinit_pool"
963210
 #define KRB5_CONF_PKINIT_REQUIRE_CRL_CHECKING   "pkinit_require_crl_checking"
963210
@@ -173,7 +174,6 @@ typedef struct _pkinit_identity_opts {
963210
     char **anchors;
963210
     char **intermediates;
963210
     char **crls;
963210
-    char *ocsp;
963210
     int  idtype;
963210
     char *cert_filename;
963210
     char *key_filename;
963210
diff --git a/src/plugins/preauth/pkinit/pkinit_identity.c b/src/plugins/preauth/pkinit/pkinit_identity.c
963210
index 177a2cad8..a897efa25 100644
963210
--- a/src/plugins/preauth/pkinit/pkinit_identity.c
963210
+++ b/src/plugins/preauth/pkinit/pkinit_identity.c
963210
@@ -125,7 +125,6 @@ pkinit_init_identity_opts(pkinit_identity_opts **idopts)
963210
     opts->anchors = NULL;
963210
     opts->intermediates = NULL;
963210
     opts->crls = NULL;
963210
-    opts->ocsp = NULL;
963210
 
963210
     opts->cert_filename = NULL;
963210
     opts->key_filename = NULL;
963210
@@ -174,12 +173,6 @@ pkinit_dup_identity_opts(pkinit_identity_opts *src_opts,
963210
     if (retval)
963210
         goto cleanup;
963210
 
963210
-    if (src_opts->ocsp != NULL) {
963210
-        newopts->ocsp = strdup(src_opts->ocsp);
963210
-        if (newopts->ocsp == NULL)
963210
-            goto cleanup;
963210
-    }
963210
-
963210
     if (src_opts->cert_filename != NULL) {
963210
         newopts->cert_filename = strdup(src_opts->cert_filename);
963210
         if (newopts->cert_filename == NULL)
963210
@@ -674,10 +667,6 @@ pkinit_identity_prompt(krb5_context context,
963210
         if (retval)
963210
             goto errout;
963210
     }
963210
-    if (idopts->ocsp != NULL) {
963210
-        retval = ENOTSUP;
963210
-        goto errout;
963210
-    }
963210
 
963210
 errout:
963210
     return retval;
963210
diff --git a/src/plugins/preauth/pkinit/pkinit_srv.c b/src/plugins/preauth/pkinit/pkinit_srv.c
963210
index 731d14eb8..32ca122f2 100644
963210
--- a/src/plugins/preauth/pkinit/pkinit_srv.c
963210
+++ b/src/plugins/preauth/pkinit/pkinit_srv.c
963210
@@ -1252,7 +1252,7 @@ static krb5_error_code
963210
 pkinit_init_kdc_profile(krb5_context context, pkinit_kdc_context plgctx)
963210
 {
963210
     krb5_error_code retval;
963210
-    char *eku_string = NULL;
963210
+    char *eku_string = NULL, *ocsp_check = NULL;
963210
 
963210
     pkiDebug("%s: entered for realm %s\n", __FUNCTION__, plgctx->realmname);
963210
     retval = pkinit_kdcdefault_string(context, plgctx->realmname,
963210
@@ -1287,7 +1287,15 @@ pkinit_init_kdc_profile(krb5_context context, pkinit_kdc_context plgctx)
963210
 
963210
     pkinit_kdcdefault_string(context, plgctx->realmname,
963210
                              KRB5_CONF_PKINIT_KDC_OCSP,
963210
-                             &plgctx->idopts->ocsp);
963210
+                             &ocsp_check);
963210
+    if (ocsp_check != NULL) {
963210
+        free(ocsp_check);
963210
+        retval = ENOTSUP;
963210
+        krb5_set_error_message(context, retval,
963210
+                               _("OCSP is not supported: (realm: %s)"),
963210
+                               plgctx->realmname);
963210
+        goto errout;
963210
+    }
963210
 
963210
     pkinit_kdcdefault_integer(context, plgctx->realmname,
963210
                               KRB5_CONF_PKINIT_DH_MIN_BITS,