summaryrefslogtreecommitdiff
path: root/paramiko/pkey.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2022-05-20 15:10:22 -0400
committerJeff Forcier <jeff@bitprophet.org>2022-05-20 15:10:22 -0400
commitddba5762c9c0878b83fb6a7344ad24ba74af5720 (patch)
tree934dd0038e572bd4a40f75a705f0d0811f76e0c9 /paramiko/pkey.py
parent1150ed2912343cfcd83684a4515422ea06a759b1 (diff)
parent2ea2ed5430b2f5da7b6116ca336ff3c8bc99cc0e (diff)
downloadparamiko-ddba5762c9c0878b83fb6a7344ad24ba74af5720.tar.gz
Merge branch '2.9' into 2.10
Diffstat (limited to 'paramiko/pkey.py')
-rw-r--r--paramiko/pkey.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index f1919660..aa8fa669 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -324,6 +324,8 @@ class PKey(object):
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