Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
郑天保
webssh
Commits
704d2b68
Commit
704d2b68
authored
Sep 09, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check private key size for the final value
parent
8eb636d7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
handler.py
webssh/handler.py
+7
-5
No files found.
webssh/handler.py
View file @
704d2b68
...
@@ -90,16 +90,18 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
...
@@ -90,16 +90,18 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
def
get_privatekey
(
self
):
def
get_privatekey
(
self
):
name
=
'privatekey'
name
=
'privatekey'
lst
=
self
.
request
.
files
.
get
(
name
)
# multipart form
lst
=
self
.
request
.
files
.
get
(
name
)
# multipart form
if
not
lst
:
if
lst
:
return
self
.
get_argument
(
name
,
u''
)
# urlencoded form
else
:
self
.
filename
=
lst
[
0
][
'filename'
]
self
.
filename
=
lst
[
0
][
'filename'
]
data
=
lst
[
0
][
'body'
]
data
=
lst
[
0
][
'body'
]
if
len
(
data
)
>
KEY_MAX_SIZE
:
value
=
self
.
decode_argument
(
data
,
name
=
name
)
.
strip
()
else
:
value
=
self
.
get_argument
(
name
,
u''
)
# urlencoded form
if
len
(
value
)
>
KEY_MAX_SIZE
:
raise
InvalidValueError
(
raise
InvalidValueError
(
'Invalid private key: {}'
.
format
(
self
.
filename
)
'Invalid private key: {}'
.
format
(
self
.
filename
)
)
)
return
self
.
decode_argument
(
data
,
name
=
name
)
return
value
@classmethod
@classmethod
def
get_specific_pkey
(
cls
,
pkeycls
,
privatekey
,
password
):
def
get_specific_pkey
(
cls
,
pkeycls
,
privatekey
,
password
):
...
...
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