diff --git a/plugins/encrypted_webinterface/encrypted_webinterface.py b/plugins/encrypted_webinterface/encrypted_webinterface.py new file mode 100644 index 0000000..ce67bdd --- /dev/null +++ b/plugins/encrypted_webinterface/encrypted_webinterface.py @@ -0,0 +1,48 @@ +# +# Copyright 2007 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox 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 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox 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 the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +"""Create an SSL certificate to encrypt the webinterface connection via stunnel +""" + +__revision__ = "$Id" + +import cryptobox.plugins.base + + +class encrypted_webinterface(cryptobox.plugins.base.CryptoBoxPlugin): + """Provide an encrypted webinterface connection via stunnel + """ + + plugin_capabilities = [ "system" ] + plugin_visibility = [] + request_auth = True + rank = 80 + + def do_action(self): + """The action handler. + """ + return None + + + def get_status(self): + """Retrieve the status of the feature. + """ + return "TODO" + diff --git a/plugins/encrypted_webinterface/intl/cryptobox-server-feature-encrypted_webinterface.pot b/plugins/encrypted_webinterface/intl/cryptobox-server-feature-encrypted_webinterface.pot new file mode 100644 index 0000000..0092fb3 --- /dev/null +++ b/plugins/encrypted_webinterface/intl/cryptobox-server-feature-encrypted_webinterface.pot @@ -0,0 +1,11 @@ +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/cs/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/cs/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/cs/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/da/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/da/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/da/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/de/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/de/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/de/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/en/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/en/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..14569f2 --- /dev/null +++ b/plugins/encrypted_webinterface/intl/en/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,12 @@ + +#: Name +msgid "Encrypted webinterface" +msgstr "Encrypted webinterface" + +#: Title +msgid "Create encryption certificate" +msgstr "Create encryption certificate" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "Create certificate" diff --git a/plugins/encrypted_webinterface/intl/es/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/es/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/es/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/fi/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/fi/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/fi/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/fr/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/fr/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/fr/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/hu/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/hu/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/hu/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/it/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/it/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/it/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/ja/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/ja/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/ja/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/nl/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/nl/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/nl/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/pl/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/pl/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/pl/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/pt/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/pt/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/pt/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/ru/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/ru/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/ru/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/sl/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/sl/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/sl/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/intl/sv/cryptobox-server-feature-encrypted_webinterface.po b/plugins/encrypted_webinterface/intl/sv/cryptobox-server-feature-encrypted_webinterface.po new file mode 100644 index 0000000..6a36cec --- /dev/null +++ b/plugins/encrypted_webinterface/intl/sv/cryptobox-server-feature-encrypted_webinterface.po @@ -0,0 +1,26 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-21 19:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Translate Toolkit 0.10.1\n" + +#: Name +msgid "Encrypted webinterface" +msgstr "" + +#: Title +msgid "Create encryption certificate" +msgstr "" + +#: Button.CreateCertificate +msgid "Create certificate" +msgstr "" diff --git a/plugins/encrypted_webinterface/language.hdf b/plugins/encrypted_webinterface/language.hdf new file mode 100644 index 0000000..4c9aa9e --- /dev/null +++ b/plugins/encrypted_webinterface/language.hdf @@ -0,0 +1,7 @@ +Name = Encrypted webinterface +Link = Encrypted webinterface + +Title = Create encryption certificate + +Button.CreateCertificate = Create certificate + diff --git a/plugins/encrypted_webinterface/root_action.py b/plugins/encrypted_webinterface/root_action.py new file mode 100755 index 0000000..2e79bb9 --- /dev/null +++ b/plugins/encrypted_webinterface/root_action.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# +# Copyright 2007 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox 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 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox 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 the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +__revision__ = "$Id" + + +## necessary: otherwise CryptoBoxRootActions.py will refuse to execute this script +PLUGIN_TYPE = "cryptobox" + +STUNNEL_BIN = "/usr/bin/stunnel" + +import sys +import os + +def run_stunnel(cert_file, src_port, dst_port): + import subprocess + if not src_port.isdigit(): + sys.stderr.write("Source port is not a number: %s" % src_port) + return False + if not dst_port.isdigit(): + sys.stderr.write("Destination port is not a number: %s" % dst_port) + return False + if not os.path.isfile(cert_file, src_port, dst_port): + sys.stderr.write("The certificate file (%s) does not exist!" % cert_file) + return False + proc = subprocess.Popen( + shell = False, + args = [ STUNNEL_BIN, + "-p", cert_file, + "-d", dst_port, + "-r", src_port ]) + proc.wait() + return proc.returncode == 0 + + +if __name__ == "__main__": + args = sys.argv[1:] + + self_bin = sys.argv[0] + + if len(args) != 3: + sys.stderr.write("%s: invalid number of arguments (%d instead of %d))\n" % \ + (self_bin, len(args), 3)) + sys.exit(1) + + if not run_stunnel(args[0], args[1], args[2]): + sys.stderr.write("%s: failed to run 'stunnel'!") + sys.exit(100) + + sys.exit(0) + diff --git a/plugins/encrypted_webinterface/unittests.py b/plugins/encrypted_webinterface/unittests.py new file mode 100644 index 0000000..d697c84 --- /dev/null +++ b/plugins/encrypted_webinterface/unittests.py @@ -0,0 +1,33 @@ +# +# Copyright 2007 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox 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 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox 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 the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +__revision__ = "$Id" + +from cryptobox.tests.base import WebInterfaceTestClass + +class unittests(WebInterfaceTestClass): + + def test_get_cert_form(self): + """retrieve the default form of the certificate manager""" + url = self.url + "encrypted_webinterface" + self.register_auth(url) + self.cmd.go(url) + self.cmd.find("Data.Status.Plugins.encrypted_webinterface") +