Blame SOURCES/0022-Allow-configuration-of-client-SCEP-algorithms.patch

fff44d
From 3523ad7b8b2349ed4ee301b992797902b7288028 Mon Sep 17 00:00:00 2001
fff44d
From: Trevor Vaughan <tvaughan@onyxpoint.com>
fff44d
Date: Fri, 23 Feb 2018 16:11:35 -0500
fff44d
Subject: [PATCH 22/25] Allow configuration of client SCEP algorithms
fff44d
fff44d
* Allow users to set `scep_cipher` and `scep_digest` in their CA
fff44d
configuration. These settings are authoritative and will override
fff44d
anything from the server.  This was added to support connections to
fff44d
systems, such as Dogtag, that do not provide a CA capabilities string
fff44d
and, therefore, are prone to causing incorrect ciphers to be used on the
fff44d
client side.
fff44d
fff44d
* In accordance with the latest SCEP Draft RFC, the default cipher has
fff44d
been changed to AES-256 and the default digest has been changed to
fff44d
SHA-256. These were chosen as reasonable defaults for most users and
fff44d
systems.
fff44d
fff44d
* To ease the determination of which configuration file controls what
fff44d
CA, the output of `getcert list-cas -v` was updated to print a
fff44d
`config-path` entry which will list the specific configuration
fff44d
associated with a given CA.
fff44d
fff44d
Closes #89
fff44d
---
fff44d
 src/getcert.c     |   6 ++
fff44d
 src/prefs.h       |   5 ++
fff44d
 src/scepgen-o.c   | 182 ++++++++++++++++++++++++++++++++++++++++++------------
fff44d
 src/store-files.c |  22 +++++++
fff44d
 src/store-int.h   |   4 ++
fff44d
 src/tdbus.h       |   2 +
fff44d
 src/tdbush.c      | 149 +++++++++++++++++++++++++++++++++++++++++++-
fff44d
 7 files changed, 331 insertions(+), 39 deletions(-)
fff44d
fff44d
diff --git a/src/getcert.c b/src/getcert.c
fff44d
index 35fd0d6..724d125 100644
fff44d
--- a/src/getcert.c
fff44d
+++ b/src/getcert.c
fff44d
@@ -4157,6 +4157,12 @@ list_cas(const char *argv0, int argc, const char **argv)
fff44d
 		if ((s != NULL) && (strlen(s) > 0)) {
fff44d
 			printf(_("\tpost-save command: %s\n"), s);
fff44d
 		}
fff44d
+		if (verbose > 0) {
fff44d
+			printf(_("\tconfig-path: %s\n"),
fff44d
+			       query_rep_s(bus, cas[i], CM_DBUS_CA_INTERFACE,
fff44d
+					   "get_config_file_path",
fff44d
+					   verbose, globals.tctx));
fff44d
+		}
fff44d
 	}
fff44d
 	return 0;
fff44d
 }
fff44d
diff --git a/src/prefs.h b/src/prefs.h
fff44d
index 231aea7..349ec64 100644
fff44d
--- a/src/prefs.h
fff44d
+++ b/src/prefs.h
fff44d
@@ -20,9 +20,12 @@
fff44d
 
fff44d
 enum cm_prefs_cipher {
fff44d
 	cm_prefs_aes128,
fff44d
+	cm_prefs_aes192,
fff44d
 	cm_prefs_aes256,
fff44d
 	cm_prefs_des3,
fff44d
 	cm_prefs_des,
fff44d
+	/* This is for the selection logic */
fff44d
+	cm_prefs_nocipher,
fff44d
 };
fff44d
 
fff44d
 enum cm_prefs_digest {
fff44d
@@ -31,6 +34,8 @@ enum cm_prefs_digest {
fff44d
 	cm_prefs_sha512,
fff44d
 	cm_prefs_sha1,
fff44d
 	cm_prefs_md5,
fff44d
+	/* This is for the selection logic */
fff44d
+	cm_prefs_nodigest,
fff44d
 };
fff44d
 
fff44d
 enum cm_notification_method;
fff44d
diff --git a/src/scepgen-o.c b/src/scepgen-o.c
fff44d
index d11e3de..07c2b8b 100644
fff44d
--- a/src/scepgen-o.c
fff44d
+++ b/src/scepgen-o.c
fff44d
@@ -433,49 +433,155 @@ cm_scepgen_o_cooked(struct cm_store_ca *ca, struct cm_store_entry *entry,
fff44d
 		free(pem);
fff44d
 		_exit(CM_SUB_STATUS_INTERNAL_ERROR);
fff44d
 	}
fff44d
-	cipher = cm_prefs_des;
fff44d
-	for (i = 0;
fff44d
-	     (ca->cm_ca_capabilities != NULL) &&
fff44d
-	     (ca->cm_ca_capabilities[i] != NULL);
fff44d
-	     i++) {
fff44d
-		capability = ca->cm_ca_capabilities[i];
fff44d
-		if (strcmp(capability, "DES3") == 0) {
fff44d
-			cm_log(1, "Server supports DES3, using that.\n");
fff44d
+
fff44d
+	char* scep_cipher = ca->cm_ca_scep_cipher;
fff44d
+	if (scep_cipher != NULL) {
fff44d
+		/* Force the cipher to whatever is in the configuration */
fff44d
+		if (strcmp(scep_cipher, "AES256") == 0) {
fff44d
+			cipher = cm_prefs_aes256;
fff44d
+		}
fff44d
+		else if (strcmp(scep_cipher, "AES192") == 0) {
fff44d
+			cipher = cm_prefs_aes192;
fff44d
+		}
fff44d
+		else if (strcmp(scep_cipher, "AES128") == 0) {
fff44d
+			cipher = cm_prefs_aes128;
fff44d
+		}
fff44d
+		else if (strcmp(scep_cipher, "DES3") == 0) {
fff44d
 			cipher = cm_prefs_des3;
fff44d
-			break;
fff44d
-		}
fff44d
-	}
fff44d
-	if (cipher == cm_prefs_des) {
fff44d
-		cm_log(1, "Server does not support DES3, using DES.\n");
fff44d
-	}
fff44d
-	pref_digest = cm_prefs_preferred_digest();
fff44d
-	digest = cm_prefs_md5;
fff44d
-	for (i = 0;
fff44d
-	     (ca->cm_ca_capabilities != NULL) &&
fff44d
-	     (ca->cm_ca_capabilities[i] != NULL);
fff44d
-	     i++) {
fff44d
-		capability = ca->cm_ca_capabilities[i];
fff44d
-		if ((pref_digest == cm_prefs_sha1) &&
fff44d
-		    (strcmp(capability, "SHA-1") == 0)) {
fff44d
-			cm_log(1, "Server supports SHA-1, using that.\n");
fff44d
-			digest = cm_prefs_sha1;
fff44d
-			break;
fff44d
 		}
fff44d
-		if ((pref_digest == cm_prefs_sha256) &&
fff44d
-		    (strcmp(capability, "SHA-256") == 0)) {
fff44d
-			cm_log(1, "Server supports SHA-256, using that.\n");
fff44d
-			digest = cm_prefs_sha256;
fff44d
-			break;
fff44d
+		else if (strcmp(scep_cipher, "DES") == 0) {
fff44d
+			cipher = cm_prefs_des;
fff44d
 		}
fff44d
-		if ((pref_digest == cm_prefs_sha512) &&
fff44d
-		    (strcmp(capability, "SHA-512") == 0)) {
fff44d
-			cm_log(1, "Server supports SHA-512, using that.\n");
fff44d
-			digest = cm_prefs_sha512;
fff44d
-			break;
fff44d
+		else {
fff44d
+			cm_log(1, "Option 'scep_cipher' must be one of AES256, AES192, AES128, DES3, or DES. Got '%s'\n", scep_cipher);
fff44d
+			_exit(1);
fff44d
+		}
fff44d
+
fff44d
+		cm_log(1, "SCEP cipher authoritatively set to: '%s'\n", scep_cipher);
fff44d
+	}
fff44d
+	else {
fff44d
+		cipher = cm_prefs_nocipher;
fff44d
+		for (i = 0;
fff44d
+		     (ca->cm_ca_capabilities != NULL) &&
fff44d
+		     (ca->cm_ca_capabilities[i] != NULL);
fff44d
+		     i++) {
fff44d
+			capability = ca->cm_ca_capabilities[i];
fff44d
+			if ((strcmp(capability, "AES-256") == 0) ||
fff44d
+				(strcmp(capability, "AES256") == 0)) {
fff44d
+					cm_log(1, "Server supports AES256, using that.\n");
fff44d
+					cipher = cm_prefs_aes256;
fff44d
+					break;
fff44d
+			}
fff44d
+			if ((strcmp(capability, "AES-192") == 0) ||
fff44d
+				(strcmp(capability, "AES192") == 0)) {
fff44d
+					cm_log(1, "Server supports AES192, using that.\n");
fff44d
+					cipher = cm_prefs_aes192;
fff44d
+					break;
fff44d
+			}
fff44d
+			if ((strcmp(capability, "AES-128") == 0) ||
fff44d
+				(strcmp(capability, "AES128") == 0)) {
fff44d
+					cm_log(1, "Server supports AES128, using that.\n");
fff44d
+					cipher = cm_prefs_aes128;
fff44d
+					break;
fff44d
+			}
fff44d
+			if (strcmp(capability, "AES") == 0) {
fff44d
+				cm_log(1, "Server supports AES, using AES256.\n");
fff44d
+				cipher = cm_prefs_aes256;
fff44d
+				break;
fff44d
+			}
fff44d
+			if (strcmp(capability, "DES3") == 0) {
fff44d
+				cm_log(1, "Server supports DES3, using that.\n");
fff44d
+				cipher = cm_prefs_des3;
fff44d
+				break;
fff44d
+			}
fff44d
+			/* This remains for backward compatibility */
fff44d
+			if (strcmp(capability, "DES") == 0) {
fff44d
+				cm_log(1, "Server supports DES, using that.\n");
fff44d
+				cipher = cm_prefs_des;
fff44d
+				break;
fff44d
+			}
fff44d
+		}
fff44d
+		if (cipher == cm_prefs_nocipher) {
fff44d
+			/* Per the latest Draft RFC */
fff44d
+			cm_log(1, "Could not determine supported CA capabilities, using AES256.\n");
fff44d
+			cipher = cm_prefs_aes256;
fff44d
 		}
fff44d
 	}
fff44d
-	if (digest == cm_prefs_md5) {
fff44d
-		cm_log(1, "Server does not support better digests, using MD5.\n");
fff44d
+
fff44d
+	char* scep_digest = ca->cm_ca_scep_digest;
fff44d
+	if (scep_digest != NULL) {
fff44d
+		/* Force the digest to whatever is in the configuration */
fff44d
+		if (strcmp(scep_digest, "SHA512") == 0) {
fff44d
+			digest = cm_prefs_sha512;
fff44d
+		}
fff44d
+		else if (strcmp(scep_digest, "SHA384") == 0) {
fff44d
+			digest = cm_prefs_sha384;
fff44d
+		}
fff44d
+		else if (strcmp(scep_digest, "SHA256") == 0) {
fff44d
+			digest = cm_prefs_sha256;
fff44d
+		}
fff44d
+		else if (strcmp(scep_digest, "SHA1") == 0) {
fff44d
+			digest = cm_prefs_sha1;
fff44d
+		}
fff44d
+		else if (strcmp(scep_digest, "MD5") == 0) {
fff44d
+			digest = cm_prefs_md5;
fff44d
+		}
fff44d
+		else {
fff44d
+			cm_log(1, "Option 'scep_digest' must be one of AES256, AES192, AES128, DES3, or DES. Got '%s'\n", scep_digest);
fff44d
+			_exit(1);
fff44d
+		}
fff44d
+
fff44d
+		cm_log(1, "SCEP digest authoritatively set to: '%s'\n", scep_digest);
fff44d
+	}
fff44d
+	else {
fff44d
+		pref_digest = cm_prefs_preferred_digest();
fff44d
+		digest = cm_prefs_nodigest;
fff44d
+		for (i = 0;
fff44d
+		     (ca->cm_ca_capabilities != NULL) &&
fff44d
+		     (ca->cm_ca_capabilities[i] != NULL);
fff44d
+		     i++) {
fff44d
+			capability = ca->cm_ca_capabilities[i];
fff44d
+			if ((pref_digest == cm_prefs_sha512) &&
fff44d
+			    ((strcmp(capability, "SHA-512") == 0) ||
fff44d
+				(strcmp(capability, "SHA512") == 0))) {
fff44d
+					cm_log(1, "Server supports SHA-512, using that.\n");
fff44d
+					digest = cm_prefs_sha512;
fff44d
+					break;
fff44d
+			}
fff44d
+			if ((pref_digest == cm_prefs_sha384) &&
fff44d
+			    ((strcmp(capability, "SHA-384") == 0) ||
fff44d
+				(strcmp(capability, "SHA384") == 0))) {
fff44d
+					cm_log(1, "Server supports SHA-384, using that.\n");
fff44d
+					digest = cm_prefs_sha384;
fff44d
+					break;
fff44d
+			}
fff44d
+			if ((pref_digest == cm_prefs_sha256) &&
fff44d
+			    ((strcmp(capability, "SHA-256") == 0) ||
fff44d
+				(strcmp(capability, "SHA256") == 0))) {
fff44d
+					cm_log(1, "Server supports SHA-256, using that.\n");
fff44d
+					digest = cm_prefs_sha256;
fff44d
+					break;
fff44d
+			}
fff44d
+			if ((pref_digest == cm_prefs_sha1) &&
fff44d
+			    ((strcmp(capability, "SHA-1") == 0) ||
fff44d
+				(strcmp(capability, "SHA1") == 0))) {
fff44d
+					cm_log(1, "Server supports SHA-1, using that.\n");
fff44d
+					digest = cm_prefs_sha1;
fff44d
+					break;
fff44d
+			}
fff44d
+			/* This remains for backward compatibility */
fff44d
+			if ((pref_digest == cm_prefs_sha1) &&
fff44d
+			    (strcmp(capability, "MD5") == 0)) {
fff44d
+				cm_log(1, "Server supports MD5, using that.\n");
fff44d
+				digest = cm_prefs_md5;
fff44d
+				break;
fff44d
+			}
fff44d
+		}
fff44d
+		if (digest == cm_prefs_nodigest) {
fff44d
+			/* Per the latest Draft RFC */
fff44d
+			cm_log(1, "Could not determine supported CA capabilities, using SHA256.\n");
fff44d
+			digest = cm_prefs_sha256;
fff44d
+		}
fff44d
 	}
fff44d
 	if (old_cert != NULL) {
fff44d
 		if (cm_pkcs7_envelope_ias(ca->cm_ca_encryption_cert, cipher,
fff44d
diff --git a/src/store-files.c b/src/store-files.c
fff44d
index 977e896..c7195c4 100644
fff44d
--- a/src/store-files.c
fff44d
+++ b/src/store-files.c
fff44d
@@ -206,6 +206,8 @@ enum cm_store_file_field {
fff44d
 	cm_store_ca_field_other_cert_nssdbs,
fff44d
 
fff44d
 	cm_store_ca_field_capabilities,
fff44d
+	cm_store_ca_field_scep_cipher,
fff44d
+	cm_store_ca_field_scep_digest,
fff44d
 	cm_store_ca_field_scep_ca_identifier,
fff44d
 	cm_store_ca_field_encryption_cert,
fff44d
 	cm_store_ca_field_encryption_issuer_cert,
fff44d
@@ -385,6 +387,8 @@ static struct cm_store_file_field_list {
fff44d
 	{cm_store_ca_field_other_cert_nssdbs, "ca_other_cert_dbs"},
fff44d
 
fff44d
 	{cm_store_ca_field_capabilities, "ca_capabilities"},
fff44d
+	{cm_store_ca_field_scep_cipher, "scep_cipher"},
fff44d
+	{cm_store_ca_field_scep_digest, "scep_digest"},
fff44d
 	{cm_store_ca_field_scep_ca_identifier, "scep_ca_identifier"},
fff44d
 	{cm_store_ca_field_encryption_cert, "ca_encryption_cert"},
fff44d
 	{cm_store_ca_field_encryption_issuer_cert, "ca_encryption_issuer_cert"},
fff44d
@@ -725,6 +729,8 @@ cm_store_entry_read(void *parent, const char *filename, FILE *fp)
fff44d
 			case cm_store_ca_field_other_root_cert_nssdbs:
fff44d
 			case cm_store_ca_field_other_cert_nssdbs:
fff44d
 			case cm_store_ca_field_capabilities:
fff44d
+			case cm_store_ca_field_scep_cipher:
fff44d
+			case cm_store_ca_field_scep_digest:
fff44d
 			case cm_store_ca_field_scep_ca_identifier:
fff44d
 			case cm_store_ca_field_encryption_cert:
fff44d
 			case cm_store_ca_field_encryption_issuer_cert:
fff44d
@@ -1523,6 +1529,14 @@ cm_store_ca_read(void *parent, const char *filename, FILE *fp)
fff44d
 				ret->cm_ca_capabilities =
fff44d
 					free_if_empty_multi(ret, p);
fff44d
 				break;
fff44d
+			case cm_store_ca_field_scep_cipher:
fff44d
+				ret->cm_ca_scep_cipher =
fff44d
+					free_if_empty(p);
fff44d
+				break;
fff44d
+			case cm_store_ca_field_scep_digest:
fff44d
+				ret->cm_ca_scep_digest =
fff44d
+					free_if_empty(p);
fff44d
+				break;
fff44d
 			case cm_store_ca_field_scep_ca_identifier:
fff44d
 				ret->cm_ca_scep_ca_identifier =
fff44d
 					free_if_empty(p);
fff44d
@@ -2339,6 +2353,10 @@ cm_store_ca_write(FILE *fp, struct cm_store_ca *ca)
fff44d
 				 ca->cm_ca_other_cert_store_nssdbs);
fff44d
 	cm_store_file_write_strs(fp, cm_store_ca_field_capabilities,
fff44d
 				 ca->cm_ca_capabilities);
fff44d
+	cm_store_file_write_str(fp, cm_store_ca_field_scep_cipher,
fff44d
+				ca->cm_ca_scep_cipher);
fff44d
+	cm_store_file_write_str(fp, cm_store_ca_field_scep_digest,
fff44d
+				ca->cm_ca_scep_digest);
fff44d
 	cm_store_file_write_str(fp, cm_store_ca_field_scep_ca_identifier,
fff44d
 				ca->cm_ca_scep_ca_identifier);
fff44d
 	cm_store_file_write_str(fp, cm_store_ca_field_encryption_cert,
fff44d
@@ -2861,6 +2879,10 @@ cm_store_ca_dup(void *parent, struct cm_store_ca *ca)
fff44d
 
fff44d
 	ret->cm_ca_capabilities =
fff44d
 		cm_store_maybe_strdupv(ret, ca->cm_ca_capabilities);
fff44d
+	ret->cm_ca_scep_cipher =
fff44d
+		cm_store_maybe_strdup(ret, ca->cm_ca_scep_cipher);
fff44d
+	ret->cm_ca_scep_digest =
fff44d
+		cm_store_maybe_strdup(ret, ca->cm_ca_scep_digest);
fff44d
 	ret->cm_ca_scep_ca_identifier =
fff44d
 		cm_store_maybe_strdup(ret, ca->cm_ca_scep_ca_identifier);
fff44d
 	ret->cm_ca_encryption_cert =
fff44d
diff --git a/src/store-int.h b/src/store-int.h
fff44d
index 98b37e6..4a40406 100644
fff44d
--- a/src/store-int.h
fff44d
+++ b/src/store-int.h
fff44d
@@ -349,6 +349,10 @@ struct cm_store_ca {
fff44d
 	char **cm_ca_other_cert_store_nssdbs;
fff44d
 	/* CA capabilities.  Currently only ever SCEP capabilities. */
fff44d
 	char **cm_ca_capabilities;
fff44d
+	/* SCEP Cipher to use. Overrides CA Capabilities */
fff44d
+	char *cm_ca_scep_cipher;
fff44d
+	/* SCEP Digest to use. Overrides CA Capabilities */
fff44d
+	char *cm_ca_scep_digest;
fff44d
 	/* An SCEP CA identifier, for use in gathering an RA (and possibly a
fff44d
 	 * CA) certificate. */
fff44d
 	char *cm_ca_scep_ca_identifier;
fff44d
diff --git a/src/tdbus.h b/src/tdbus.h
fff44d
index 7164f11..e63e783 100644
fff44d
--- a/src/tdbus.h
fff44d
+++ b/src/tdbus.h
fff44d
@@ -119,6 +119,8 @@
fff44d
 #define CM_DBUS_PROP_ROOT_CERTS "root-certs"
fff44d
 #define CM_DBUS_PROP_OTHER_ROOT_CERTS "root-other-certs"
fff44d
 #define CM_DBUS_PROP_OTHER_CERTS "other-certs"
fff44d
+#define CM_DBUS_PROP_SCEP_CIPHER "scep-cipher"
fff44d
+#define CM_DBUS_PROP_SCEP_DIGEST "scep-digest"
fff44d
 #define CM_DBUS_PROP_SCEP_CA_IDENTIFIER "scep-ca-identifier"
fff44d
 #define CM_DBUS_PROP_SCEP_CA_CAPABILITIES "scep-ca-capabilities"
fff44d
 #define CM_DBUS_PROP_SCEP_RA_CERT "scep-ra-cert"
fff44d
diff --git a/src/tdbush.c b/src/tdbush.c
fff44d
index 04fe57e..3ce6c40 100644
fff44d
--- a/src/tdbush.c
fff44d
+++ b/src/tdbush.c
fff44d
@@ -2128,6 +2128,27 @@ ca_get_serial(DBusConnection *conn, DBusMessage *msg,
fff44d
 	}
fff44d
 }
fff44d
 
fff44d
+/* org.fedorahosted.certonger.ca.get_config_file_path */
fff44d
+ca_get_config_file_path(DBusConnection *conn, DBusMessage *msg,
fff44d
+		struct cm_client_info *ci, struct cm_context *ctx)
fff44d
+{
fff44d
+	DBusMessage *rep;
fff44d
+	struct cm_store_ca *ca;
fff44d
+	ca = get_ca_for_request_message(msg, ctx);
fff44d
+	if (ca == NULL) {
fff44d
+		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
fff44d
+	}
fff44d
+	rep = dbus_message_new_method_return(msg);
fff44d
+	if (rep != NULL) {
fff44d
+		cm_tdbusm_set_s(rep, ca->cm_store_private);
fff44d
+		dbus_connection_send(conn, rep, NULL);
fff44d
+		dbus_message_unref(rep);
fff44d
+		return DBUS_HANDLER_RESULT_HANDLED;
fff44d
+	} else {
fff44d
+		return send_internal_ca_error(conn, msg);
fff44d
+	}
fff44d
+}
fff44d
+
fff44d
 /* org.fedorahosted.certonger.ca.refresh */
fff44d
 static DBusHandlerResult
fff44d
 ca_refresh(DBusConnection *conn, DBusMessage *msg,
fff44d
@@ -2262,6 +2283,106 @@ ca_prop_set_external_helper(struct cm_context *ctx, void *parent,
fff44d
 }
fff44d
 
fff44d
 static const char *
fff44d
+ca_prop_get_scep_cipher(struct cm_context *ctx, void *parent,
fff44d
+			       void *record, const char *name)
fff44d
+{
fff44d
+	struct cm_store_ca *ca = record;
fff44d
+
fff44d
+	if (strcmp(name, CM_DBUS_PROP_SCEP_CIPHER) == 0) {
fff44d
+		if (ca->cm_ca_type != cm_ca_external) {
fff44d
+			return "";
fff44d
+		}
fff44d
+		if (ca->cm_ca_scep_cipher != NULL) {
fff44d
+			return ca->cm_ca_scep_cipher;
fff44d
+		} else {
fff44d
+			return "";
fff44d
+		}
fff44d
+	}
fff44d
+	return NULL;
fff44d
+}
fff44d
+
fff44d
+static void
fff44d
+ca_prop_set_scep_cipher(struct cm_context *ctx, void *parent,
fff44d
+			       void *record, const char *name,
fff44d
+			       const char *new_value)
fff44d
+{
fff44d
+	const char *propname[2], *path;
fff44d
+	struct cm_store_ca *ca = record;
fff44d
+	enum cm_ca_phase phase;
fff44d
+
fff44d
+	if (strcmp(name, CM_DBUS_PROP_SCEP_CIPHER) == 0) {
fff44d
+		if (ca->cm_ca_type != cm_ca_external) {
fff44d
+			return;
fff44d
+		}
fff44d
+		talloc_free(ca->cm_ca_scep_cipher);
fff44d
+		ca->cm_ca_scep_cipher = new_value ?
fff44d
+					       talloc_strdup(ca, new_value) :
fff44d
+					       NULL;
fff44d
+		for (phase = 0; phase < cm_ca_phase_invalid; phase++) {
fff44d
+			cm_restart_ca(ctx, ca->cm_nickname, phase);
fff44d
+		}
fff44d
+		propname[0] = CM_DBUS_PROP_SCEP_CIPHER;
fff44d
+		propname[1] = NULL;
fff44d
+		path = talloc_asprintf(parent, "%s/%s",
fff44d
+				       CM_DBUS_CA_PATH,
fff44d
+				       ca->cm_busname);
fff44d
+		cm_tdbush_property_emit_changed(ctx, path,
fff44d
+						CM_DBUS_CA_INTERFACE,
fff44d
+						propname);
fff44d
+	}
fff44d
+}
fff44d
+
fff44d
+static const char *
fff44d
+ca_prop_get_scep_digest(struct cm_context *ctx, void *parent,
fff44d
+			       void *record, const char *name)
fff44d
+{
fff44d
+	struct cm_store_ca *ca = record;
fff44d
+
fff44d
+	if (strcmp(name, CM_DBUS_PROP_SCEP_DIGEST) == 0) {
fff44d
+		if (ca->cm_ca_type != cm_ca_external) {
fff44d
+			return "";
fff44d
+		}
fff44d
+		if (ca->cm_ca_scep_digest != NULL) {
fff44d
+			return ca->cm_ca_scep_digest;
fff44d
+		} else {
fff44d
+			return "";
fff44d
+		}
fff44d
+	}
fff44d
+	return NULL;
fff44d
+}
fff44d
+
fff44d
+static void
fff44d
+ca_prop_set_scep_digest(struct cm_context *ctx, void *parent,
fff44d
+			       void *record, const char *name,
fff44d
+			       const char *new_value)
fff44d
+{
fff44d
+	const char *propname[2], *path;
fff44d
+	struct cm_store_ca *ca = record;
fff44d
+	enum cm_ca_phase phase;
fff44d
+
fff44d
+	if (strcmp(name, CM_DBUS_PROP_SCEP_DIGEST) == 0) {
fff44d
+		if (ca->cm_ca_type != cm_ca_external) {
fff44d
+			return;
fff44d
+		}
fff44d
+		talloc_free(ca->cm_ca_scep_digest);
fff44d
+		ca->cm_ca_scep_digest = new_value ?
fff44d
+					       talloc_strdup(ca, new_value) :
fff44d
+					       NULL;
fff44d
+		for (phase = 0; phase < cm_ca_phase_invalid; phase++) {
fff44d
+			cm_restart_ca(ctx, ca->cm_nickname, phase);
fff44d
+		}
fff44d
+		propname[0] = CM_DBUS_PROP_SCEP_DIGEST;
fff44d
+		propname[1] = NULL;
fff44d
+		path = talloc_asprintf(parent, "%s/%s",
fff44d
+				       CM_DBUS_CA_PATH,
fff44d
+				       ca->cm_busname);
fff44d
+		cm_tdbush_property_emit_changed(ctx, path,
fff44d
+						CM_DBUS_CA_INTERFACE,
fff44d
+						propname);
fff44d
+	}
fff44d
+}
fff44d
+
fff44d
+static const char *
fff44d
 ca_prop_get_scep_ca_identifier(struct cm_context *ctx, void *parent,
fff44d
 			       void *record, const char *name)
fff44d
 {
fff44d
@@ -7232,6 +7353,14 @@ cm_tdbush_iface_ca(void)
fff44d
 	if (ret == NULL) {
fff44d
 		ret = make_interface(CM_DBUS_CA_INTERFACE,
fff44d
 				     make_interface_item(cm_tdbush_interface_method,
fff44d
+							 make_method("get_config_file_path",
fff44d
+								     ca_get_config_file_path,
fff44d
+								     make_method_arg("path",
fff44d
+										     DBUS_TYPE_STRING_AS_STRING,
fff44d
+										     cm_tdbush_method_arg_out,
fff44d
+										     NULL),
fff44d
+								     NULL),
fff44d
+				     make_interface_item(cm_tdbush_interface_method,
fff44d
 							 make_method("get_nickname",
fff44d
 								     ca_get_nickname,
fff44d
 								     make_method_arg("nickname",
fff44d
@@ -7483,6 +7612,24 @@ cm_tdbush_iface_ca(void)
fff44d
 								       NULL, NULL, NULL, NULL, NULL,
fff44d
 								       NULL),
fff44d
 				     make_interface_item(cm_tdbush_interface_property,
fff44d
+							 make_property(CM_DBUS_PROP_SCEP_CIPHER,
fff44d
+								       cm_tdbush_property_string,
fff44d
+								       cm_tdbush_property_readwrite,
fff44d
+								       cm_tdbush_property_special,
fff44d
+								       0,
fff44d
+								       ca_prop_get_scep_cipher, NULL, NULL, NULL, NULL,
fff44d
+								       ca_prop_set_scep_cipher, NULL, NULL, NULL, NULL,
fff44d
+								       NULL),
fff44d
+				     make_interface_item(cm_tdbush_interface_property,
fff44d
+							 make_property(CM_DBUS_PROP_SCEP_DIGEST,
fff44d
+								       cm_tdbush_property_string,
fff44d
+								       cm_tdbush_property_readwrite,
fff44d
+								       cm_tdbush_property_special,
fff44d
+								       0,
fff44d
+								       ca_prop_get_scep_digest, NULL, NULL, NULL, NULL,
fff44d
+								       ca_prop_set_scep_digest, NULL, NULL, NULL, NULL,
fff44d
+								       NULL),
fff44d
+				     make_interface_item(cm_tdbush_interface_property,
fff44d
 							 make_property(CM_DBUS_PROP_SCEP_CA_IDENTIFIER,
fff44d
 								       cm_tdbush_property_string,
fff44d
 								       cm_tdbush_property_readwrite,
fff44d
@@ -7527,7 +7674,7 @@ cm_tdbush_iface_ca(void)
fff44d
 								       NULL, NULL, NULL, NULL, NULL,
fff44d
 								       NULL, NULL, NULL, NULL, NULL,
fff44d
 								       NULL),
fff44d
-				     NULL))))))))))))))))))))))))))))))))))));
fff44d
+				     NULL)))))))))))))))))))))))))))))))))))))));
fff44d
 	}
fff44d
 	return ret;
fff44d
 }
fff44d
-- 
fff44d
1.8.3.1
fff44d