Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
django-cas-server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Samir
django-cas-server
Commits
4721eb4f
Commit
4721eb4f
authored
Jul 31, 2016
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch base64 decode error on b64decode to raise our custom exception BadHash
parent
fbc977c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
cas_server/utils.py
cas_server/utils.py
+4
-1
No files found.
cas_server/utils.py
View file @
4721eb4f
...
...
@@ -561,7 +561,10 @@ class LdapHashUserPassword(object):
elif
scheme
==
b
'{CRYPT}'
:
return
b
'$'
.
join
(
hashed_passord
.
split
(
b
'$'
,
3
)[:
-
1
])[
len
(
scheme
):]
else
:
hashed_passord
=
base64
.
b64decode
(
hashed_passord
[
len
(
scheme
):])
try
:
hashed_passord
=
base64
.
b64decode
(
hashed_passord
[
len
(
scheme
):])
except
TypeError
as
error
:
raise
cls
.
BadHash
(
"Bad base64: %s"
%
error
)
if
len
(
hashed_passord
)
<
cls
.
_schemes_to_len
[
scheme
]:
raise
cls
.
BadHash
(
"Hash too short for the scheme %s"
%
scheme
)
return
hashed_passord
[
cls
.
_schemes_to_len
[
scheme
]:]
...
...
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