Imported Upstream version 4.6.2
This commit is contained in:
11
install/certmonger/Makefile.am
Normal file
11
install/certmonger/Makefile.am
Normal file
@@ -0,0 +1,11 @@
|
||||
NULL =
|
||||
|
||||
appdir = $(libexecdir)/certmonger/
|
||||
app_SCRIPTS = \
|
||||
dogtag-ipa-ca-renew-agent-submit \
|
||||
ipa-server-guard \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(app_SCRIPTS) \
|
||||
$(NULL)
|
||||
627
install/certmonger/Makefile.in
Normal file
627
install/certmonger/Makefile.in
Normal file
@@ -0,0 +1,627 @@
|
||||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = install/certmonger
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/VERSION.m4 \
|
||||
$(top_srcdir)/server.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(appdir)"
|
||||
SCRIPTS = $(app_SCRIPTS)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
API_VERSION = @API_VERSION@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
|
||||
CMOCKA_LIBS = @CMOCKA_LIBS@
|
||||
CONFIG_STATUS = @CONFIG_STATUS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CRYPTO_CFLAGS = @CRYPTO_CFLAGS@
|
||||
CRYPTO_LIBS = @CRYPTO_LIBS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATA_VERSION = @DATA_VERSION@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DIRSRV_CFLAGS = @DIRSRV_CFLAGS@
|
||||
DIRSRV_LIBS = @DIRSRV_LIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GETTEXT_DOMAIN = @GETTEXT_DOMAIN@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GIT_BRANCH = @GIT_BRANCH@
|
||||
GIT_VERSION = @GIT_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GREP = @GREP@
|
||||
INI_CFLAGS = @INI_CFLAGS@
|
||||
INI_LIBS = @INI_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
IPAPLATFORM = @IPAPLATFORM@
|
||||
IPA_DATA_DIR = @IPA_DATA_DIR@
|
||||
IPA_SYSCONF_DIR = @IPA_SYSCONF_DIR@
|
||||
JSLINT = @JSLINT@
|
||||
KRAD_LIBS = @KRAD_LIBS@
|
||||
KRB5KDC_SERVICE = @KRB5KDC_SERVICE@
|
||||
KRB5_CFLAGS = @KRB5_CFLAGS@
|
||||
KRB5_LIBS = @KRB5_LIBS@
|
||||
LD = @LD@
|
||||
LDAP_CFLAGS = @LDAP_CFLAGS@
|
||||
LDAP_LIBS = @LDAP_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBINTL_LIBS = @LIBINTL_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPDB_NAME = @LIBPDB_NAME@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBVERTO_CFLAGS = @LIBVERTO_CFLAGS@
|
||||
LIBVERTO_LIBS = @LIBVERTO_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MK_ASSIGN = @MK_ASSIGN@
|
||||
MK_ELSE = @MK_ELSE@
|
||||
MK_ENDIF = @MK_ENDIF@
|
||||
MK_IFEQ = @MK_IFEQ@
|
||||
MSGATTRIB = @MSGATTRIB@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NAMED_GROUP = @NAMED_GROUP@
|
||||
NDRNBT_CFLAGS = @NDRNBT_CFLAGS@
|
||||
NDRNBT_LIBS = @NDRNBT_LIBS@
|
||||
NDRPAC_CFLAGS = @NDRPAC_CFLAGS@
|
||||
NDRPAC_LIBS = @NDRPAC_LIBS@
|
||||
NDR_CFLAGS = @NDR_CFLAGS@
|
||||
NDR_LIBS = @NDR_LIBS@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NSPR_CFLAGS = @NSPR_CFLAGS@
|
||||
NSPR_LIBS = @NSPR_LIBS@
|
||||
NSS_CFLAGS = @NSS_CFLAGS@
|
||||
NSS_LIBS = @NSS_LIBS@
|
||||
NUM_VERSION = @NUM_VERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
ODS_USER = @ODS_USER@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
POPT_CFLAGS = @POPT_CFLAGS@
|
||||
POPT_LIBS = @POPT_LIBS@
|
||||
POSUB = @POSUB@
|
||||
PYLINT = @PYLINT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_INSTALL_EXTRA_OPTIONS = @PYTHON_INSTALL_EXTRA_OPTIONS@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SAMBA40EXTRA_LIBPATH = @SAMBA40EXTRA_LIBPATH@
|
||||
SAMBAUTIL_CFLAGS = @SAMBAUTIL_CFLAGS@
|
||||
SAMBAUTIL_LIBS = @SAMBAUTIL_LIBS@
|
||||
SASL_CFLAGS = @SASL_CFLAGS@
|
||||
SASL_LIBS = @SASL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SSSCERTMAP_CFLAGS = @SSSCERTMAP_CFLAGS@
|
||||
SSSCERTMAP_LIBS = @SSSCERTMAP_LIBS@
|
||||
SSSIDMAP_CFLAGS = @SSSIDMAP_CFLAGS@
|
||||
SSSIDMAP_LIBS = @SSSIDMAP_LIBS@
|
||||
SSSNSSIDMAP_CFLAGS = @SSSNSSIDMAP_CFLAGS@
|
||||
SSSNSSIDMAP_LIBS = @SSSNSSIDMAP_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TALLOC_CFLAGS = @TALLOC_CFLAGS@
|
||||
TALLOC_LIBS = @TALLOC_LIBS@
|
||||
TEVENT_CFLAGS = @TEVENT_CFLAGS@
|
||||
TEVENT_LIBS = @TEVENT_LIBS@
|
||||
UNISTRING_LIBS = @UNISTRING_LIBS@
|
||||
UNLINK = @UNLINK@
|
||||
USE_NLS = @USE_NLS@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VENDOR_SUFFIX = @VENDOR_SUFFIX@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
XMLRPC_CFLAGS = @XMLRPC_CFLAGS@
|
||||
XMLRPC_LIBS = @XMLRPC_LIBS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
i18ntests = @i18ntests@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
krb5rundir = @krb5rundir@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sysconfenvdir = @sysconfenvdir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
NULL =
|
||||
appdir = $(libexecdir)/certmonger/
|
||||
app_SCRIPTS = \
|
||||
dogtag-ipa-ca-renew-agent-submit \
|
||||
ipa-server-guard \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(app_SCRIPTS) \
|
||||
$(NULL)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign install/certmonger/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign install/certmonger/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-appSCRIPTS: $(app_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(app_SCRIPTS)'; test -n "$(appdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(appdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(appdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n' \
|
||||
-e 'h;s|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
|
||||
if (++n[d] == $(am__install_max)) { \
|
||||
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
|
||||
else { print "f", d "/" $$4, $$1 } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(appdir)$$dir'"; \
|
||||
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(appdir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-appSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(app_SCRIPTS)'; test -n "$(appdir)" || exit 0; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(appdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(SCRIPTS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(appdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-appSCRIPTS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-appSCRIPTS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-appSCRIPTS install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-appSCRIPTS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
545
install/certmonger/dogtag-ipa-ca-renew-agent-submit
Executable file
545
install/certmonger/dogtag-ipa-ca-renew-agent-submit
Executable file
@@ -0,0 +1,545 @@
|
||||
#!/usr/bin/python2 -E
|
||||
#
|
||||
# Authors:
|
||||
# Jan Cholasta <jcholast@redhat.com>
|
||||
#
|
||||
# Copyright (C) 2013 Red Hat
|
||||
# see file 'COPYING' for use and warranty information
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
# Prevent garbage from readline on standard output
|
||||
# (see https://fedorahosted.org/freeipa/ticket/4064)
|
||||
if not os.isatty(1):
|
||||
os.environ['TERM'] = 'dumb'
|
||||
import sys
|
||||
import syslog
|
||||
import traceback
|
||||
import tempfile
|
||||
import shutil
|
||||
import contextlib
|
||||
import json
|
||||
|
||||
from cryptography import x509 as crypto_x509
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
|
||||
import six
|
||||
|
||||
from ipalib.install.kinit import kinit_keytab
|
||||
from ipapython import ipautil
|
||||
from ipapython.dn import DN
|
||||
from ipalib import api, errors, x509
|
||||
from ipaplatform.paths import paths
|
||||
from ipaserver.plugins.ldap2 import ldap2
|
||||
from ipaserver.install import ca, cainstance, dsinstance, certs
|
||||
|
||||
# This is a certmonger CA helper script for IPA CA subsystem cert renewal. See
|
||||
# https://git.fedorahosted.org/cgit/certmonger.git/tree/doc/submit.txt for more
|
||||
# info on certmonger CA helper scripts.
|
||||
|
||||
# Return codes. Names of the constants are taken from
|
||||
# https://git.fedorahosted.org/cgit/certmonger.git/tree/src/submit-e.h
|
||||
ISSUED = 0
|
||||
WAIT = 1
|
||||
REJECTED = 2
|
||||
UNREACHABLE = 3
|
||||
UNCONFIGURED = 4
|
||||
WAIT_WITH_DELAY = 5
|
||||
OPERATION_NOT_SUPPORTED_BY_HELPER = 6
|
||||
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
|
||||
IPA_CA_NICKNAME = 'caSigningCert cert-pki-ca'
|
||||
|
||||
|
||||
def get_nickname():
|
||||
# we need to get the subject from a CSR in case we are requesting
|
||||
# an OpenSSL certificate for which we have to reverse the order of its DN
|
||||
# components thus changing the CERTMONGER_REQ_SUBJECT
|
||||
# https://pagure.io/certmonger/issue/62
|
||||
csr = os.environ.get('CERTMONGER_CSR').encode('ascii')
|
||||
csr_obj = crypto_x509.load_pem_x509_csr(csr, default_backend())
|
||||
subject = csr_obj.subject
|
||||
if not subject:
|
||||
return None
|
||||
|
||||
subject_base = dsinstance.DsInstance().find_subject_base()
|
||||
if not subject_base:
|
||||
return None
|
||||
|
||||
ca_subject_dn = ca.lookup_ca_subject(api, subject_base)
|
||||
|
||||
nickname_by_subject_dn = {
|
||||
DN(ca_subject_dn): 'caSigningCert cert-pki-ca',
|
||||
DN('CN=CA Audit', subject_base): 'auditSigningCert cert-pki-ca',
|
||||
DN('CN=OCSP Subsystem', subject_base): 'ocspSigningCert cert-pki-ca',
|
||||
DN('CN=CA Subsystem', subject_base): 'subsystemCert cert-pki-ca',
|
||||
DN('CN=KRA Audit', subject_base): 'auditSigningCert cert-pki-kra',
|
||||
DN('CN=KRA Transport Certificate', subject_base):
|
||||
'transportCert cert-pki-kra',
|
||||
DN('CN=KRA Storage Certificate', subject_base):
|
||||
'storageCert cert-pki-kra',
|
||||
DN('CN=IPA RA', subject_base): 'ipaCert',
|
||||
}
|
||||
|
||||
return nickname_by_subject_dn.get(DN(subject))
|
||||
|
||||
|
||||
def is_replicated():
|
||||
return bool(get_nickname())
|
||||
|
||||
|
||||
def is_renewal_master():
|
||||
ca = cainstance.CAInstance(host_name=api.env.host)
|
||||
return ca.is_renewal_master()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def ldap_connect():
|
||||
conn = None
|
||||
try:
|
||||
conn = ldap2(api)
|
||||
conn.connect(ccache=os.environ['KRB5CCNAME'])
|
||||
yield conn
|
||||
finally:
|
||||
if conn is not None and conn.isconnected():
|
||||
conn.disconnect()
|
||||
|
||||
def call_handler(_handler, *args, **kwargs):
|
||||
"""
|
||||
Request handler call wrapper
|
||||
|
||||
Before calling the handler, get the original profile name and cookie from
|
||||
the provided cookie, if there is one. If the profile name does not match
|
||||
the requested profile name, drop the cookie and restart the request.
|
||||
|
||||
After calling the handler, put the requested profile name and cookie
|
||||
returned by the handler in a new cookie and return it.
|
||||
"""
|
||||
operation = os.environ['CERTMONGER_OPERATION']
|
||||
if operation == 'POLL':
|
||||
cookie = os.environ.pop('CERTMONGER_CA_COOKIE', None)
|
||||
if cookie is not None:
|
||||
try:
|
||||
context = json.loads(cookie)
|
||||
if not isinstance(context, dict):
|
||||
raise TypeError
|
||||
except (TypeError, ValueError):
|
||||
return (UNCONFIGURED, "Invalid cookie: %r" % cookie)
|
||||
else:
|
||||
return (UNCONFIGURED, "Cookie not provided")
|
||||
|
||||
if 'profile' in context:
|
||||
profile = context.pop('profile')
|
||||
try:
|
||||
if profile is not None:
|
||||
if not isinstance(profile, unicode):
|
||||
raise TypeError
|
||||
profile = (profile.encode('raw_unicode_escape')
|
||||
.decode('ascii'))
|
||||
except (TypeError, UnicodeEncodeError):
|
||||
return (UNCONFIGURED,
|
||||
"Invalid 'profile' in cookie: %r" % profile)
|
||||
else:
|
||||
return (UNCONFIGURED, "No 'profile' in cookie")
|
||||
|
||||
# If profile has changed between SUBMIT and POLL, restart request
|
||||
if os.environ.get('CERTMONGER_CA_PROFILE') != profile:
|
||||
os.environ['CERTMONGER_OPERATION'] = 'SUBMIT'
|
||||
context = {}
|
||||
|
||||
if 'cookie' in context:
|
||||
cookie = context.pop('cookie')
|
||||
try:
|
||||
if not isinstance(cookie, unicode):
|
||||
raise TypeError
|
||||
cookie = cookie.encode('raw_unicode_escape').decode('ascii')
|
||||
except (TypeError, UnicodeEncodeError):
|
||||
return (UNCONFIGURED,
|
||||
"Invalid 'cookie' in cookie: %r" % cookie)
|
||||
os.environ['CERTMONGER_CA_COOKIE'] = cookie
|
||||
else:
|
||||
context = {}
|
||||
|
||||
result = _handler(*args, **kwargs)
|
||||
|
||||
if result[0] in (WAIT, WAIT_WITH_DELAY):
|
||||
context['cookie'] = (result[-1].encode('ascii')
|
||||
.decode('raw_unicode_escape'))
|
||||
|
||||
profile = os.environ.get('CERTMONGER_CA_PROFILE')
|
||||
if profile is not None:
|
||||
profile = profile.encode('ascii').decode('raw_unicode_escape')
|
||||
context['profile'] = profile
|
||||
|
||||
cookie = json.dumps(context)
|
||||
os.environ['CERTMONGER_CA_COOKIE'] = cookie
|
||||
if result[0] in (WAIT, WAIT_WITH_DELAY):
|
||||
result = result[:-1] + (cookie,)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def request_cert(reuse_existing, **kwargs):
|
||||
"""
|
||||
Request certificate from IPA CA.
|
||||
"""
|
||||
if reuse_existing:
|
||||
cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if cert:
|
||||
return (ISSUED, cert)
|
||||
else:
|
||||
return (REJECTED, "New certificate requests not supported")
|
||||
|
||||
syslog.syslog(syslog.LOG_NOTICE,
|
||||
"Forwarding request to dogtag-ipa-renew-agent")
|
||||
|
||||
args = ([paths.DOGTAG_IPA_RENEW_AGENT_SUBMIT,
|
||||
"--cafile", paths.IPA_CA_CRT,
|
||||
"--certfile", paths.RA_AGENT_PEM,
|
||||
"--keyfile", paths.RA_AGENT_KEY] +
|
||||
sys.argv[1:] +
|
||||
['--submit-option', "requestor_name=IPA"])
|
||||
if os.environ.get('CERTMONGER_CA_PROFILE') == 'caCACert':
|
||||
args += ['-N', '-O', 'bypassCAnotafter=true']
|
||||
result = ipautil.run(args, raiseonerr=False, env=os.environ,
|
||||
capture_output=True)
|
||||
if six.PY2:
|
||||
sys.stderr.write(result.raw_error_output)
|
||||
else:
|
||||
# Write bytes directly
|
||||
sys.stderr.buffer.write(result.raw_error_output) #pylint: disable=no-member
|
||||
sys.stderr.flush()
|
||||
|
||||
syslog.syslog(syslog.LOG_NOTICE,
|
||||
"dogtag-ipa-renew-agent returned %d" % result.returncode)
|
||||
|
||||
stdout = result.output
|
||||
if stdout.endswith('\n'):
|
||||
stdout = stdout[:-1]
|
||||
|
||||
rc = result.returncode
|
||||
if rc == WAIT_WITH_DELAY:
|
||||
delay, _sep, cookie = stdout.partition('\n')
|
||||
return (rc, delay, cookie)
|
||||
else:
|
||||
return (rc, stdout)
|
||||
|
||||
|
||||
def store_cert(**kwargs):
|
||||
"""
|
||||
Store certificate in LDAP.
|
||||
"""
|
||||
operation = os.environ.get('CERTMONGER_OPERATION')
|
||||
if operation == 'SUBMIT':
|
||||
attempts = 0
|
||||
elif operation == 'POLL':
|
||||
cookie = os.environ.get('CERTMONGER_CA_COOKIE')
|
||||
if not cookie:
|
||||
return (UNCONFIGURED, "Cookie not provided")
|
||||
|
||||
try:
|
||||
attempts = int(cookie)
|
||||
except ValueError:
|
||||
return (UNCONFIGURED, "Invalid cookie: %r" % cookie)
|
||||
else:
|
||||
return (OPERATION_NOT_SUPPORTED_BY_HELPER,)
|
||||
|
||||
nickname = get_nickname()
|
||||
if not nickname:
|
||||
return (REJECTED, "Nickname could not be determined")
|
||||
|
||||
cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if not cert:
|
||||
return (REJECTED, "New certificate requests not supported")
|
||||
cert = x509.load_pem_x509_certificate(cert.encode('ascii'))
|
||||
|
||||
dn = DN(('cn', nickname), ('cn', 'ca_renewal'),
|
||||
('cn', 'ipa'), ('cn', 'etc'), api.env.basedn)
|
||||
try:
|
||||
with ldap_connect() as conn:
|
||||
try:
|
||||
entry = conn.get_entry(dn, ['usercertificate'])
|
||||
entry['usercertificate'] = [cert]
|
||||
conn.update_entry(entry)
|
||||
except errors.NotFound:
|
||||
entry = conn.make_entry(
|
||||
dn,
|
||||
objectclass=['top', 'pkiuser', 'nscontainer'],
|
||||
cn=[nickname],
|
||||
usercertificate=[cert])
|
||||
conn.add_entry(entry)
|
||||
except errors.EmptyModlist:
|
||||
pass
|
||||
except Exception as e:
|
||||
attempts += 1
|
||||
if attempts < 10:
|
||||
syslog.syslog(
|
||||
syslog.LOG_ERR,
|
||||
"Updating renewal certificate failed: %s. Sleeping 30s" % e)
|
||||
return (WAIT_WITH_DELAY, 30, str(attempts))
|
||||
else:
|
||||
syslog.syslog(
|
||||
syslog.LOG_ERR,
|
||||
"Giving up. To retry storing the certificate, resubmit the "
|
||||
"request with CA \"dogtag-ipa-ca-renew-agent-reuse\"")
|
||||
|
||||
return (ISSUED, cert.public_bytes(x509.Encoding.PEM).decode('ascii'))
|
||||
|
||||
|
||||
def request_and_store_cert(**kwargs):
|
||||
"""
|
||||
Request certificate from IPA CA and store it in LDAP.
|
||||
"""
|
||||
operation = os.environ.get('CERTMONGER_OPERATION')
|
||||
if operation == 'SUBMIT':
|
||||
state = 'request'
|
||||
cookie = None
|
||||
elif operation == 'POLL':
|
||||
cookie = os.environ.get('CERTMONGER_CA_COOKIE')
|
||||
if not cookie:
|
||||
return (UNCONFIGURED, "Cookie not provided")
|
||||
|
||||
state, _sep, cookie = cookie.partition(':')
|
||||
if state not in ('request', 'store'):
|
||||
return (UNCONFIGURED,
|
||||
"Invalid cookie: %r" % os.environ['CERTMONGER_CA_COOKIE'])
|
||||
else:
|
||||
return (OPERATION_NOT_SUPPORTED_BY_HELPER,)
|
||||
|
||||
if state == 'request':
|
||||
if cookie is None:
|
||||
os.environ['CERTMONGER_OPERATION'] = 'SUBMIT'
|
||||
else:
|
||||
os.environ['CERTMONGER_CA_COOKIE'] = cookie
|
||||
|
||||
result = call_handler(request_cert, **kwargs)
|
||||
if result[0] == WAIT:
|
||||
return (result[0], 'request:%s' % result[1])
|
||||
elif result[0] == WAIT_WITH_DELAY:
|
||||
return (result[0], result[1], 'request:%s' % result[2])
|
||||
elif result[0] != ISSUED:
|
||||
return result
|
||||
else:
|
||||
cert = result[1]
|
||||
cookie = None
|
||||
else:
|
||||
cert, _sep, cookie = cookie.partition(':')
|
||||
|
||||
if cookie is None:
|
||||
os.environ['CERTMONGER_OPERATION'] = 'SUBMIT'
|
||||
else:
|
||||
os.environ['CERTMONGER_CA_COOKIE'] = cookie
|
||||
os.environ['CERTMONGER_CERTIFICATE'] = cert
|
||||
|
||||
result = call_handler(store_cert, **kwargs)
|
||||
if result[0] == WAIT:
|
||||
return (result[0], 'store:%s:%s' % (cert, result[1]))
|
||||
elif result[0] == WAIT_WITH_DELAY:
|
||||
return (result[0], result[1], 'store:%s:%s' % (cert, result[2]))
|
||||
else:
|
||||
return result
|
||||
|
||||
|
||||
def retrieve_or_reuse_cert(**kwargs):
|
||||
"""
|
||||
Retrieve certificate from LDAP. If the certificate is not available, reuse
|
||||
the old certificate.
|
||||
"""
|
||||
nickname = get_nickname()
|
||||
if not nickname:
|
||||
return (REJECTED, "Nickname could not be determined")
|
||||
|
||||
cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if not cert:
|
||||
return (REJECTED, "New certificate requests not supported")
|
||||
cert = x509.load_pem_x509_certificate(cert.encode('ascii'))
|
||||
|
||||
with ldap_connect() as conn:
|
||||
try:
|
||||
entry = conn.get_entry(
|
||||
DN(('cn', nickname), ('cn', 'ca_renewal'),
|
||||
('cn', 'ipa'), ('cn', 'etc'), api.env.basedn),
|
||||
['usercertificate'])
|
||||
except errors.NotFound:
|
||||
pass
|
||||
else:
|
||||
cert = entry.single_value['usercertificate']
|
||||
|
||||
return (ISSUED, cert.public_bytes(x509.Encoding.PEM).decode('ascii'))
|
||||
|
||||
|
||||
def retrieve_cert_continuous(reuse_existing, **kwargs):
|
||||
"""
|
||||
Retrieve new certificate from LDAP. Repeat every eight hours until the
|
||||
certificate is available.
|
||||
"""
|
||||
old_cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if old_cert:
|
||||
old_cert = x509.load_pem_x509_certificate(old_cert.encode('ascii'))
|
||||
|
||||
result = call_handler(retrieve_or_reuse_cert,
|
||||
reuse_existing=reuse_existing,
|
||||
**kwargs)
|
||||
if result[0] != ISSUED or reuse_existing:
|
||||
return result
|
||||
|
||||
new_cert = x509.load_pem_x509_certificate(result[1].encode('ascii'))
|
||||
if new_cert == old_cert:
|
||||
syslog.syslog(syslog.LOG_INFO, "Updated certificate not available")
|
||||
# No cert available yet, tell certmonger to wait another 8 hours
|
||||
return (WAIT_WITH_DELAY, 8 * 60 * 60, '')
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def retrieve_cert(**kwargs):
|
||||
"""
|
||||
Retrieve new certificate from LDAP.
|
||||
"""
|
||||
result = call_handler(retrieve_cert_continuous, **kwargs)
|
||||
if result[0] == WAIT_WITH_DELAY:
|
||||
return (REJECTED, "Updated certificate not available")
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def renew_ca_cert(reuse_existing, **kwargs):
|
||||
"""
|
||||
This is used for automatic CA certificate renewal.
|
||||
"""
|
||||
csr = os.environ.get('CERTMONGER_CSR').encode('ascii')
|
||||
if not csr:
|
||||
return (UNCONFIGURED, "Certificate request not provided")
|
||||
|
||||
cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if not cert:
|
||||
return (REJECTED, "New certificate requests not supported")
|
||||
cert = x509.load_pem_x509_certificate(cert.encode('ascii'))
|
||||
is_self_signed = cert.is_self_signed()
|
||||
|
||||
operation = os.environ.get('CERTMONGER_OPERATION')
|
||||
if operation == 'SUBMIT':
|
||||
state = 'retrieve'
|
||||
|
||||
if not reuse_existing and is_renewal_master():
|
||||
state = 'request'
|
||||
|
||||
csr_file = paths.IPA_CA_CSR
|
||||
try:
|
||||
with open(csr_file, 'wb') as f:
|
||||
f.write(csr)
|
||||
except Exception as e:
|
||||
return (UNREACHABLE, "Failed to write %s: %s" % (csr_file, e))
|
||||
elif operation == 'POLL':
|
||||
cookie = os.environ.get('CERTMONGER_CA_COOKIE')
|
||||
if not cookie:
|
||||
return (UNCONFIGURED, "Cookie not provided")
|
||||
|
||||
state, _sep, cookie = cookie.partition(':')
|
||||
if state not in ('retrieve', 'request'):
|
||||
return (UNCONFIGURED,
|
||||
"Invalid cookie: %r" % os.environ['CERTMONGER_CA_COOKIE'])
|
||||
|
||||
os.environ['CERTMONGER_CA_COOKIE'] = cookie
|
||||
else:
|
||||
return (OPERATION_NOT_SUPPORTED_BY_HELPER,)
|
||||
|
||||
if state == 'retrieve':
|
||||
result = call_handler(retrieve_cert,
|
||||
reuse_existing=reuse_existing,
|
||||
**kwargs)
|
||||
if result[0] == REJECTED and not is_self_signed and not reuse_existing:
|
||||
syslog.syslog(syslog.LOG_ALERT,
|
||||
"Certificate with subject '%s' is about to expire, "
|
||||
"use ipa-cacert-manage to renew it"
|
||||
% (os.environ.get("CERTMONGER_REQ_SUBJECT"),))
|
||||
elif state == 'request':
|
||||
profile = os.environ.get('CERTMONGER_CA_PROFILE')
|
||||
os.environ['CERTMONGER_CA_PROFILE'] = 'caCACert'
|
||||
result = call_handler(request_and_store_cert,
|
||||
reuse_existing=reuse_existing,
|
||||
**kwargs)
|
||||
if profile is not None:
|
||||
os.environ['CERTMONGER_CA_PROFILE'] = profile
|
||||
else:
|
||||
del os.environ['CERTMONGER_CA_PROFILE']
|
||||
|
||||
if result[0] == WAIT:
|
||||
return (result[0], '%s:%s' % (state, result[1]))
|
||||
elif result[0] == WAIT_WITH_DELAY:
|
||||
return (result[0], result[1], '%s:%s' % (state, result[2]))
|
||||
else:
|
||||
return result
|
||||
|
||||
def main():
|
||||
kwargs = {
|
||||
'reuse_existing': False,
|
||||
}
|
||||
try:
|
||||
sys.argv.remove('--reuse-existing')
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
kwargs['reuse_existing'] = True
|
||||
|
||||
api.bootstrap(in_server=True, context='renew', confdir=paths.ETC_IPA)
|
||||
api.finalize()
|
||||
|
||||
operation = os.environ.get('CERTMONGER_OPERATION')
|
||||
if operation not in ('SUBMIT', 'POLL'):
|
||||
return OPERATION_NOT_SUPPORTED_BY_HELPER
|
||||
|
||||
tmpdir = tempfile.mkdtemp(prefix="tmp-")
|
||||
certs.renewal_lock.acquire()
|
||||
try:
|
||||
principal = str('host/%s@%s' % (api.env.host, api.env.realm))
|
||||
ccache_filename = os.path.join(tmpdir, 'ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache_filename
|
||||
kinit_keytab(principal, paths.KRB5_KEYTAB, ccache_filename)
|
||||
|
||||
api.Backend.ldap2.connect()
|
||||
|
||||
if get_nickname() == IPA_CA_NICKNAME:
|
||||
handler = renew_ca_cert
|
||||
elif is_replicated():
|
||||
if is_renewal_master():
|
||||
handler = request_and_store_cert
|
||||
else:
|
||||
handler = retrieve_cert_continuous
|
||||
else:
|
||||
handler = request_cert
|
||||
|
||||
res = call_handler(handler, **kwargs)
|
||||
for item in res[1:]:
|
||||
print(item)
|
||||
return res[0]
|
||||
finally:
|
||||
if api.Backend.ldap2.isconnected():
|
||||
api.Backend.ldap2.disconnect()
|
||||
certs.renewal_lock.release()
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
||||
try:
|
||||
sys.exit(main())
|
||||
except Exception as e:
|
||||
syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
|
||||
print("Internal error")
|
||||
sys.exit(UNREACHABLE)
|
||||
63
install/certmonger/ipa-server-guard
Executable file
63
install/certmonger/ipa-server-guard
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/python2 -E
|
||||
#
|
||||
# Authors:
|
||||
# Jan Cholasta <jcholast@redhat.com>
|
||||
#
|
||||
# Copyright (C) 2015 Red Hat
|
||||
# see file 'COPYING' for use and warranty information
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
# Prevent garbage from readline on standard output
|
||||
# (see https://fedorahosted.org/freeipa/ticket/4064)
|
||||
if not os.isatty(1):
|
||||
os.environ['TERM'] = 'dumb'
|
||||
import sys
|
||||
import syslog
|
||||
import traceback
|
||||
|
||||
import six
|
||||
|
||||
from ipapython import ipautil
|
||||
from ipaserver.install import certs
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
raise RuntimeError("Not enough arguments")
|
||||
|
||||
with certs.renewal_lock:
|
||||
result = ipautil.run(sys.argv[1:], raiseonerr=False, env=os.environ)
|
||||
if six.PY2:
|
||||
sys.stdout.write(result.raw_output)
|
||||
sys.stderr.write(result.raw_error_output)
|
||||
else:
|
||||
# Write bytes directly
|
||||
sys.stdout.buffer.write(result.raw_output) #pylint: disable=no-member
|
||||
sys.stderr.buffer.write(result.raw_error_output) #pylint: disable=no-member
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
|
||||
return result.returncode
|
||||
|
||||
|
||||
try:
|
||||
sys.exit(main())
|
||||
except Exception as e:
|
||||
syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
|
||||
print("Internal error")
|
||||
sys.exit(3)
|
||||
Reference in New Issue
Block a user