Fix regression with key whitespace

Port #22115 into 2015.8.

Closes #27750
This commit is contained in:
Mike Place 2015-10-15 08:44:33 -06:00
parent bd9d1ed8b5
commit 12c6bf4358

View File

@ -218,7 +218,7 @@ class AESReqServerMixin(object):
elif os.path.isfile(pubfn):
# The key has been accepted, check it
if salt.utils.fopen(pubfn, 'r').read() != load['pub']:
if salt.utils.fopen(pubfn, 'r').read().strip() != load['pub'].strip():
log.error(
'Authentication attempt from {id} failed, the public '
'keys did not match. This may be an attempt to compromise '