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
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
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
No files found.
src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php
View file @
e1859231
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
...
...
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