mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
use salt encoding for joyent on 2017.7
This commit is contained in:
parent
488457c5a0
commit
e90ca7a114
1 changed files with 3 additions and 3 deletions
|
@ -1071,10 +1071,10 @@ def query(action=None,
|
|||
timenow = datetime.datetime.utcnow()
|
||||
timestamp = timenow.strftime('%a, %d %b %Y %H:%M:%S %Z').strip()
|
||||
with salt.utils.fopen(ssh_keyfile, 'r') as kh_:
|
||||
rsa_key = RSA.importKey(kh_)
|
||||
rsa_key = RSA.importKey(kh_.read())
|
||||
rsa_ = PKCS1_v1_5.new(rsa_key)
|
||||
hash_ = SHA256.new()
|
||||
hash_.update(timestamp)
|
||||
hash_.update(timestamp.encode(__salt_system_encoding__))
|
||||
signed = base64.b64encode(rsa_.sign(hash_))
|
||||
keyid = '/{0}/keys/{1}'.format(user.split('/')[0], ssh_keyname)
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ def query(action=None,
|
|||
'Date': timestamp,
|
||||
'Authorization': 'Signature keyId="{0}",algorithm="rsa-sha256" {1}'.format(
|
||||
keyid,
|
||||
signed
|
||||
signed.decode(__salt_system_encoding__)
|
||||
),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue