From af360b084b8b5c787a0141cba65191d13e2a4aa4 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 16 May 2008 16:07:43 +0000 Subject: Saving incomplete openssl pages git-svn-id: svn://svn.alpinelinux.org/acf/openssl/trunk@1124 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openssl-model.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 openssl-model.lua (limited to 'openssl-model.lua') 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 -- cgit v1.2.3