Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
216e8810
Commit
216e8810
authored
Jun 08, 2017
by
Andreas Valder
Browse files
shortened csrf protection strings from 128 chars to 64
parent
28e81389
Changes
1
Show whitespace changes
Inline
Side-by-side
server.py
View file @
216e8810
...
...
@@ -527,7 +527,7 @@ def login():
modify
(
'INSERT INTO users (name, realname, fsacc, level, calendar_key, rfc6238) VALUES (?, ?, ?, 1, "", "")'
,
user
,
session
[
'user'
][
'givenName'
],
user
)
dbuser
=
query
(
'SELECT * FROM users WHERE name = ?'
,
user
)
session
[
'user'
][
'dbid'
]
=
dbuser
[
0
][
'id'
]
session
[
'_csrf_token'
]
=
''
.
join
(
random
.
SystemRandom
().
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
range
(
128
))
session
[
'_csrf_token'
]
=
''
.
join
(
random
.
SystemRandom
().
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
range
(
64
))
session
.
permanent
=
True
return
redirect
(
request
.
values
.
get
(
'ref'
,
url_for
(
'index'
)))
...
...
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