@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | $reqAuthenticator = random_bytes(16); |
| 89 | 89 | $packetIdentifier = random_bytes(1); |
| 90 | 90 | // construct Status-Server packet |
| 91 | - $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER . |
|
| 92 | - $packetIdentifier . |
|
| 93 | - RFC5997Tests::PACKET_LENGTH . |
|
| 94 | - $reqAuthenticator . |
|
| 95 | - RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER . |
|
| 96 | - RFC5997Tests::LENGTH_NAS_IDENTIFIER . |
|
| 91 | + $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER. |
|
| 92 | + $packetIdentifier. |
|
| 93 | + RFC5997Tests::PACKET_LENGTH. |
|
| 94 | + $reqAuthenticator. |
|
| 95 | + RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER. |
|
| 96 | + RFC5997Tests::LENGTH_NAS_IDENTIFIER. |
|
| 97 | 97 | RFC5997Tests::VALUE_NAS_IDENTIFIER; |
| 98 | - $sigPacket = $prePacket . |
|
| 99 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
| 100 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
| 98 | + $sigPacket = $prePacket. |
|
| 99 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
| 100 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
| 101 | 101 | "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0"; |
| 102 | - $authPacket = $prePacket . |
|
| 103 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
| 104 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
| 102 | + $authPacket = $prePacket. |
|
| 103 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
| 104 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
| 105 | 105 | hash_hmac("md5", $sigPacket, $this->secret, TRUE); |
| 106 | 106 | $connectErrorNumber = 0; |
| 107 | 107 | $connectErrorString = ""; |
| 108 | - $netHandle = fsockopen("udp://" . $this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
| 108 | + $netHandle = fsockopen("udp://".$this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
| 109 | 109 | if ($netHandle === FALSE) { |
| 110 | 110 | throw new Exception("Unable to establish UDP socket resource. Error number was $connectErrorNumber, '$connectErrorString'"); |
| 111 | 111 | } |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | return AbstractTest::RETVAL_INVALID; |
| 124 | 124 | } |
| 125 | 125 | // check the response authenticator to prevent spoofing. |
| 126 | - $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT . |
|
| 127 | - $packetIdentifier . |
|
| 128 | - $read[2] . $read[3] . |
|
| 129 | - $reqAuthenticator . |
|
| 130 | - substr($read, 20) . |
|
| 126 | + $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT. |
|
| 127 | + $packetIdentifier. |
|
| 128 | + $read[2].$read[3]. |
|
| 129 | + $reqAuthenticator. |
|
| 130 | + substr($read, 20). |
|
| 131 | 131 | $this->secret; |
| 132 | 132 | $expected = hash("md5", $sigResponse, TRUE); |
| 133 | 133 | if ($expected != substr($read, 4, 16)) { |