[macOS] fix kcpassword issue for passwords exactly 11 bytes long (#5305)

This commit is contained in:
Aleksandr Chebotov
2022-03-30 12:04:17 +02:00
committed by GitHub
parent e4da6b3499
commit 63cd495e98
2 changed files with 6 additions and 2 deletions

View File

@@ -18,7 +18,9 @@ def kcpassword(passwd):
passwd = [ord(x) for x in list(passwd)]
# pad passwd length out to an even multiple of key length
r = len(passwd) % key_len
if (r > 0):
if len(passwd) == 11:
passwd += [0]
elif (r > 0):
passwd = passwd + [0] * (key_len - r)
for n in range(0, len(passwd), len(key)):