Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
84c96a21
Commit
84c96a21
authored
Mar 30, 2009
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted test to ZEO.hash
parent
fbde9b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/ZEO/tests/auth_plaintext.py
src/ZEO/tests/auth_plaintext.py
+3
-3
No files found.
src/ZEO/tests/auth_plaintext.py
View file @
84c96a21
...
@@ -19,14 +19,14 @@ This mechanism offers *no network security at all*; the only security
...
@@ -19,14 +19,14 @@ This mechanism offers *no network security at all*; the only security
is provided by not storing plaintext passwords on disk.
is provided by not storing plaintext passwords on disk.
"""
"""
import
sha
from
ZEO.hash
import
sha1
from
ZEO.StorageServer
import
ZEOStorage
from
ZEO.StorageServer
import
ZEOStorage
from
ZEO.auth
import
register_module
from
ZEO.auth
import
register_module
from
ZEO.auth.base
import
Client
,
Database
from
ZEO.auth.base
import
Client
,
Database
def
session_key
(
username
,
realm
,
password
):
def
session_key
(
username
,
realm
,
password
):
return
sha
.
new
(
"%s:%s:%s"
%
(
username
,
realm
,
password
)).
hexdigest
()
return
sha
1
(
"%s:%s:%s"
%
(
username
,
realm
,
password
)).
hexdigest
()
class
StorageClass
(
ZEOStorage
):
class
StorageClass
(
ZEOStorage
):
...
@@ -36,7 +36,7 @@ class StorageClass(ZEOStorage):
...
@@ -36,7 +36,7 @@ class StorageClass(ZEOStorage):
except
LookupError
:
except
LookupError
:
return
0
return
0
password_dig
=
sha
.
new
(
password
).
hexdigest
()
password_dig
=
sha
1
(
password
).
hexdigest
()
if
dbpw
==
password_dig
:
if
dbpw
==
password_dig
:
self
.
connection
.
setSessionKey
(
session_key
(
username
,
self
.
connection
.
setSessionKey
(
session_key
(
username
,
self
.
database
.
realm
,
self
.
database
.
realm
,
...
...
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