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
e1859231
Commit
e1859231
authored
May 15, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mvc: style sweep
parent
78b5def3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
6 deletions
+5
-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
InterfaceField.php
...vc/app/models/OPNsense/Base/FieldTypes/InterfaceField.php
+0
-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 @
e1859231
...
...
@@ -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'
]);
...
...
src/opnsense/mvc/app/library/OPNsense/Auth/LocalTOTP.php
View file @
e1859231
...
...
@@ -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
)
|
...
...
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/InterfaceField.php
View file @
e1859231
...
...
@@ -162,7 +162,6 @@ class InterfaceField extends BaseField
$allInterfaces
[
$interface
]
=
$interfaceNode
;
}
}
}
// collect this items options
...
...
src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AutoNumberFieldTest.php
View file @
e1859231
...
...
@@ -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
}
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