Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
paramiko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
paramiko
Commits
c39cd6de5d76
Commit
c39cd6de5d76
authored
3 years ago
by
Jeff Forcier
Browse files
Options
Downloads
Plain Diff
Merge branch '2.10' into 2.11
parents
d2377c53a0dc
b88f6a59b849
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
paramiko/pkey.py
+2
-0
2 additions, 0 deletions
paramiko/pkey.py
sites/www/changelog.rst
+4
-0
4 additions, 0 deletions
sites/www/changelog.rst
tests/blank_rsa.key
+0
-0
0 additions, 0 deletions
tests/blank_rsa.key
tests/test_pkey.py
+5
-0
5 additions, 0 deletions
tests/test_pkey.py
with
11 additions
and
0 deletions
paramiko/pkey.py
+
2
−
0
View file @
c39cd6de
...
...
@@ -324,6 +324,8 @@
def
_read_private_key
(
self
,
tag
,
f
,
password
=
None
):
lines
=
f
.
readlines
()
if
not
lines
:
raise
SSHException
(
"
no lines in {} private key file
"
.
format
(
tag
))
# find the BEGIN tag
start
=
0
...
...
This diff is collapsed.
Click to expand it.
sites/www/changelog.rst
+
4
−
0
View file @
c39cd6de
...
...
@@ -2,6 +2,10 @@
Changelog
=========
- bug:`1637` (via :issue:`1599`) Raise `SSHException` explicitly when blank
private key data is loaded, instead of the natural result of ``IndexError``.
This should help more bits of Paramiko or Paramiko-adjacent codebases to
correctly handle this class of error. Credit: Nicholas Dietz.
- :release:`2.11.0 <2022-05-16>`
- :release:`2.10.5 <2022-05-16>`
- :release:`2.9.5 <2022-05-16>`
...
...
This diff is collapsed.
Click to expand it.
tests/blank_rsa.key
0 → 100644
+
0
−
0
View file @
c39cd6de
This diff is collapsed.
Click to expand it.
tests/test_pkey.py
+
5
−
0
View file @
c39cd6de
...
...
@@ -186,6 +186,11 @@
with
pytest
.
raises
(
SSHException
,
match
=
str
(
exception
)):
RSAKey
.
from_private_key_file
(
_support
(
"
test_rsa.key
"
))
def
test_loading_empty_keys_errors_usefully
(
self
):
# #1599 - raise SSHException instead of IndexError
with
pytest
.
raises
(
SSHException
,
match
=
"
no lines
"
):
RSAKey
.
from_private_key_file
(
_support
(
"
blank_rsa.key
"
))
def
test_load_rsa_password
(
self
):
key
=
RSAKey
.
from_private_key_file
(
_support
(
"
test_rsa_password.key
"
),
"
television
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment