pycryptodome adds RSA to the key header which the openssl

PEM decoder does not recognise
This commit is contained in:
Thomas S Hatch 2017-04-03 16:02:04 -06:00
parent 206dec63ff
commit 60113248b1

View File

@ -134,6 +134,7 @@ class RSAX931Verifier(object):
:param str pubdata: The RSA public key in PEM format
'''
pubdata = salt.utils.to_bytes(pubdata, 'ascii')
pubdata = pubdata.replace('RSA ', '')
self._bio = libcrypto.BIO_new_mem_buf(pubdata, len(pubdata))
self._rsa = c_void_p(libcrypto.RSA_new())
if not libcrypto.PEM_read_bio_RSA_PUBKEY(self._bio, pointer(self._rsa), None, None):