mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
wow, but M2Crypto is annoying! - make a BIO for the public key
It turns out that M2Crypto.RSA.load_key_string() requires a keypair, not a public key. There is no M2Crypto.RSA.load_pub_key_string(), only M2Crypto.RSA.load_pub_key_bio(), which requires an OpenSSL BIO object.
This commit is contained in:
@@ -303,7 +303,9 @@ class session(object):
|
||||
chall.succeeded = (c["satisfied"] == "True") # TODO: this contradicts comment in protocol about meaning of "succeeded"
|
||||
# Calculate y
|
||||
dvsni_r = c["dvsni:r"]
|
||||
pubkey = M2Crypto.RSA.load_key_string(self.pubkey())
|
||||
bio = M2Crypto.BIO.MemoryBuffer()
|
||||
bio.write(self.pubkey())
|
||||
pubkey = M2Crypto.RSA.load_pub_key_bio(bio)
|
||||
y = pubkey.public_encrypt(dvsni_r, M2Crypto.RSA.pkcs1_oaep_padding)
|
||||
# In dvsni, we send nonce, y, ext
|
||||
chall.data.append(c["dvsni:nonce"])
|
||||
|
||||
Reference in New Issue
Block a user