check private key syntax
This commit is contained in:
parent
0a4ea3ec9a
commit
b64930b2eb
@ -105,14 +105,18 @@ class Profile(object):
|
||||
return None
|
||||
|
||||
key = ""
|
||||
begin_found = False
|
||||
end_found = False
|
||||
for l in lines:
|
||||
l = l.strip()
|
||||
if l.startswith("-----BEGIN DSA PRIVATE KEY-----"):
|
||||
begin_found = True
|
||||
continue
|
||||
if l.startswith("-----END DSA PRIVATE KEY-----"):
|
||||
end_found = True
|
||||
continue
|
||||
key += l
|
||||
if not len(key):
|
||||
if not (len(key) and begin_found and end_found):
|
||||
logging.error("Error parsing public key.")
|
||||
return None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user