|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
5
|
|
|
* To change this template file, choose Tools | Templates |
|
6
|
|
|
* and open the template in the editor. |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace devices\ms; |
|
10
|
|
|
|
|
11
|
|
|
class MsTlsProfile extends MsEapProfile |
|
12
|
|
|
{ |
|
13
|
|
|
const MS_TLS_NS = 'http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1'; |
|
14
|
|
|
|
|
15
|
|
|
public function __construct() { |
|
16
|
|
|
$this->type = \core\common\EAP::TLS; |
|
17
|
|
|
$this->authorId = 0; |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
public function getConfig() |
|
21
|
|
|
{ |
|
22
|
|
|
$element = new \core\DeviceXMLmain(); |
|
23
|
|
|
$element->setChild('Eap', $this->getTlsEap(), self::MS_BASEEAPCONN_NS); |
|
24
|
|
|
return($element); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
private function getTlsEap() |
|
28
|
|
|
{ |
|
29
|
|
|
$element = new \core\DeviceXMLmain(); |
|
30
|
|
|
$element->setChild('Type', $this->type); |
|
31
|
|
|
$element->setChild('EapType', $this->getTlsEapType(), self::MS_TLS_NS); |
|
32
|
|
|
return($element); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
private function getTlsEapType() |
|
36
|
|
|
{ |
|
37
|
|
|
$element = new \core\DeviceXMLmain(); |
|
38
|
|
|
$element->setChild('CredentialsSource', $this->getCredentialSource()); |
|
39
|
|
|
$element->setChild('ServerValidation', $this->getTlsServerValidation()); |
|
40
|
|
|
$element->setChild('DifferentUsername', $this->otherTlsName); |
|
41
|
|
|
$element->setChild('EnableQuarantineChecks', $this->nea); |
|
42
|
|
|
return($element); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
private function getCredentialSource() |
|
46
|
|
|
{ |
|
47
|
|
|
$element = new \core\DeviceXMLmain(); |
|
48
|
|
|
$element->setChild('CertificateStore',''); |
|
49
|
|
|
return($element); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
private function getTlsServerValidation() |
|
53
|
|
|
{ |
|
54
|
|
|
$element = new \core\DeviceXMLmain(); |
|
55
|
|
|
$element->setChild('DisableUserPromptForServerValidation', 'true'); |
|
56
|
|
|
$element->setChild('ServerNames', $this->serverNames); |
|
57
|
|
|
foreach ($this->caList as $ca) { |
|
58
|
|
|
$element->setChild('TrustedRootCA', $ca['sha1']); |
|
59
|
|
|
} |
|
60
|
|
|
return($element); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|