1
0
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:
Seth Schoen
2012-07-12 14:48:32 -07:00
parent b8a814a13f
commit 6d64bab45e

View File

@@ -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"])