mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[macOS] fix kcpassword issue for passwords exactly 11 bytes long (#5305)
This commit is contained in:
committed by
GitHub
parent
e4da6b3499
commit
63cd495e98
@@ -18,7 +18,9 @@ def kcpassword(passwd):
|
|||||||
passwd = [ord(x) for x in list(passwd)]
|
passwd = [ord(x) for x in list(passwd)]
|
||||||
# pad passwd length out to an even multiple of key length
|
# pad passwd length out to an even multiple of key length
|
||||||
r = len(passwd) % key_len
|
r = len(passwd) % key_len
|
||||||
if (r > 0):
|
if len(passwd) == 11:
|
||||||
|
passwd += [0]
|
||||||
|
elif (r > 0):
|
||||||
passwd = passwd + [0] * (key_len - r)
|
passwd = passwd + [0] * (key_len - r)
|
||||||
|
|
||||||
for n in range(0, len(passwd), len(key)):
|
for n in range(0, len(passwd), len(key)):
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ function kcpasswordEncode {
|
|||||||
#get padding by subtraction if under 11
|
#get padding by subtraction if under 11
|
||||||
local r=$(( ${#thisStringHex_array[@]} % 11 ))
|
local r=$(( ${#thisStringHex_array[@]} % 11 ))
|
||||||
local padding=0
|
local padding=0
|
||||||
if [ $r -gt 0 ]; then
|
if [ ${#thisStringHex_array[@]} -eq 11 ];
|
||||||
|
local padding=1
|
||||||
|
elif [ $r -gt 0 ]; then
|
||||||
local padding=$(( 11 - $r ))
|
local padding=$(( 11 - $r ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user