get_profile() - handle new OpenSSH DSA key format

OpenSSH changed the format of the DSA key, and this broke Sugar
connection to Jabber.

Fixes https://github.com/sugarlabs/sugar/issues/814

Fixes http://bugs.sugarlabs.org/ticket/4992
This commit is contained in:
James Cameron 2019-01-01 16:04:54 +11:00
parent 87fcfb62e4
commit 39b7e606df

View File

@ -115,10 +115,12 @@ class Profile(object):
end_found = False
for l in lines:
l = l.strip()
if l.startswith('-----BEGIN DSA PRIVATE KEY-----'):
if l.startswith(['-----BEGIN DSA PRIVATE KEY-----',
'-----BEGIN OPENSSH PRIVATE KEY-----']):
begin_found = True
continue
if l.startswith('-----END DSA PRIVATE KEY-----'):
if l.startswith(['-----END DSA PRIVATE KEY-----',
'-----END OPENSSH PRIVATE KEY-----']):
end_found = True
continue
key += l