Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-sip
Commits
f0d81570
Commit
f0d81570
authored
Apr 19, 2017
by
okhin
Browse files
Reverting hashing tokens … they're already hashed by the JWT process anyway
parent
fc031ca7
Pipeline
#950
passed with stage
in 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
piphone.py
View file @
f0d81570
...
...
@@ -12,7 +12,6 @@ import configparser
import
argparse
import
os.path
import
sys
import
hashlib
from
operator
import
itemgetter
import
jwt
...
...
@@ -496,7 +495,7 @@ def login_admin(user, password):
if
user
is
None
:
# user does not exist
return
False
if
hashlib
.
sha256
(
password
.
encode
()).
hexdigest
()
!=
user
[
1
]:
if
password
.
encode
!=
user
[
1
]:
# password does not match
return
False
if
user
[
2
]
==
0
:
...
...
@@ -520,7 +519,7 @@ def little_admin():
def
medium_admin
():
db
=
sqlite3
.
connect
(
config
[
'piphone'
][
'db'
])
api
=
request
.
forms
.
get
(
'api'
)
token
=
hashlib
.
sha256
(
request
.
forms
.
get
(
'api_token'
)
.
encode
()).
hexdigest
()
token
=
request
.
forms
.
get
(
'api_token'
)
admin
=
request
.
forms
.
get
(
'admin'
)
action
=
request
.
forms
.
get
(
'action'
)
pattern
=
request
.
forms
.
get
(
'pattern'
)
...
...
Write
Preview
Supports
Markdown
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