mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 22:56:15 +01:00
Merge pull request #1048 from adrianschroeter/ssh_fix
ssh key authentification fixes
This commit is contained in:
commit
2a1faddc08
@ -573,7 +573,13 @@ def _build_opener(apiurl):
|
||||
if not os.path.isfile(keyfile_path):
|
||||
return False
|
||||
with open(keyfile_path, "r") as f:
|
||||
line = f.readline(100).strip()
|
||||
try:
|
||||
line = f.readline(100).strip()
|
||||
except UnicodeDecodeError:
|
||||
# skip binary files
|
||||
return False
|
||||
if line == "-----BEGIN RSA PRIVATE KEY-----":
|
||||
return True
|
||||
if line == "-----BEGIN OPENSSH PRIVATE KEY-----":
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user