summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-05-16 16:07:43 +0000
committerTed Trask <ttrask01@yahoo.com>2008-05-16 16:07:43 +0000
commitaf360b084b8b5c787a0141cba65191d13e2a4aa4 (patch)
treeae662ca45bdcdf6340f40ad60512745c93a363a9
downloadacf-openssl-af360b084b8b5c787a0141cba65191d13e2a4aa4.tar.bz2
acf-openssl-af360b084b8b5c787a0141cba65191d13e2a4aa4.tar.xz
Saving incomplete openssl pages
git-svn-id: svn://svn.alpinelinux.org/acf/openssl/trunk@1124 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--Makefile44
-rw-r--r--README0
-rw-r--r--config.mk10
-rw-r--r--openssl-controller.lua73
-rw-r--r--openssl-editdefaults-html.lsp12
-rw-r--r--openssl-html.lsp24
-rw-r--r--openssl-model.lua36
-rw-r--r--openssl-request-html.lsp12
-rw-r--r--openssl.menu6
-rw-r--r--openssl.roles1
10 files changed, 218 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bb64d4b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+APP_NAME=openssl
+PACKAGE=acf-$(APP_NAME)
+VERSION=0.1.0
+
+APP_DIST=\
+ openssl* \
+
+
+EXTRA_DIST=README Makefile config.mk
+
+DISTFILES=$(APP_DIST) $(EXTRA_DIST)
+
+TAR=tar
+
+P=$(PACKAGE)-$(VERSION)
+tarball=$(P).tar.bz2
+install_dir=$(DESTDIR)/$(appdir)/$(APP_NAME)
+
+all:
+clean:
+ rm -rf $(tarball) $(P)
+
+dist: $(tarball)
+
+install:
+ mkdir -p "$(install_dir)"
+ cp -a $(APP_DIST) "$(install_dir)"
+
+$(tarball): $(DISTFILES)
+ rm -rf $(P)
+ mkdir -p $(P)
+ cp $(DISTFILES) $(P)
+ $(TAR) -jcf $@ $(P)
+ rm -rf $(P)
+
+# target that creates a tar package, unpacks is and install from package
+dist-install: $(tarball)
+ $(TAR) -jxf $(tarball)
+ $(MAKE) -C $(P) install DESTDIR=$(DESTDIR)
+ rm -rf $(P)
+
+include config.mk
+
+.PHONY: all clean dist install dist-install
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..45f4d21
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,10 @@
+prefix=/usr
+datadir=${prefix}/share
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+acfdir=${datadir}/acf
+wwwdir=${acfdir}/www
+cgibindir=${acfdir}/cgi-bin
+appdir=${acfdir}/app
+acflibdir=${acfdir}/lib
+sessionsdir=${localstatedir}/lib/acf/sessions
diff --git a/openssl-controller.lua b/openssl-controller.lua
new file mode 100644
index 0000000..88bb098
--- /dev/null
+++ b/openssl-controller.lua
@@ -0,0 +1,73 @@
+-- the openssl certificates controller
+module (..., package.seeall)
+
+require("getopts")
+
+default_action = "read"
+
+-- View all pending and approved requests and revoked certificates
+readall = function(self)
+end
+
+-- Return all certificates (pending, approved, and revoked) for this user
+read = function(self)
+ local user = cfe({ value="Ted", label="User Name" })
+ local result = cfe({ type="list", value={user=user} })
+-- result.value[1] = getopts.getoptsfromfile(configfile, nil, nil)
+-- getopts.setoptsinfile(configfile, "Hey", "test", "--qasdg", true, nil)
+-- result.value[2] = getopts.getoptsfromfile(configfile, nil, nil)
+ return result
+end
+
+-- Form to request a new cert
+request = function(self)
+ local request
+ if self.clientdata.Submit then
+ -- Try to submit the request
+ request = cfe({ type="group", value={} })
+ else
+ request = self.model.getdefaults()
+ end
+
+ request.type = "form"
+ request.label = "Request Certificate"
+ request.option = "Submit"
+
+ return request
+end
+
+-- Form to edit request defaults
+editdefaults = function(self)
+ local defaults
+ if self.clientdata.Save then
+ defaults = cfe({ type="group", value={} })
+ else
+ defaults = self.model.getdefaults()
+ end
+
+ defaults.type = "form"
+ defaults.label = "Edit certificate defaults"
+ defaults.option = "Save"
+
+ return defaults
+end
+
+-- Approve the specified request
+approve = function(self)
+end
+
+-- Revoke the specified cert
+revoke = function(self)
+end
+
+-- Get the specified cert
+getcert = function(self)
+end
+
+-- Get the revoked list
+getrevoked = function(self)
+end
+
+-- Put the CA cert
+putcacert = function(self)
+end
diff --git a/openssl-editdefaults-html.lsp b/openssl-editdefaults-html.lsp
new file mode 100644
index 0000000..bc153a4
--- /dev/null
+++ b/openssl-editdefaults-html.lsp
@@ -0,0 +1,12 @@
+<? local form, viewlibrary = ... ?>
+<? require("viewfunctions") ?>
+
+<? --[[ DEBUG INFORMATION
+io.write(html.cfe_unpack(form))
+--]] ?>
+
+<H1><?= form.label ?></H1>
+<?
+ displayform(form)
+?>
+
diff --git a/openssl-html.lsp b/openssl-html.lsp
new file mode 100644
index 0000000..60f659a
--- /dev/null
+++ b/openssl-html.lsp
@@ -0,0 +1,24 @@
+<? local view, viewlibrary, pageinfo, session = ... ?>
+
+<? --[[ DEBUG INFORMATION
+io.write(html.cfe_unpack(view))
+--]] ?>
+
+<H1>Pending certificate requests<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
+<? if not view.value.pending or #view.value.pending.value == 0 then ?>
+ No certificates pending
+<? else
+end ?>
+
+<H1>Approved certificate requests<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
+<? if not view.value.approved or #view.value.approved.value == 0 then ?>
+ No certificates approved
+<? else
+end ?>
+
+<H1>Revoked certificates<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
+<? if not view.value.revoked or #view.value.revoked.value == 0 then ?>
+ No certificates revoked
+<? else
+end ?>
+
diff --git a/openssl-model.lua b/openssl-model.lua
new file mode 100644
index 0000000..bbb5f60
--- /dev/null
+++ b/openssl-model.lua
@@ -0,0 +1,36 @@
+module(..., package.seeall)
+
+local configfile = "/etc/ssl/openssl.cnf"
+
+-- list of request entries that can be edited
+local distinguished_names = { "countryName", "stateOrProvinceName", "localityName", "organizationName", "organizationalUnitName", "commonName", "emailAddress" }
+
+local validate_distinguished_names = function(clientdata)
+ local config = getopts.getoptsfromfile(configfile)
+ local distinguished_name = config.req.distinguished_name or ""
+
+ for i, name in ipairs(distinguished_names) do
+ if config[distinguished_name][name.."_min"] then
+ end
+ end
+end
+
+getdefaults = function()
+ local defaults = cfe({ type="group", value={} })
+ local config = getopts.getoptsfromfile(configfile)
+ local distinguished_name = config.req.distinguished_name or ""
+
+ for i, name in ipairs(distinguished_names) do
+ defaults.value[name] = cfe({ label=name,
+ value=config[distinguished_name][name .. "_default"] or "",
+ descr=config[distinguished_name][name] })
+ end
+
+ return defaults
+end
+
+setdefaults = function(clientdata)
+ -- validate values
+ validate_distinguished_names(clientdata)
+
+end
diff --git a/openssl-request-html.lsp b/openssl-request-html.lsp
new file mode 100644
index 0000000..bc153a4
--- /dev/null
+++ b/openssl-request-html.lsp
@@ -0,0 +1,12 @@
+<? local form, viewlibrary = ... ?>
+<? require("viewfunctions") ?>
+
+<? --[[ DEBUG INFORMATION
+io.write(html.cfe_unpack(form))
+--]] ?>
+
+<H1><?= form.label ?></H1>
+<?
+ displayform(form)
+?>
+
diff --git a/openssl.menu b/openssl.menu
new file mode 100644
index 0000000..c3533ca
--- /dev/null
+++ b/openssl.menu
@@ -0,0 +1,6 @@
+# Prefix and controller are already known at this point
+# Cat Group Tab Action
+Applications 10Certificates All readall
+Applications 10Certificates Status read
+Applications 10Certificates Request request
+Applications 10Certificates Edit_Defaults editdefaults
diff --git a/openssl.roles b/openssl.roles
new file mode 100644
index 0000000..00df7ae
--- /dev/null
+++ b/openssl.roles
@@ -0,0 +1 @@
+ALL=openssl:read,openssl:request,openssl:editdefaults