security/manager/pki/resources/content/downloadcert.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
michael@0 6 const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
michael@0 7 const nsIX509Cert = Components.interfaces.nsIX509Cert;
michael@0 8
michael@0 9 var pkiParams;
michael@0 10 var params;
michael@0 11 var caName;
michael@0 12 var cert;
michael@0 13
michael@0 14 function onLoad()
michael@0 15 {
michael@0 16 pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
michael@0 17 params = pkiParams.QueryInterface(nsIDialogParamBlock);
michael@0 18 var isupport = pkiParams.getISupportAtIndex(1);
michael@0 19 cert = isupport.QueryInterface(nsIX509Cert);
michael@0 20
michael@0 21 caName = cert.commonName;
michael@0 22
michael@0 23 var bundle = document.getElementById("pippki_bundle");
michael@0 24
michael@0 25 if (!caName.length)
michael@0 26 caName = bundle.getString("unnamedCA");
michael@0 27
michael@0 28 var message2 = bundle.getFormattedString("newCAMessage1", [caName]);
michael@0 29 setText("message2", message2);
michael@0 30 }
michael@0 31
michael@0 32 function viewCert()
michael@0 33 {
michael@0 34 viewCertHelper(window, cert);
michael@0 35 }
michael@0 36
michael@0 37 function doOK()
michael@0 38 {
michael@0 39 var checkSSL = document.getElementById("trustSSL");
michael@0 40 var checkEmail = document.getElementById("trustEmail");
michael@0 41 var checkObjSign = document.getElementById("trustObjSign");
michael@0 42 if (checkSSL.checked)
michael@0 43 params.SetInt(2,1);
michael@0 44 else
michael@0 45 params.SetInt(2,0);
michael@0 46 if (checkEmail.checked)
michael@0 47 params.SetInt(3,1);
michael@0 48 else
michael@0 49 params.SetInt(3,0);
michael@0 50 if (checkObjSign.checked)
michael@0 51 params.SetInt(4,1);
michael@0 52 else
michael@0 53 params.SetInt(4,0);
michael@0 54 params.SetInt(1,1);
michael@0 55 return true;
michael@0 56 }
michael@0 57
michael@0 58 function doCancel()
michael@0 59 {
michael@0 60 params.SetInt(1,0);
michael@0 61 return true;
michael@0 62 }

mercurial