Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
4224556f
Commit
4224556f
authored
May 16, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: style sweep
parent
44c26e6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
SettingsController.php
...c/app/controllers/OPNsense/IDS/Api/SettingsController.php
+1
-1
LocalTOTP.php
src/opnsense/mvc/app/library/OPNsense/Auth/LocalTOTP.php
+3
-3
config.xml
.../Base/FieldTypes/AuthenticationServerFieldTest/config.xml
+1
-1
AutoNumberFieldTest.php
...p/models/OPNsense/Base/FieldTypes/AutoNumberFieldTest.php
+1
-1
No files found.
src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php
View file @
4224556f
...
@@ -271,7 +271,7 @@ class SettingsController extends ApiControllerBase
...
@@ -271,7 +271,7 @@ class SettingsController extends ApiControllerBase
$result
[
'rows'
]
=
$this
->
listInstallableRules
();
$result
[
'rows'
]
=
$this
->
listInstallableRules
();
// sort by description
// sort by description
usort
(
$result
[
'rows'
],
function
(
$item1
,
$item2
)
{
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
[
'rowCount'
]
=
count
(
$result
[
'rows'
]);
$result
[
'total'
]
=
count
(
$result
[
'rows'
]);
$result
[
'total'
]
=
count
(
$result
[
'rows'
]);
...
...
src/opnsense/mvc/app/library/OPNsense/Auth/LocalTOTP.php
View file @
4224556f
...
@@ -85,7 +85,7 @@ class LocalTOTP extends Local
...
@@ -85,7 +85,7 @@ class LocalTOTP extends Local
$start
=
-
1
*
$this
->
graceperiod
;
$start
=
-
1
*
$this
->
graceperiod
;
}
}
$now
=
time
();
$now
=
time
();
for
(
$count
=
$start
;
$count
<=
$this
->
graceperiod
;
$count
+=
$step
)
{
for
(
$count
=
$start
;
$count
<=
$this
->
graceperiod
;
$count
+=
$step
)
{
$result
[]
=
$now
+
$count
;
$result
[]
=
$now
+
$count
;
if
(
$this
->
graceperiod
==
0
)
{
if
(
$this
->
graceperiod
==
0
)
{
// special case, we expect the clocks to match 100%, so step and target are both 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
...
@@ -104,10 +104,10 @@ class LocalTOTP extends Local
{
{
// calculate binary 8 character time for provided window
// calculate binary 8 character time for provided window
$binary_time
=
pack
(
"N"
,
(
int
)(
$moment
/
$this
->
timeWindow
));
$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
// 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
;
$offset
=
ord
(
$hash
[
19
])
&
0xf
;
$otp
=
(
$otp
=
(
((
ord
(
$hash
[
$offset
+
0
])
&
0x7f
)
<<
24
)
|
((
ord
(
$hash
[
$offset
+
0
])
&
0x7f
)
<<
24
)
|
...
...
src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AuthenticationServerFieldTest/config.xml
View file @
4224556f
...
@@ -10,4 +10,4 @@
...
@@ -10,4 +10,4 @@
<type>
test
</type>
<type>
test
</type>
</authserver>
</authserver>
</system>
</system>
</opnsense>
</opnsense>
\ No newline at end of file
src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AutoNumberFieldTest.php
View file @
4224556f
...
@@ -133,4 +133,4 @@ class AutoNumberFieldTest extends Field_Framework_TestCase
...
@@ -133,4 +133,4 @@ class AutoNumberFieldTest extends Field_Framework_TestCase
$field
->
setValue
(
"0"
);
$field
->
setValue
(
"0"
);
$this
->
assertContains
(
'MinMaxValidator'
,
$this
->
validate
(
$field
));
$this
->
assertContains
(
'MinMaxValidator'
,
$this
->
validate
(
$field
));
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment