Commit 4224556f authored by Franco Fichtner's avatar Franco Fichtner

src: style sweep

parent 44c26e6d
......@@ -271,7 +271,7 @@ class SettingsController extends ApiControllerBase
$result['rows'] = $this->listInstallableRules();
// sort by description
usort($result['rows'], function ($item1, $item2) {
return strcmp(strtolower($item1['description']), strtolower($item2['description']));
return strcmp(strtolower($item1['description']), strtolower($item2['description']));
});
$result['rowCount'] = count($result['rows']);
$result['total'] = count($result['rows']);
......
......@@ -85,7 +85,7 @@ class LocalTOTP extends Local
$start = -1 * $this->graceperiod;
}
$now = time();
for ($count = $start ; $count <= $this->graceperiod ; $count += $step) {
for ($count = $start; $count <= $this->graceperiod; $count += $step) {
$result[] = $now + $count;
if ($this->graceperiod == 0) {
// special case, we expect the clocks to match 100%, so step and target are both 0
......@@ -104,10 +104,10 @@ class LocalTOTP extends Local
{
// calculate binary 8 character time for provided window
$binary_time = pack("N", (int)($moment/$this->timeWindow));
$binary_time = str_pad($binary_time,8, chr(0), STR_PAD_LEFT);
$binary_time = str_pad($binary_time, 8, chr(0), STR_PAD_LEFT);
// Generate the hash using the SHA1 algorithm
$hash = hash_hmac ('sha1', $binary_time, $secret, true);
$hash = hash_hmac('sha1', $binary_time, $secret, true);
$offset = ord($hash[19]) & 0xf;
$otp = (
((ord($hash[$offset+0]) & 0x7f) << 24 ) |
......
......@@ -10,4 +10,4 @@
<type>test</type>
</authserver>
</system>
</opnsense>
\ No newline at end of file
</opnsense>
......@@ -133,4 +133,4 @@ class AutoNumberFieldTest extends Field_Framework_TestCase
$field->setValue("0");
$this->assertContains('MinMaxValidator', $this->validate($field));
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment