forked from tg-x/certpatrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange.xul
249 lines (231 loc) · 8.91 KB
/
change.xul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?xml version="1.0"?>
<!DOCTYPE dialog SYSTEM "chrome://certpatrol/locale/CertPatrol.dtd">
<?xml-stylesheet href="chrome://certpatrol/content/CertPatrol.css" type="text/css"?>
<dialog id="ssl-change"
title="Certificate Patrol"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
persist="screenX screenY width height" width="800" height="600"
buttons="extra1,accept,cancel"
onload="return onLoad()"
buttonlabelextra1="&ignoreHost;"
buttonlabelaccept="&accept;"
buttonlabelcancel="&reject;"
buttonaccesskeyextra1="&ignoreHost_key;"
buttonaccesskeyaccept="&accept_key;"
buttonaccesskeycancel="&reject_key;"
ondialogextra1="CertPatrol.ignoreHost(certobj.host); window.close()"
ondialogaccept="return CertPatrol.saveCert(certobj)"
ondialogcancel="return true">
<script>
var certobj = window.arguments[0];
var CertPatrol = window.arguments[1];
//var $ = document.getElementById.bind(document); // TB does not have bind()
function $() { return document.getElementById.apply(document, arguments); }
function onLoad() {
$("ssl-change").getButton("accept").disabled = true;
$("ssl-change").getButton("cancel").disabled = true;
setTimeout(function() {
$("ssl-change").getButton("accept").disabled = false;
$("ssl-change").getButton("cancel").disabled = false;
}, 2000);
/* host information in brackets is pretty important.. isn't it? */
$("cmdiag").setAttribute("description", "("+certobj.host+")");
$("cmdiag").setAttribute("title", certobj.event);
$("cmdiag").className += 'threat-'+ certobj.threat;
if (!certobj.old.cert) $("cmdetailso").disabled = true;
$("cmdetailsn").focus();
$("cmbox").scrollTop = 0;
var keys = ["commonName", "organization", "organizationalUnit",
// "serialNumber", "emailAddress",
"notBefore", "notAfter",
"issuerCommonName", "issuerOrganization", "issuerOrganizationUnit",
"issuerMd5Fingerprint", "issuerSha1Fingerprint",
"md5Fingerprint", "sha1Fingerprint"];
for (var i in keys) {
var key = keys[i];
if (certobj.now[key] == certobj.old[key]) {
$(key).value = certobj.old[key];
$(key+2).hidden = true;
} else {
$(key).value = certobj.old[key];
$(key+2).value = certobj.now[key];
$(key).className += " old";
$(key+2).className += " new";
$(key+2).hidden = false;
}
}
if (certobj.old.stored)
$("stored").value = certobj.old.stored;
else
$("stored").hidden = true;
for (var k in certobj.warn)
if (certobj.warn[k])
$("warn_"+k).hidden = false;
CertPatrol.addCertChain($("cmchaino"), certobj.old.cert);
CertPatrol.addCertChain($("cmchainn"), certobj.now.cert);
if ($("cmchaino").value != $("cmchainn").value) {
$("cmchaino").className += " old";
$("cmchainn").className += " new";
}
$("cmissueronly").checked = certobj.flags & CertPatrol.CHECK_ISSUER_ONLY;
}
</script>
<dialogheader id="cmdiag" />
<vbox class="warning">
<description hidden="true" id="warn_wildcard">&warn_wildcard;</description>
<description hidden="true" id="warn_commonName">&warn_commonName;</description>
<description hidden="true" id="warn_issuerCommonName">&warn_issuerCommonName;</description>
<description hidden="true" id="warn_notBefore">&warn_notBefore;</description>
<description hidden="true" id="warn_notAfter_expired">&warn_notAfter_expired;</description>
<description hidden="true" id="warn_notAfter_notdue">&warn_notAfter_notdue;</description>
<description hidden="true" id="warn_notAfter_due">&warn_notAfter_due;</description>
</vbox>
<vbox id="cmbox" flex="1" style="overflow: auto">
<grid>
<columns>
<column flex="1"/>
<column flex="2"/>
</columns>
<rows>
<!-- groupbox>
<caption id="cmhierarchy" label="&hierarchy;" />
</groupbox -->
<row>
<vbox>
<label value="&oldCertHier;" />
<button id="cmdetailso" oncommand="CertPatrol.viewCert(certobj.old.cert)" label="&viewOldCert;" accesskey="&viewOldCert_key;" />
</vbox>
<vbox>
<textbox id="cmchaino" multiline="true" readonly="true" />
</vbox>
</row>
<row>
<vbox>
<label value="&newCertHier;" />
<button id="cmdetailsn" oncommand="CertPatrol.viewCert(certobj.now.cert)" label="&viewNewCert;" accesskey="&viewNewCert_key;" />
</vbox>
<vbox>
<textbox id="cmchainn" multiline="true" readonly="true" />
</vbox>
</row>
<groupbox>
<caption id="cmissto" label="&issuedTo;" />
</groupbox>
<row>
<label id="cmcnl" value="&commonName;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="commonName" />
<textbox class="plain" readonly="true" id="commonName2" />
</vbox>
</row>
<row>
<label id="cmol" value="&organization;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="organization" />
<textbox class="plain" readonly="true" id="organization2" />
</vbox>
</row>
<row>
<label id="cmoul" value="&organizationalUnit;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="organizationalUnit" />
<textbox class="plain" readonly="true" id="organizationalUnit2" />
</vbox>
</row>
<!-- row>
<label id="cmsnl" value="&serialNumber;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="serialNumber" />
<textbox class="plain" readonly="true" id="serialNumber2" />
</vbox>
</row>
<row>
<label id="cmeml" value="&emailAddress;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="emailAddress" />
<textbox class="plain" readonly="true" id="emailAddress2" />
</vbox>
</row>
<groupbox>
<caption id="cmfinger" label="&fingerprints;" />
</groupbox -->
<row>
<label id="cmmd5l" value="&md5Fingerprint;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="md5Fingerprint" />
<textbox class="plain" readonly="true" id="md5Fingerprint2" />
</vbox>
</row>
<row>
<label id="cmsha1l" value="&sha1Fingerprint;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="sha1Fingerprint" />
<textbox class="plain" readonly="true" id="sha1Fingerprint2" />
</vbox>
</row>
<groupbox>
<caption id="cmvalid" label="&validity;" />
</groupbox>
<row>
<label id="cmnbl" value="¬Before;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="notBefore" />
<textbox class="plain" readonly="true" id="notBefore2" />
</vbox>
</row>
<row>
<label id="cmnal" value="¬After;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="notAfter" />
<textbox class="plain" readonly="true" id="notAfter2" />
</vbox>
</row>
<row>
<label id="cmnbl" value="&stored;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="stored" />
</vbox>
</row>
<groupbox>
<caption id="cmissby" label="&issuedBy;" />
</groupbox>
<row>
<label id="cmicnl" value="&commonName;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="issuerCommonName" />
<textbox class="plain" readonly="true" id="issuerCommonName2" />
</vbox>
</row>
<row>
<label id="cmiol" value="&organization;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="issuerOrganization" />
<textbox class="plain" readonly="true" id="issuerOrganization2" />
</vbox>
</row>
<row>
<label id="cmioul" value="&organizationalUnit;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="issuerOrganizationUnit" />
<textbox class="plain" readonly="true" id="issuerOrganizationUnit2" />
</vbox>
</row>
<row>
<label id="cmimd5l" value="&md5Fingerprint;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="issuerMd5Fingerprint" />
<textbox class="plain" readonly="true" id="issuerMd5Fingerprint2" />
</vbox>
</row>
<row>
<label id="cmisha1l" value="&sha1Fingerprint;" />
<vbox flex="1">
<textbox class="plain" readonly="true" id="issuerSha1Fingerprint" />
<textbox class="plain" readonly="true" id="issuerSha1Fingerprint2" />
</vbox>
</row>
</rows>
</grid>
</vbox>
<checkbox id="cmissueronly" oncommand="CertPatrol.setFlag(certobj, CertPatrol.CHECK_ISSUER_ONLY, this.checked)" label="&issuerOnly;" accesskey="&issuerOnly_key;" />
</dialog>