@@ -113,14 +113,14 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function verify(string $token) |
115 | 115 | { |
116 | - $parameters = "id=" . $this->id . "&otp=" . $token; |
|
116 | + $parameters = "id=".$this->id."&otp=".$token; |
|
117 | 117 | // Generate signature |
118 | 118 | if ($this->key !== "") { |
119 | 119 | $signature = base64_encode(hash_hmac('sha1', $parameters, $this->key, true)); |
120 | - $parameters .= '&h=' . $signature; |
|
120 | + $parameters .= '&h='.$signature; |
|
121 | 121 | } |
122 | 122 | // Support https |
123 | - $url = "https://api.yubico.com/wsapi/verify?" . $parameters; |
|
123 | + $url = "https://api.yubico.com/wsapi/verify?".$parameters; |
|
124 | 124 | |
125 | 125 | /** @var string $responseMsg */ |
126 | 126 | $responseMsg = \SimpleSAML\Utils\HTTP::fetch($url); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $response[$row[0]] = (isset($row[1])) ? $row[1] : ""; |
144 | 144 | } |
145 | 145 | |
146 | - $check = 'status=' . $response['status'] . '&t=' . $response['t']; |
|
146 | + $check = 'status='.$response['status'].'&t='.$response['t']; |
|
147 | 147 | $checksignature = base64_encode(hash_hmac('sha1', $check, $this->key, true)); |
148 | 148 | |
149 | 149 | if ($response['h'] != $checksignature) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | if ($status != 'OK') { |
155 | - throw new Exception('Status was not OK: ' . $status); |
|
155 | + throw new Exception('Status was not OK: '.$status); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return true; |