Project

General

Profile

Download (40.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
    system_certmanager.php
4

    
5
    Copyright (C) 2008 Shrew Soft Inc.
6
    All rights reserved.
7

    
8
    Redistribution and use in source and binary forms, with or without
9
    modification, are permitted provided that the following conditions are met:
10

    
11
    1. Redistributions of source code must retain the above copyright notice,
12
       this list of conditions and the following disclaimer.
13

    
14
    2. Redistributions in binary form must reproduce the above copyright
15
       notice, this list of conditions and the following disclaimer in the
16
       documentation and/or other materials provided with the distribution.
17

    
18
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
    POSSIBILITY OF SUCH DAMAGE.
28
*/
29
/*
30
	pfSense_MODULE:	certificate_managaer
31
*/
32

    
33
##|+PRIV
34
##|*IDENT=page-system-certmanager
35
##|*NAME=System: Certificate Manager
36
##|*DESCR=Allow access to the 'System: Certificate Manager' page.
37
##|*MATCH=system_certmanager.php*
38
##|-PRIV
39

    
40
require("guiconfig.inc");
41
require_once("certs.inc");
42

    
43
$cert_methods = array(
44
	"import" => gettext("Import an existing Certificate"),
45
	"internal" => gettext("Create an internal Certificate"),
46
	"external" => gettext("Create a Certificate Signing Request"),
47
);
48

    
49
$cert_keylens = array( "512", "1024", "2048", "4096");
50
$cert_types = array(	"ca" => "Certificate Authority",
51
			"server" => "Server Certificate",
52
			"user" => "User Certificate");
53

    
54
$altname_types = array("DNS", "IP", "email", "URI");
55

    
56
$pgtitle = array(gettext("System"), gettext("Certificate Manager"));
57

    
58
$userid = $_GET['userid'];
59
if (isset($_POST['userid']))
60
	$userid = $_POST['userid'];
61
if (is_numeric($userid)) {
62
	$cert_methods["existing"] = gettext("Choose an existing certificate");
63
	if (!is_array($config['system']['user']))
64
		$config['system']['user'] = array();
65
	$a_user =& $config['system']['user'];
66
}
67

    
68
$id = $_GET['id'];
69
if (isset($_POST['id']))
70
	$id = $_POST['id'];
71

    
72
if (!is_array($config['ca']))
73
	$config['ca'] = array();
74

    
75
$a_ca =& $config['ca'];
76

    
77
if (!is_array($config['cert']))
78
	$config['cert'] = array();
79

    
80
$a_cert =& $config['cert'];
81

    
82
$internal_ca_count = 0;
83
foreach ($a_ca as $ca)
84
	if ($ca['prv'])	
85
		$internal_ca_count++;
86

    
87
$act = $_GET['act'];
88
if ($_POST['act'])
89
	$act = $_POST['act'];
90

    
91
if ($act == "del") {
92

    
93
	if (!$a_cert[$id]) {
94
		pfSenseHeader("system_certmanager.php");
95
		exit;
96
	}
97

    
98
	$name = $a_cert[$id]['descr'];
99
	unset($a_cert[$id]);
100
	write_config();
101
	$savemsg = sprintf(gettext("Certificate %s successfully deleted"), $name) . "<br/>";
102
	pfSenseHeader("system_certmanager.php");
103
	exit;
104
}
105

    
106
if ($act == "new") {
107
	$pconfig['method'] = $_GET['method'];
108
	$pconfig['keylen'] = "2048";
109
	$pconfig['type'] = "user";
110
	$pconfig['lifetime'] = "3650";
111
}
112

    
113
if ($act == "exp") {
114

    
115
	if (!$a_cert[$id]) {
116
		pfSenseHeader("system_certmanager.php");
117
		exit;
118
	}
119

    
120
	$exp_name = urlencode("{$a_cert[$id]['descr']}.crt");
121
	$exp_data = base64_decode($a_cert[$id]['crt']);
122
	$exp_size = strlen($exp_data);
123

    
124
	header("Content-Type: application/octet-stream");
125
	header("Content-Disposition: attachment; filename={$exp_name}");
126
	header("Content-Length: $exp_size");
127
	echo $exp_data;
128
	exit;
129
}
130

    
131
if ($act == "key") {
132

    
133
	if (!$a_cert[$id]) {
134
		pfSenseHeader("system_certmanager.php");
135
		exit;
136
	}
137

    
138
	$exp_name = urlencode("{$a_cert[$id]['descr']}.key");
139
	$exp_data = base64_decode($a_cert[$id]['prv']);
140
	$exp_size = strlen($exp_data);
141

    
142
	header("Content-Type: application/octet-stream");
143
	header("Content-Disposition: attachment; filename={$exp_name}");
144
	header("Content-Length: $exp_size");
145
	echo $exp_data;
146
	exit;
147
}
148

    
149
if ($act == "p12") {
150
	if (!$a_cert[$id]) {
151
		pfSenseHeader("system_certmanager.php");
152
		exit;
153
	}
154

    
155
	$exp_name = urlencode("{$a_cert[$id]['descr']}.p12");
156

    
157
	$res_crt = openssl_x509_read(base64_decode($a_cert[$id]['crt']));
158
	$res_key = openssl_pkey_get_private(array(0 => base64_decode($a_cert[$id]['prv']) , 1 => ""));
159

    
160
	$exp_data = "";
161
	openssl_pkcs12_export($res_crt, $exp_data, $res_key, null);
162
	$exp_size = strlen($exp_data);
163

    
164
	header("Content-Type: application/octet-stream");
165
	header("Content-Disposition: attachment; filename={$exp_name}");
166
	header("Content-Length: $exp_size");
167
	echo $exp_data;
168
	exit;
169
}
170

    
171
if ($act == "csr") {
172

    
173
	if (!$a_cert[$id]) {
174
		pfSenseHeader("system_certmanager.php");
175
		exit;
176
	}
177

    
178
	$pconfig['descr'] = $a_cert[$id]['descr'];
179
	$pconfig['csr'] = base64_decode($a_cert[$id]['csr']);
180
}
181

    
182
if ($_POST) {
183
	if ($_POST['save'] == gettext("Save")) {
184
		$input_errors = array();
185
		$pconfig = $_POST;
186

    
187
		/* input validation */
188
		if ($pconfig['method'] == "import") {
189
			$reqdfields = explode(" ",
190
					"descr cert key");
191
			$reqdfieldsn = array(
192
					gettext("Descriptive name"),
193
					gettext("Certificate data"),
194
					gettext("Key data"));
195
			if ($_POST['cert'] && (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE")))
196
				$input_errors[] = gettext("This certificate does not appear to be valid.");
197
		}
198

    
199
		if ($pconfig['method'] == "internal") {
200
			$reqdfields = explode(" ",
201
					"descr caref keylen type lifetime dn_country dn_state dn_city ".
202
					"dn_organization dn_email dn_commonname");
203
			$reqdfieldsn = array(
204
					gettext("Descriptive name"),
205
					gettext("Certificate authority"),
206
					gettext("Key length"),
207
					gettext("Certificate Type"),
208
					gettext("Lifetime"),
209
					gettext("Distinguished name Country Code"),
210
					gettext("Distinguished name State or Province"),
211
					gettext("Distinguished name City"),
212
					gettext("Distinguished name Organization"),
213
					gettext("Distinguished name Email Address"),
214
					gettext("Distinguished name Common Name"));
215
		}
216

    
217
		if ($pconfig['method'] == "external") {
218
			$reqdfields = explode(" ",
219
					"descr csr_keylen csr_dn_country csr_dn_state csr_dn_city ".
220
					"csr_dn_organization csr_dn_email csr_dn_commonname");
221
			$reqdfieldsn = array(
222
					gettext("Descriptive name"),
223
					gettext("Key length"),
224
					gettext("Distinguished name Country Code"),
225
					gettext("Distinguished name State or Province"),
226
					gettext("Distinguished name City"),
227
					gettext("Distinguished name Organization"),
228
					gettext("Distinguished name Email Address"),
229
					gettext("Distinguished name Common Name"));
230
		}
231

    
232
		if ($pconfig['method'] == "existing") {
233
			$reqdfields = array("certref");
234
			$reqdfieldsn = array(gettext("Existing Certificate Choice"));
235
		}
236

    
237
		$altnames = array();
238
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
239
		if ($pconfig['method'] != "import") {
240
			/* subjectAltNames */
241
			foreach ($_POST as $key => $value) {
242
				$entry = '';
243
				if (!substr_compare('altname_type', $key, 0, 12)) {
244
					$entry = substr($key, 12);
245
					$field = 'type';
246
				}
247
				elseif (!substr_compare('altname_value', $key, 0, 13)) {
248
					$entry = substr($key, 13);
249
					$field = 'value';
250
				}
251
				if (ctype_digit($entry)) {
252
					$altnames[$entry][$field] = $value;
253
				}
254
			}
255
			$pconfig['aliases']['item'] = $aliases;
256

    
257
			/* Input validation for subjectAltNames */
258
			foreach ($altnames as $idx => $altname) {
259
				switch ($altname['type']) {
260
					case "DNS":
261
						if (!is_hostname($altname['value']))
262
							array_push($input_errors, "DNS subjectAltName values must be valid hostnames or FQDNs");
263
						break;
264
					case "IP":
265
						if (!is_ipaddr($altname['value']))
266
							array_push($input_errors, "IP subjectAltName values must be valid IP Addresses");
267
						break;
268
					case "email":
269
						if (empty($altname['value']))
270
							array_push($input_errors, "You must provide an e-mail address for this type of subjectAltName");
271
						if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $altname['value']))
272
							array_push($input_errors, "The e-mail provided in a subjectAltName contains invalid characters.");
273
						break;
274
					case "URI":
275
						/* Close enough? */
276
						if (!is_URL($altname['value']))
277
							$input_errors[] = "URI subjectAltName types must be a valid URI";
278
						break;
279
					default:
280
						$input_errors[] = "Unrecognized subjectAltName type.";
281
				}
282
			}
283

    
284
			/* Make sure we do not have invalid characters in the fields for the certificate */
285
			for ($i = 0; $i < count($reqdfields); $i++) {
286
				if (preg_match('/email/', $reqdfields[$i])){ /* dn_email or csr_dn_name */
287
				 	if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["$reqdfields[$i]"]))
288
						array_push($input_errors, "The field 'Distinguished name Email Address' contains invalid characters.");
289
				}else if (preg_match('/commonname/', $reqdfields[$i])){ /* dn_commonname or csr_dn_commonname */
290
					if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["$reqdfields[$i]"]))
291
						array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
292
				}else if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
293
					array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
294
			}
295
		}
296

    
297
		/* if this is an AJAX caller then handle via JSON */
298
		if (isAjax() && is_array($input_errors)) {
299
			input_errors2Ajax($input_errors);
300
			exit;
301
		}
302

    
303
		/* save modifications */
304
		if (!$input_errors) {
305

    
306
			if ($pconfig['method'] == "existing") {
307
				$cert = lookup_cert($pconfig['certref']);
308
				if ($cert && $a_user)
309
					$a_user[$userid]['cert'][] = $cert['refid'];
310
			} else {
311
				$cert = array();
312
				$cert['refid'] = uniqid();
313
				if (isset($id) && $a_cert[$id])
314
					$cert = $a_cert[$id];
315

    
316
				$cert['descr'] = $pconfig['descr'];
317

    
318
				$old_err_level = error_reporting(0); /* otherwise openssl_ functions throw warings directly to a page screwing menu tab */
319

    
320
				if ($pconfig['method'] == "import")
321
					cert_import($cert, $pconfig['cert'], $pconfig['key']);
322

    
323
				if ($pconfig['method'] == "internal") {
324
					$dn = array(
325
						'countryName' => $pconfig['dn_country'],
326
						'stateOrProvinceName' => $pconfig['dn_state'],
327
						'localityName' => $pconfig['dn_city'],
328
						'organizationName' => $pconfig['dn_organization'],
329
						'emailAddress' => $pconfig['dn_email'],
330
						'commonName' => $pconfig['dn_commonname']);
331
					if (count($altnames)) {
332
						$altnames_tmp = "";
333
						foreach ($altnames as $altname) {
334
							$altnames_tmp[] = "{$altname['type']}:{$altname['value']}";
335
						}
336
						$dn['subjectAltName'] = implode(",", $altnames_tmp);
337
					}
338
					if (!cert_create($cert, $pconfig['caref'], $pconfig['keylen'],
339
						$pconfig['lifetime'], $dn, $pconfig['type'])){
340
						while($ssl_err = openssl_error_string()){
341
							$input_errors = array();
342
							array_push($input_errors, "openssl library returns: " . $ssl_err);
343
						}
344
					}
345
				}
346

    
347
				if ($pconfig['method'] == "external") {
348
					$dn = array(
349
						'countryName' => $pconfig['csr_dn_country'],
350
						'stateOrProvinceName' => $pconfig['csr_dn_state'],
351
						'localityName' => $pconfig['csr_dn_city'],
352
						'organizationName' => $pconfig['csr_dn_organization'],
353
						'emailAddress' => $pconfig['csr_dn_email'],
354
						'commonName' => $pconfig['csr_dn_commonname']);
355
					if (count($altnames)) {
356
						$altnames_tmp = "";
357
						foreach ($altnames as $altname) {
358
							$altnames_tmp[] = "{$altname['type']}:{$altname['value']}";
359
						}
360
						$dn['subjectAltName'] = implode(",", $altnames_tmp);
361
					}
362
					if(!csr_generate($cert, $pconfig['csr_keylen'], $dn)){
363
						while($ssl_err = openssl_error_string()){
364
							$input_errors = array();
365
							array_push($input_errors, "openssl library returns: " . $ssl_err);
366
						}
367
					}
368
				}
369
				error_reporting($old_err_level);
370

    
371
				if (isset($id) && $a_cert[$id])
372
					$a_cert[$id] = $cert;
373
				else
374
					$a_cert[] = $cert;
375
				if (isset($a_user) && isset($userid))
376
					$a_user[$userid]['cert'][] = $cert['refid'];
377
			}
378

    
379
			if (!$input_errors)
380
				write_config();
381

    
382
			if ($userid)
383
				pfSenseHeader("system_usermanager.php?act=edit&id={$userid}");
384
		}
385
	}
386

    
387
	if ($_POST['save'] == gettext("Update")) {
388
		unset($input_errors);
389
		$pconfig = $_POST;
390

    
391
		/* input validation */
392
		$reqdfields = explode(" ", "descr cert");
393
		$reqdfieldsn = array(
394
			gettext("Descriptive name"),
395
			gettext("Final Certificate data"));
396

    
397
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
398

    
399
//		old way
400
		/* make sure this csr and certificate subjects match */
401
//		$subj_csr = csr_get_subject($pconfig['csr'], false);
402
//		$subj_cert = cert_get_subject($pconfig['cert'], false);
403
//
404
//		if ( !isset($_POST['ignoresubjectmismatch']) && !($_POST['ignoresubjectmismatch'] == "yes") ) {
405
//			if (strcmp($subj_csr,$subj_cert)) {
406
//				$input_errors[] = sprintf(gettext("The certificate subject '%s' does not match the signing request subject."),$subj_cert);
407
//				$subject_mismatch = true;
408
//			}
409
//		}
410
		$mod_csr  =  csr_get_modulus($pconfig['csr'], false);
411
		$mod_cert = cert_get_modulus($pconfig['cert'], false);
412
		
413
		if (strcmp($mod_csr,$mod_cert)) {
414
			// simply: if the moduli don't match, then the private key and public key won't match
415
			$input_errors[] = sprintf(gettext("The certificate modulus does not match the signing request modulus."),$subj_cert);
416
			$subject_mismatch = true;
417
		}
418

    
419
		/* if this is an AJAX caller then handle via JSON */
420
		if (isAjax() && is_array($input_errors)) {
421
			input_errors2Ajax($input_errors);
422
			exit;
423
		}
424

    
425
		/* save modifications */
426
		if (!$input_errors) {
427

    
428
			$cert = $a_cert[$id];
429

    
430
			$cert['descr'] = $pconfig['descr'];
431

    
432
			csr_complete($cert, $pconfig['cert']);
433

    
434
			$a_cert[$id] = $cert;
435

    
436
			write_config();
437

    
438
			pfSenseHeader("system_certmanager.php");
439
		}
440
	}
441
}
442

    
443
include("head.inc");
444
?>
445

    
446
<body link="#000000" vlink="#000000" alink="#000000" onLoad="<?= $jsevents["body"]["onload"] ?>">
447
<?php include("fbegin.inc"); ?>
448
<script type="text/javascript">
449
<!--
450

    
451
function method_change() {
452

    
453
<?php
454
	if ($internal_ca_count)
455
		$submit_style = "";
456
	else
457
		$submit_style = "none";
458
?>
459

    
460
	method = document.iform.method.selectedIndex;
461

    
462
	switch (method) {
463
		case 0:
464
			document.getElementById("import").style.display="";
465
			document.getElementById("internal").style.display="none";
466
			document.getElementById("external").style.display="none";
467
			document.getElementById("existing").style.display="none";
468
			document.getElementById("descriptivename").style.display="";
469
			document.getElementById("submit").style.display="";
470
			break;
471
		case 1:
472
			document.getElementById("import").style.display="none";
473
			document.getElementById("internal").style.display="";
474
			document.getElementById("external").style.display="none";
475
			document.getElementById("existing").style.display="none";
476
			document.getElementById("descriptivename").style.display="";
477
			document.getElementById("submit").style.display="<?=$submit_style;?>";
478
			break;
479
		case 2:
480
			document.getElementById("import").style.display="none";
481
			document.getElementById("internal").style.display="none";
482
			document.getElementById("external").style.display="";
483
			document.getElementById("existing").style.display="none";
484
			document.getElementById("descriptivename").style.display="";
485
			document.getElementById("submit").style.display="";
486
			break;
487
		case 3:
488
			document.getElementById("import").style.display="none";
489
			document.getElementById("internal").style.display="none";
490
			document.getElementById("external").style.display="none";
491
			document.getElementById("existing").style.display="";
492
			document.getElementById("descriptivename").style.display="none";
493
			document.getElementById("submit").style.display="";
494
			break;
495
	}
496
}
497

    
498
<?php if ($internal_ca_count): ?>
499
function internalca_change() {
500

    
501
	index = document.iform.caref.selectedIndex;
502
	caref = document.iform.caref[index].value;
503

    
504
	switch (caref) {
505
<?php
506
		foreach ($a_ca as $ca):
507
			if (!$ca['prv'])
508
				continue;
509
			$subject = cert_get_subject_array($ca['crt']);
510
?>
511
		case "<?=$ca['refid'];?>":
512
			document.iform.dn_country.value = "<?=$subject[0]['v'];?>";
513
			document.iform.dn_state.value = "<?=$subject[1]['v'];?>";
514
			document.iform.dn_city.value = "<?=$subject[2]['v'];?>";
515
			document.iform.dn_organization.value = "<?=$subject[3]['v'];?>";
516
			document.iform.dn_email.value = "<?=$subject[4]['v'];?>";
517
			break;
518
<?php	endforeach; ?>
519
	}
520
}
521
<?php endif; ?>
522

    
523
//-->
524
</script>
525
<script type="text/javascript" src="/javascript/row_helper_dynamic.js">
526
</script>
527
<input type='hidden' name='altname_value_type' value='select' />
528
<input type='hidden' name='altname_type_type' value='textbox' />
529
<script type="text/javascript">
530
	rowname[0] = "altname_type";
531
	rowtype[0] = "textbox";
532
	rowsize[0] = "10";
533
	rowname[1] = "altname_value";
534
	rowtype[1] = "textbox";
535
	rowsize[1] = "30";
536
</script>
537
<?php
538
	if ($input_errors)
539
		print_input_errors($input_errors);
540
	if ($savemsg)
541
		print_info_box($savemsg);
542

    
543
        // Load valid country codes
544
        $dn_cc = array();
545
        if (file_exists("/etc/ca_countries")){
546
                $dn_cc_file=file("/etc/ca_countries");
547
                foreach($dn_cc_file as $line)
548
                        if (preg_match('/^(\S*)\s(.*)$/', $line, $matches))
549
                                array_push($dn_cc, $matches[1]);
550
        }
551
?>
552
<table width="100%" border="0" cellpadding="0" cellspacing="0">
553
	<tr>
554
		<td class="tabnavtbl">
555
		<?php
556
			$tab_array = array();
557
			$tab_array[] = array(gettext("CAs"), false, "system_camanager.php");
558
			$tab_array[] = array(gettext("Certificates"), true, "system_certmanager.php");
559
			$tab_array[] = array(gettext("Certificate Revocation"), false, "system_crlmanager.php");
560
			display_top_tabs($tab_array);
561
		?>
562
		</td>
563
	</tr>
564
	<tr>
565
		<td id="mainarea">
566
			<div class="tabcont">
567

    
568
				<?php if ($act == "new" || (($_POST['save'] == gettext("Save")) && $input_errors)): ?>
569

    
570
				<form action="system_certmanager.php" method="post" name="iform" id="iform">
571
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
572
						<?php if (!isset($id)): ?>
573
						<tr>
574
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Method");?></td>
575
							<td width="78%" class="vtable">
576
								<select name='method' id='method' class="formselect" onchange='method_change()'>
577
								<?php
578
									foreach($cert_methods as $method => $desc):
579
									$selected = "";
580
									if ($pconfig['method'] == $method)
581
										$selected = "selected";
582
								?>
583
									<option value="<?=$method;?>"<?=$selected;?>><?=$desc;?></option>
584
								<?php endforeach; ?>
585
								</select>
586
							</td>
587
						</tr>
588
						<?php endif; ?>
589
						<tr id="descriptivename">
590
							<?php
591
							if ($a_user && empty($pconfig['descr']))
592
								$pconfig['descr'] = $a_user[$userid]['name'];
593
							?>
594
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
595
							<td width="78%" class="vtable">
596
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
597
							</td>
598
						</tr>
599
					</table>
600

    
601
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="import">
602
						<tr>
603
							<td colspan="2" class="list" height="12"></td>
604
						</tr>
605
						<tr>
606
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Import Certificate");?></td>
607
						</tr>
608

    
609
						<tr>
610
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate data");?></td>
611
							<td width="78%" class="vtable">
612
								<textarea name="cert" id="cert" cols="65" rows="7" class="formfld_cert"><?=htmlspecialchars($pconfig['cert']);?></textarea>
613
								<br>
614
									<?=gettext("Paste a certificate in X.509 PEM format here.");?></td>
615
							</td>
616
						</tr>
617
						<tr>
618
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Private key data");?></td>
619
							<td width="78%" class="vtable">
620
								<textarea name="key" id="key" cols="65" rows="7" class="formfld_cert"><?=htmlspecialchars($pconfig['key']);?></textarea>
621
								<br>
622
								<?=gettext("Paste a private key in X.509 PEM format here.");?></td>
623
							</td>
624
						</tr>
625
					</table>
626

    
627
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal">
628
						<tr>
629
							<td colspan="2" class="list" height="12"></td>
630
						</tr>
631
						<tr>
632
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Internal Certificate");?></td>
633
						</tr>
634

    
635
						<?php if (!$internal_ca_count): ?>
636

    
637
						<tr>
638
							<td colspan="2" align="center" class="vtable">
639
								<?=gettext("No internal Certificate Authorities have been defined. You must");?>
640
								<a href="system_camanager.php?act=new&method=internal"><?=gettext("create");?></a>
641
								<?=gettext("an internal CA before creating an internal certificate.");?>
642
							</td>
643
						</tr>
644

    
645
						<?php else: ?>
646

    
647
						<tr>
648
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate authority");?></td>
649
							<td width="78%" class="vtable">
650
								<select name='caref' id='caref' class="formselect" onChange='internalca_change()'>
651
								<?php
652
									foreach( $a_ca as $ca):
653
									if (!$ca['prv'])
654
										continue;
655
									$selected = "";
656
									if ($pconfig['caref'] == $ca['refid'])
657
										$selected = "selected";
658
								?>
659
									<option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['descr'];?></option>
660
								<?php endforeach; ?>
661
								</select>
662
							</td>
663
						</tr>
664
						<tr>
665
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td>
666
							<td width="78%" class="vtable">
667
								<select name='keylen' class="formselect">
668
								<?php
669
									foreach( $cert_keylens as $len):
670
									$selected = "";
671
									if ($pconfig['keylen'] == $len)
672
										$selected = "selected";
673
								?>
674
									<option value="<?=$len;?>"<?=$selected;?>><?=$len;?></option>
675
								<?php endforeach; ?>
676
								</select>
677
								<?=gettext("bits");?>
678
							</td>
679
						</tr>
680
						<tr>
681
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate Type");?></td>
682
							<td width="78%" class="vtable">
683
								<select name='type' class="formselect">
684
								<?php
685
									foreach( $cert_types as $ct => $ctdesc ):
686
									$selected = "";
687
									if ($pconfig['type'] == $ct)
688
										$selected = "selected";
689
								?>
690
									<option value="<?=$ct;?>"<?=$selected;?>><?=$ctdesc;?></option>
691
								<?php endforeach; ?>
692
								</select>
693
								<br/>
694
								<?=gettext("Type of certificate to generate. Used for placing restrictions on the usage of the generated certificate.");?>
695
							</td>
696
						</tr>
697
						<tr>
698
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td>
699
							<td width="78%" class="vtable">
700
								<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>"/>
701
								<?=gettext("days");?>
702
							</td>
703
						</tr>
704
						<tr>
705
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Distinguished name");?></td>
706
							<td width="78%" class="vtable">
707
								<table border="0" cellspacing="0" cellpadding="2">
708
									<tr>
709
										<td align="right"><?=gettext("Country Code");?> : &nbsp;</td>
710
										<td align="left">
711
											<input name="dn_country" type="text" class="formfld unknown" maxlength="2" size="2" value="<?=htmlspecialchars($pconfig['dn_country']);?>"/>
712
										</td>
713
									</tr>
714
									<tr>
715
										<td align="right"><?=gettext("State or Province");?> : &nbsp;</td>
716
										<td align="left">
717
											<input name="dn_state" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_state']);?>"/>
718
										</td>
719
									</tr>
720
									<tr>
721
										<td align="right"><?=gettext("City");?> : &nbsp;</td>
722
										<td align="left">
723
											<input name="dn_city" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_city']);?>"/>
724
										</td>
725
									</tr>
726
									<tr>
727
										<td align="right"><?=gettext("Organization");?> : &nbsp;</td>
728
										<td align="left">
729
											<input name="dn_organization" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_organization']);?>"/>
730
										</td>
731
									</tr>
732
									<tr>
733
										<td align="right"><?=gettext("Email Address");?> : &nbsp;</td>
734
										<td align="left">
735
											<input name="dn_email" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['dn_email']);?>"/>
736
											&nbsp;
737
											<em>ex:</em>
738
											&nbsp;
739
											<?=gettext("webadmin@mycompany.com");?>
740
										</td>
741
									</tr>
742
									<tr>
743
										<td align="right"><?=gettext("Common Name");?> : &nbsp;</td>
744
										<td align="left">
745
											<?php
746
											if ($a_user && empty($pconfig['dn_commonname']))
747
												$pconfig['dn_commonname'] = $a_user[$userid]['name'];
748
											?>
749
											<input name="dn_commonname" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['dn_commonname']);?>"/>
750
											&nbsp;
751
											<em>ex:</em>
752
											&nbsp;
753
											<?=gettext("www.example.com");?>
754
										</td>
755
									</tr>
756
									<tr>
757
										<td align="right"><?=gettext("Alternative Names");?> : &nbsp;</td>
758
										<td align="left">
759
											<table id="altNametable">
760
											<thead>
761
											<tr>
762
												<th><div id="onecolumn"><?=gettext("Type");?></div></th>
763
												<th><div id="twocolumn"><?=gettext("Value");?></div></th>
764
											</tr>
765
											</thead>
766
											<tbody>
767
											<?php
768
												$counter = 0;
769
												if($pconfig['altnames']['item']):
770
												foreach($pconfig['altnames']['item'] as $item):
771
													$type = $item['type'];
772
													$value = $item['value'];
773
											?>
774
											<tr>
775
												<td>
776
												<input autocomplete="off" name="altname_type<?php echo $counter; ?>" type="text" class="formfld unknown" id="altname_type<?php echo $counter; ?>" size="20" value="<?=htmlspecialchars($value);?>" />
777
												</td>
778
												<td>
779
												<input autocomplete="off" name="altname_value<?php echo $counter; ?>" type="text" class="formfld unknown" id="altname_value<?php echo $counter; ?>" size="20" value="<?=htmlspecialchars($value);?>" />
780
												</td>
781
												<td>
782
												<a onclick="removeRow(this); return false;" href="#"><img border="0" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" alt="" title="<?=gettext("remove this entry"); ?>" /></a>
783
												</td>
784
											</tr>
785
											<?php
786
													$counter++;
787
												endforeach;
788
												endif;
789
											?>
790
											</tbody>
791
											</table>
792
											<a onclick="javascript:addRowTo('altNametable', 'formfldalias'); return false;" href="#">
793
												<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry");?>" />
794
											</a>
795
											<script type="text/javascript">
796
												field_counter_js = 3;
797
												rows = 1;
798
												totalrows = <?php echo $counter; ?>;
799
												loaded = <?php echo $counter; ?>;
800
											</script>
801
											<br/>NOTE: Type must be one of DNS (FQDN or Hostname), IP (IP address), URI, or email.
802
										</td>
803
									</tr>
804
								</table>
805
							</td>
806
						</tr>
807

    
808
					<?php endif; ?>
809

    
810
					</table>
811

    
812
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="external">
813
						<tr>
814
							<td colspan="2" class="list" height="12"></td>
815
						</tr>
816
						<tr>
817
							<td colspan="2" valign="top" class="listtopic"><?=gettext("External Signing Request");?></td>
818
						</tr>
819
						<tr>
820
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td>
821
							<td width="78%" class="vtable">
822
								<select name='csr_keylen' class="formselect">
823
								<?php
824
									if (!isset($pconfig['keylen']) && isset($pconfig['csr_keylen']))
825
										$pconfig['keylen'] = $pconfig['csr_keylen'];
826
									foreach( $cert_keylens as $len):
827
									$selected = "";
828
									if ($pconfig['keylen'] == $len)
829
										$selected = "selected";
830
								?>
831
									<option value="<?=$len;?>"<?=$selected;?>><?=$len;?></option>
832
								<?php endforeach; ?>
833
								</select>
834
								bits
835
							</td>
836
						</tr>
837
						<tr>
838
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Distinguished name");?></td>
839
							<td width="78%" class="vtable">
840
								<table border="0" cellspacing="0" cellpadding="2">
841
									<tr>
842
										<td align="right"><?=gettext("Country Code");?> : &nbsp;</td>
843
										<td align="left">
844
											<select name='csr_dn_country' class="formselect">
845
											<?php
846
											foreach( $dn_cc as $cc){
847
												$selected = "";
848
												if ($pconfig['csr_dn_country'] == $cc) $selected = "selected";
849
												print "<option value=\"$cc\" $selected>$cc</option>";
850
												}
851
											?>
852
											</select>
853
										</td>
854
									</tr>
855
									<tr>
856
										<td align="right"><?=gettext("State or Province");?> : &nbsp;</td>
857
										<td align="left">
858
											<input name="csr_dn_state" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['csr_dn_state']);?>" />
859
											&nbsp;
860
											<em>ex:</em>
861
											&nbsp;
862
											<?=gettext("Texas");?>
863
										</td>
864
									</tr>
865
									<tr>
866
										<td align="right"><?=gettext("City");?> : &nbsp;</td>
867
										<td align="left">
868
											<input name="csr_dn_city" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['csr_dn_city']);?>" />
869
											&nbsp;
870
											<em>ex:</em>
871
											&nbsp;
872
											<?=gettext("Austin");?>
873
										</td>
874
									</tr>
875
									<tr>
876
										<td align="right"><?=gettext("Organization");?> : &nbsp;</td>
877
										<td align="left">
878
											<input name="csr_dn_organization" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['csr_dn_organization']);?>" />
879
											&nbsp;
880
											<em>ex:</em>
881
											&nbsp;
882
											<?=gettext("My Company Inc.");?>
883
										</td>
884
									</tr>
885
									<tr>
886
										<td align="right"><?=gettext("Email Address");?> : &nbsp;</td>
887
										<td align="left">
888
											<input name="csr_dn_email" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['csr_dn_email']);?>"/>
889
											&nbsp;
890
											<em>ex:</em>
891
											&nbsp;
892
											<?=gettext("webadmin@mycompany.com");?>
893
										</td>
894
									</tr>
895
									<tr>
896
										<td align="right"><?=gettext("Common Name");?> : &nbsp;</td>
897
										<td align="left">
898
											<input name="csr_dn_commonname" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['csr_dn_commonname']);?>"/>
899
											&nbsp;
900
											<em>ex:</em>
901
											&nbsp;
902
											<?=gettext("www.example.com");?>
903
										</td>
904
									</tr>
905
								</table>
906
							</td>
907
						</tr>
908
					</table>
909

    
910
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="existing">
911
						<tr>
912
							<td colspan="2" class="list" height="12"></td>
913
						</tr>
914
						<tr>
915
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Choose an Existing Certificate");?></td>
916
						</tr>
917
						<tr>
918
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Existing Certificates");?></td>
919
							<td width="78%" class="vtable">
920
								<?php if (isset($userid) && $a_user): ?>
921
								<input name="userid" type="hidden" value="<?=$userid;?>" />
922
								<?php endif;?>
923
								<select name='certref' class="formselect">
924
								<?php
925
									foreach ($config['cert'] as $cert):
926
										$selected = "";
927
										$caname = "";
928
										$inuse = "";
929
										$revoked = "";
930
										if (in_array($cert['refid'], $config['system']['user'][$userid]['cert']))
931
											continue;
932
										$ca = lookup_ca($cert['caref']);
933
										if ($ca)
934
											$caname = " (CA: {$ca['descr']})";
935
										if ($pconfig['certref'] == $cert['refid'])
936
											$selected = "selected";
937
										if (cert_in_use($cert['refid']))
938
											$inuse = " *In Use";
939
											if (is_cert_revoked($cert))
940
											$revoked = " *Revoked";
941
								?>
942
									<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'] . $caname . $inuse . $revoked;?></option>
943
								<?php endforeach; ?>
944
								</select>
945
							</td>
946
						</tr>
947
					</table>
948

    
949
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
950
						<tr>
951
							<td width="22%" valign="top">&nbsp;</td>
952
							<td width="78%">
953
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
954
								<?php if (isset($id) && $a_cert[$id]): ?>
955
								<input name="id" type="hidden" value="<?=$id;?>" />
956
								<?php endif;?>
957
							</td>
958
						</tr>
959
					</table>
960
				</form>
961

    
962
				<?php elseif ($act == "csr" || (($_POST['save'] == gettext("Update")) && $input_errors)):?>
963

    
964
				<form action="system_certmanager.php" method="post" name="iform" id="iform">
965
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
966
						<tr>
967
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
968
							<td width="78%" class="vtable">
969
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
970
							</td>
971
						</tr>
972
						<tr>
973
							<td colspan="2" class="list" height="12"></td>
974
						</tr>
975
						<tr>
976
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Complete Signing Request");?></td>
977
						</tr>
978

    
979
						<tr>
980
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Signing Request data");?></td>
981
							<td width="78%" class="vtable">
982
								<textarea name="csr" id="csr" cols="65" rows="7" class="formfld_cert" readonly><?=htmlspecialchars($pconfig['csr']);?></textarea>
983
								<br>
984
								<?=gettext("Copy the certificate signing data from here and forward it to your certificate authority for signing.");?></td>
985
							</td>
986
						</tr>
987
						<tr>
988
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Final Certificate data");?></td>
989
							<td width="78%" class="vtable">
990
								<textarea name="cert" id="cert" cols="65" rows="7" class="formfld_cert"><?=htmlspecialchars($pconfig['cert']);?></textarea>
991
								<br>
992
								<?=gettext("Paste the certificate received from your certificate authority here.");?></td>
993
							</td>
994
						</tr>
995
						<tr>
996
							<td width="22%" valign="top">&nbsp;</td>
997
							<td width="78%">
998
								<?php /* if ( isset($subject_mismatch) && $subject_mismatch === true): ?>
999
								<input id="ignoresubjectmismatch" name="ignoresubjectmismatch" type="checkbox" class="formbtn" value="yes" />
1000
								<label for="ignoresubjectmismatch"><strong><?=gettext("Ignore certificate subject mismatch"); ?></strong></label><br />
1001
								<?php echo gettext("Warning: Using this option may create an " .
1002
								"invalid certificate.  Check this box to disable the request -> " .
1003
								"response subject verification. ");
1004
								?><br/>
1005
								<?php endif; */ ?>
1006
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Update");?>" />
1007
								<?php if (isset($id) && $a_cert[$id]): ?>
1008
								<input name="id" type="hidden" value="<?=$id;?>" />
1009
								<input name="act" type="hidden" value="csr" />
1010
								<?php endif;?>
1011
							</td>
1012
						</tr>
1013
					</table>
1014
				</form>
1015

    
1016
				<?php else:?>
1017

    
1018
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
1019
					<tr>
1020
						<td width="15%" class="listhdrr"><?=gettext("Name");?></td>
1021
						<td width="15%" class="listhdrr"><?=gettext("Issuer");?></td>
1022
						<td width="40%" class="listhdrr"><?=gettext("Distinguished Name");?></td>
1023
						<td width="10%" class="listhdrr"><?=gettext("In Use");?></td>
1024
						<td width="10%" class="list"></td>
1025
					</tr>
1026
					<?php
1027
						$i = 0;
1028
						foreach($a_cert as $cert):
1029
							$name = htmlspecialchars($cert['descr']);
1030
							
1031
							if ($cert['crt']) {
1032
								$subj = cert_get_subject($cert['crt']);
1033
								$issuer = cert_get_issuer($cert['crt']);
1034
								$purpose = cert_get_purpose($cert['crt']);
1035
								if($subj==$issuer)
1036
								  $caname = "<em>" . gettext("self-signed") . "</em>";
1037
								else
1038
							    $caname = "<em>" . gettext("external"). "</em>";
1039
							  $subj = htmlspecialchars($subj);
1040
							}
1041

    
1042
							if ($cert['csr']) {
1043
								$subj = htmlspecialchars(csr_get_subject($cert['csr']));
1044
								$caname = "<em>" . gettext("external - signature pending") . "</em>";
1045
							}
1046

    
1047
							$ca = lookup_ca($cert['caref']);
1048
							if ($ca)
1049
								$caname = $ca['descr'];
1050

    
1051
							if($cert['prv'])
1052
								$certimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
1053
							else
1054
								$certimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
1055
					?>
1056
					<tr>
1057
						<td class="listlr">
1058
							<table border="0" cellpadding="0" cellspacing="0">
1059
								<tr>
1060
									<td align="left" valign="center">
1061
										<img src="<?=$certimg;?>" alt="CA" title="CA" border="0" height="16" width="16" />
1062
									</td>
1063
									<td align="left" valign="middle">
1064
										<?=$name;?>
1065
									</td>
1066
								</tr>
1067
								<tr><td>&nbsp;</td></tr>
1068
								<?php if ($cert['type']): ?>
1069
								<tr><td colspan="2"><em><?php echo $cert_types[$cert['type']]; ?></em></td></tr>
1070
								<?php endif; ?>
1071
								<?php if (is_array($purpose)): ?>
1072
								<tr><td colspan="2">
1073
									CA: <?php echo $purpose['ca']; ?>,
1074
									Server: <?php echo $purpose['server']; ?>
1075
								</td></tr>
1076
								<?php endif; ?>
1077
							</table>
1078
						</td>
1079
						<td class="listr"><?=$caname;?>&nbsp;</td>
1080
						<td class="listr"><?=$subj;?>&nbsp;</td>
1081
						<td class="listr">
1082
							<?php if (is_cert_revoked($cert)): ?>
1083
							<b>Revoked</b><br/>
1084
							<?php endif; ?>
1085
							<?php if (is_webgui_cert($cert['refid'])): ?>
1086
							webConfigurator<br/>
1087
							<?php endif; ?>
1088
							<?php if (is_user_cert($cert['refid'])): ?>
1089
							User Cert<br/>
1090
							<?php endif; ?>
1091
							<?php if (is_openvpn_server_cert($cert['refid'])): ?>
1092
							OpenVPN Server<br/>
1093
							<?php endif; ?>
1094
							<?php if (is_openvpn_client_cert($cert['refid'])): ?>
1095
							OpenVPN Client<br/>
1096
							<?php endif; ?>
1097
							<?php if (is_ipsec_cert($cert['refid'])): ?>
1098
							IPsec Tunnel<br/>
1099
							<?php endif; ?>
1100
						</td>
1101
						<td valign="middle" nowrap class="list">
1102
							<a href="system_certmanager.php?act=exp&id=<?=$i;?>">
1103
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export cert");?>" alt="<?=gettext("export ca");?>" width="17" height="17" border="0" />
1104
							</a>
1105
							<a href="system_certmanager.php?act=key&id=<?=$i;?>">
1106
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export key");?>" alt="<?=gettext("export ca");?>" width="17" height="17" border="0" />
1107
							</a>
1108
							<a href="system_certmanager.php?act=p12&id=<?=$i;?>">
1109
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export cert+key in .p12");?>" alt="<?=gettext("export cert+key in .p12");?>" width="17" height="17" border="0" />
1110
							</a>
1111
							<?php	if (!cert_in_use($cert['refid'])): ?>
1112
							<a href="system_certmanager.php?act=del&id=<?=$i;?>" onClick="return confirm('<?=gettext("Do you really want to delete this Certificate?");?>')">
1113
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete cert");?>" alt="<?=gettext("delete cert");?>" width="17" height="17" border="0" />
1114
							</a>
1115
							<?php	endif; ?>
1116
							<?php	if ($cert['csr']): ?>
1117
							&nbsp;
1118
								<a href="system_certmanager.php?act=csr&id=<?=$i;?>">
1119
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("update csr");?>" alt="<?=gettext("update csr");?>" width="17" height="17" border="0" />
1120
							</a>
1121
							<?php	endif; ?>
1122
						</td>
1123
					</tr>
1124
					<?php
1125
							$i++;
1126
						endforeach;
1127
					?>
1128
					<tr>
1129
						<td class="list" colspan="4"></td>
1130
						<td class="list">
1131
							<a href="system_certmanager.php?act=new">
1132
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add or import ca");?>" alt="<?=gettext("add ca");?>" width="17" height="17" border="0" />
1133
							</a>
1134
						</td>
1135
					</tr>
1136
					<tr>
1137
						<td>&nbsp;</td>
1138
						<td colspan="3"><?=gettext("Note: You can only delete a certificate if it is not currently in use.");?></td>
1139
					</tr>
1140
				</table>
1141

    
1142
				<?php endif; ?>
1143

    
1144
			</div>
1145
		</td>
1146
	</tr>
1147
</table>
1148
<?php include("fend.inc");?>
1149
<script type="text/javascript">
1150
<!--
1151

    
1152
method_change();
1153
internalca_change();
1154

    
1155
//-->
1156
</script>
1157

    
1158
</body>
(204-204/247)