summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-10-04 17:08:17 +0200
committerRob Crittenden <rcritten@redhat.com>2012-10-04 18:10:13 -0400
commite13a88a2e59a6cdee806fdc4a619a22bba9c3f35 (patch)
treeca33eb00cfa1eadc9c4eb7421237462bb6176551 /ipaserver
parent2ba1fb5f87875a8793aad35224cb24d3b89f9883 (diff)
downloadfreeipa.git-e13a88a2e59a6cdee806fdc4a619a22bba9c3f35.tar.gz
freeipa.git-e13a88a2e59a6cdee806fdc4a619a22bba9c3f35.tar.xz
freeipa.git-e13a88a2e59a6cdee806fdc4a619a22bba9c3f35.zip
Build and installation of Kerberos authentication extension
This patch is adding a build of kerberosauth.xpi (FF Kerberos authentication extension). Currently the build is done in install phase of FreeIPA server. It is to allow signing of the extension by singing certificate. The signing might not be necessary because the only outcome is that in extension installation FF doesn't show that the maker is not verified. It shows text: 'Object signing cert'. This might be a bug in httpinstance.py:262(db.create_signing_cert("Signing-Cert", "Object Signing Cert", ca_db)) The value is in place of hostname parameter. If the extension is not signed, it can be created in rpm build phase, which should make upgrades easier. Current implementation doesn't handle upgrades yet. In order to keep extension and config pages not dependent on a realm, a krb.js.teplate file was created. This template is used for creating a /usr/share/ipa/html/krb.js file in install phase which holds FreeIPA's realm and domain information. This information can be then used by config pages by importing this file. Ticket: https://fedorahosted.org/freeipa/ticket/3094
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/httpinstance.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
index e1d8b6db..afadde40 100644
--- a/ipaserver/install/httpinstance.py
+++ b/ipaserver/install/httpinstance.py
@@ -292,13 +292,20 @@ class HTTPInstance(service.Service):
prefs_fd.close()
os.chmod(target_fname, 0644)
+ target_fname = '/usr/share/ipa/html/krb.js'
+ prefs_txt = ipautil.template_file(ipautil.SHARE_DIR + "krb.js.template", self.sub_dict)
+ prefs_fd = open(target_fname, "w")
+ prefs_fd.write(prefs_txt)
+ prefs_fd.close()
+ os.chmod(target_fname, 0644)
+
# The signing cert is generated in __setup_ssl
db = certs.CertDB(self.realm, subject_base=self.subject_base)
-
pwdfile = open(db.passwd_fname)
pwd = pwdfile.read()
pwdfile.close()
+ # Setup configure.jar
tmpdir = tempfile.mkdtemp(prefix = "tmp-")
target_fname = '/usr/share/ipa/html/configure.jar'
shutil.copy("/usr/share/ipa/html/preferences.html", tmpdir)
@@ -309,6 +316,18 @@ class HTTPInstance(service.Service):
shutil.rmtree(tmpdir)
os.chmod(target_fname, 0644)
+ # Setup extension
+ tmpdir = tempfile.mkdtemp(prefix = "tmp-")
+ extdir = tmpdir + "/ext"
+ target_fname = "/usr/share/ipa/html/kerberosauth.xpi"
+ shutil.copytree("/usr/share/ipa/ffextension", extdir)
+ db.run_signtool(["-k", "Signing-Cert",
+ "-p", pwd,
+ "-X", "-Z", target_fname,
+ extdir])
+ shutil.rmtree(tmpdir)
+ os.chmod(target_fname, 0644)
+
def __publish_ca_cert(self):
ca_db = certs.CertDB(self.realm)
ca_db.publish_ca_cert("/usr/share/ipa/html/ca.crt")