From 4751f2538ae39a5555ae4897912ac776dee1249c Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Nov 22 2009 23:22:52 +0000 Subject: - ensure there's always a certmaster CA entry --- diff --git a/certmonger.spec b/certmonger.spec index 5cf40b7..7a3bb64 100644 --- a/certmonger.spec +++ b/certmonger.spec @@ -81,6 +81,11 @@ exit 0 %{_localstatedir}/lib/certmonger %changelog +* Mon Nov 23 2009 Nalin Dahyabhai 0.11-1 +- update to 0.11 + - add XML-RPC submission for certmaster and IPA + - prune entries with duplicate names from the data store + * Fri Nov 13 2009 Nalin Dahyabhai 0.10-1 - update to 0.10 - add some compiler warnings and then fix them diff --git a/src/Makefile.am b/src/Makefile.am index 4f92084..ffb7d9d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,7 +82,12 @@ if WITH_IPA bin_PROGRAMS += ipa-getcert ipa_getcert_SOURCES = ipa-getcert.c ipa_getcert_LDADD = $(getcert_LDADD) -pkglibexec_SCRIPTS = ipa-submit-helper +#pkglibexec_SCRIPTS = ipa-submit-helper +endif +if WITH_IPA +bin_PROGRAMS += certmaster-getcert +certmaster_getcert_SOURCES = certmaster-getcert.c +certmaster_getcert_LDADD = $(getcert_LDADD) endif bin_PROGRAMS += selfsign-getcert selfsign_getcert_SOURCES = selfsign-getcert.c diff --git a/src/certmaster-getcert.c b/src/certmaster-getcert.c new file mode 100644 index 0000000..e485944 --- /dev/null +++ b/src/certmaster-getcert.c @@ -0,0 +1,3 @@ +#include "config.h" +#define FORCE_CA CM_CERTMASTER_CA_NAME +#include "getcert.c" diff --git a/src/store-files.c b/src/store-files.c index d364d89..67fb1d4 100644 --- a/src/store-files.c +++ b/src/store-files.c @@ -1522,6 +1522,23 @@ cm_store_get_all_cas(void *parent) j++; } #endif +#ifdef WITH_CERTMASTER + /* Make sure we get at least one certmaster entry. */ + for (k = 0; k < j; k++) { + if ((ret[k]->cm_ca_type == cm_ca_external) && + (strcmp(ret[k]->cm_id, CM_CERTMASTER_CA_NAME) == 0)) { + break; + } + } + if (k == j) { + ret[j] = cm_store_ca_new(ret); + ret[j]->cm_id = talloc_strdup(ret[j], CM_CERTMASTER_CA_NAME); + ret[j]->cm_ca_type = cm_ca_external; + ret[j]->cm_ca_external_helper = talloc_strdup(ret[j], + CM_CERTMASTER_HELPER_PATH); + j++; + } +#endif ret[j] = NULL; } if (globs.gl_pathc > 0) {