Passed
Push — master ( 165379...1fb0a6 )
by Tim
03:54
created
libextinc/Yubico.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
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 123
         $url = "https://api.yubico.com/wsapi/verify?".$parameters;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Auth/Process/OTP2YubiPrefix.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         Assert::keyExists($state, 'Attributes');
64 64
         $attributes = $state['Attributes'];
65 65
 
66
-        Logger::debug('OTP2YubiPrefix: enter with attributes: ' . implode(',', array_keys($attributes)));
66
+        Logger::debug('OTP2YubiPrefix: enter with attributes: '.implode(',', array_keys($attributes)));
67 67
 
68 68
         $otps = $attributes['otp'];
69 69
         $otp = $otps['0'];
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
         $attributes['yubiPrefix'] = [$identity];
75 75
 
76 76
         Logger::info(
77
-            'OTP2YubiPrefix: otp: ' . $otp . ' identity: ' . $identity . ' (otp keys: '
78
-            . implode(',', array_keys($otps)) . ')'
77
+            'OTP2YubiPrefix: otp: '.$otp.' identity: '.$identity.' (otp keys: '
78
+            . implode(',', array_keys($otps)).')'
79 79
         );
80 80
 
81 81
         unset($attributes['otp']);
82 82
 
83
-        Logger::debug('OTP2YubiPrefix: leaving with attributes: ' . implode(',', array_keys($attributes)));
83
+        Logger::debug('OTP2YubiPrefix: leaving with attributes: '.implode(',', array_keys($attributes)));
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
lib/Auth/Source/YubiKey.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         /** @psalm-var \SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey|null $source */
146 146
         $source = Auth\Source::getById($state[self::AUTHID]);
147 147
         if ($source === null) {
148
-            throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]);
148
+            throw new Exception('Could not find authentication source with id '.$state[self::AUTHID]);
149 149
         }
150 150
 
151 151
         try {
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     protected function login(string $otp): array
202 202
     {
203
-        require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/libextinc/Yubico.php';
203
+        require_once dirname(dirname(dirname(dirname(__FILE__)))).'/libextinc/Yubico.php';
204 204
 
205 205
         $yubi = new \Auth_Yubico($this->yubi_id, $this->yubi_key);
206 206
         try {
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
             $attributes = ['uid' => [$uid]];
210 210
         } catch (Exception $e) {
211 211
             Logger::info(
212
-                'YubiKey:' . $this->authId . ': Validation error (otp ' . $otp . '), debug output: '
212
+                'YubiKey:'.$this->authId.': Validation error (otp '.$otp.'), debug output: '
213 213
                 . $yubi->getLastResponse()
214 214
             );
215 215
             throw new Error\Error('WRONGUSERPASS', $e);
216 216
         }
217 217
 
218 218
         Logger::info(
219
-            'YubiKey:' . $this->authId . ': YubiKey otp ' . $otp . ' validated successfully: '
219
+            'YubiKey:'.$this->authId.': YubiKey otp '.$otp.' validated successfully: '
220 220
             . $yubi->getLastResponse()
221 221
         );
222 222
         return $attributes;
Please login to merge, or discard this patch.