1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-27 04:32:18 +01:00

Merge pull request #1083 from dmach/fix/ssh-auth-unset-pass

Fix crash when 'pass' is not set in the config file
This commit is contained in:
Daniel Mach 2022-07-26 21:27:44 +02:00 committed by GitHub
commit 6a77c4e01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,6 +166,9 @@ class ObfuscatedConfigFileCredentialsManager(
@classmethod
def decode_password(cls, password):
if password is None:
# avoid crash on encoding None when 'pass' is not specified in the config
return None
compressed_pw = base64.b64decode(password.encode("ascii"))
return bz2.decompress(compressed_pw).decode("ascii")