summaryrefslogtreecommitdiff
path: root/cacert/cgi-bin
diff options
context:
space:
mode:
authorMarkus Warg <mw@it-sls.de>2010-03-11 15:17:02 +0100
committerMarkus Warg <mw@it-sls.de>2010-03-11 15:17:02 +0100
commit83b70a122092220d839d8a62c2b07913faa20fce (patch)
tree9b39a35e5183d9a36a3c3df38cf185f99de6708b /cacert/cgi-bin
downloadcacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.tar.gz
cacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.tar.xz
cacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.zip
source code taken from cacert-20090625.tar.bz2
Diffstat (limited to 'cacert/cgi-bin')
-rw-r--r--cacert/cgi-bin/CVS/Entries2
-rw-r--r--cacert/cgi-bin/CVS/Repository1
-rw-r--r--cacert/cgi-bin/CVS/Root1
-rwxr-xr-xcacert/cgi-bin/siteseal.cgi92
4 files changed, 96 insertions, 0 deletions
diff --git a/cacert/cgi-bin/CVS/Entries b/cacert/cgi-bin/CVS/Entries
new file mode 100644
index 0000000..883ec37
--- /dev/null
+++ b/cacert/cgi-bin/CVS/Entries
@@ -0,0 +1,2 @@
+/siteseal.cgi/1.4/Sun Apr 6 19:45:25 2008//
+D
diff --git a/cacert/cgi-bin/CVS/Repository b/cacert/cgi-bin/CVS/Repository
new file mode 100644
index 0000000..0dca230
--- /dev/null
+++ b/cacert/cgi-bin/CVS/Repository
@@ -0,0 +1 @@
+cacert/cgi-bin
diff --git a/cacert/cgi-bin/CVS/Root b/cacert/cgi-bin/CVS/Root
new file mode 100644
index 0000000..a363882
--- /dev/null
+++ b/cacert/cgi-bin/CVS/Root
@@ -0,0 +1 @@
+/var/lib/cvs
diff --git a/cacert/cgi-bin/siteseal.cgi b/cacert/cgi-bin/siteseal.cgi
new file mode 100755
index 0000000..ac28697
--- /dev/null
+++ b/cacert/cgi-bin/siteseal.cgi
@@ -0,0 +1,92 @@
+#!/usr/bin/php -q
+<?
+/**
+ * check site seal
+ *
+ * @package org.cacert.framework
+ * @author Duane Groth <duane@groth.net>
+ * @copyright Copyright (C) 2003-2008, {@link http://www.cacert.org/ CAcert Inc.}
+ * @license GPL Version 2
+ * @version $Id: siteseal.cgi,v 1.4 2008-04-06 19:44:25 root Exp $
+ */
+
+if($_SERVER["HTTPS"] == "on")
+ $http = "https";
+else
+ $http = "http";
+
+/* obfuscate var names */
+srand((double)microtime()*1000000);
+$var1 = "ca1-".md5(rand(0,9999999));
+$var2 = "ca2-".md5(rand(0,9999999));
+$var3 = "ca3-".md5(rand(0,9999999));
+$var4 = "ca4-".md5(rand(0,9999999));
+$var5 = "ca5-".md5(rand(0,9999999));
+$var6 = "ca6-".md5(rand(0,9999999));
+$var7 = "ca7-".md5(rand(0,9999999));
+$var8 = "ca8-".md5(rand(0,9999999));
+$var9 = "ca9-".md5(rand(0,9999999));
+$var10 = "caa-".md5(rand(0,9999999));
+$var11 = "cab-".md5(rand(0,9999999));
+
+header("Content-Type: text/javascript");
+header("Content-Disposition: inline; filename=\"siteseal.js\"");
+
+?>
+
+var <?=$var1?> = window.location.href;
+<? // var <?=$var2?> = '<?=$http?>://www.cacert.org/certdetails.php?referer=' + <?=$var1?>; ?>
+var <?=$var2?> = '<?=$http?>://www.cacert.org';
+var <?=$var3?> = (new Date()).getTimezoneOffset();
+
+var <?=$var4?> = navigator.userAgent.toLowerCase();
+var <?=$var5?> = false;
+if (<?=$var4?>.indexOf("msid") != 1) {
+ <?=$var5?> = (<?=$var4?>.indexOf("msie 5") == -1 && <?=$var4?>.indexOf("msie 6") == -1);
+}
+
+function <?=$var6?>(e) {
+ if (document.addEventListener) {
+ if (e.target.name == '<?=$var7?>') {
+ <?=$var8?>();
+ return false;
+ }
+ } else if (document.captureEvents) {
+ if (e.target.toString().indexOf('certdetails') != -1) {
+ <?=$var8?>();
+ return false;
+ }
+ }
+ return true;
+}
+
+function <?=$var9?>() {
+ if (event.button == 1) {
+ if (<?=$var5?>) {
+ return true;
+ } else {
+ <?=$var8?>();
+ return false;
+ }
+ } else if (event.button == 2) {
+ <?=$var8?>();
+ return false;
+ }
+}
+
+function <?=$var8?>() {
+ cacertWindow = window.open(<?=$var2?>, '<?=$var10?>', config='height=420,width=523,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes');
+ cacertWindow.focus();
+}
+
+if (document.addEventListener) {
+ document.addEventListener('mouseup', <?=$var6?>, true);
+} else {
+ if (document.layers) {
+ document.captureEvents(Event.MOUSEDOWN);
+ document.onmousedown=<?=$var6?>;
+ }
+}
+
+document.write("<a href='" + <?=$var2?> + "' target='<?=$var10?>' tabindex='-1' onmousedown='<?=$var9?>(); return false;'><img name='<?=$var7?>' border='0' src='<?=$http?>://www.cacert.org/sealgen.php?cert=<?=$cert?>&referer=" + <?=$var1?> + "' alt='Click to verify' oncontextmenu='return false;' /></a>"); ?>
+