Ensure key is bytes not string

This commit is contained in:
Daniel A. Wozniak 2024-05-31 14:33:52 -07:00 committed by Daniel Wozniak
parent 389aac9663
commit a10aa05f41

View file

@ -213,7 +213,9 @@ class ReqServerChannel:
log.error("AES key not found")
return {"error": "AES key not found"}
pret = {}
pret["key"] = pub.encrypt(key, encryption_algorithm)
pret["key"] = pub.encrypt(
salt.utils.stringutils.to_bytes(key), encryption_algorithm
)
if ret is False:
ret = {}
if sign_messages: