mirror of
https://github.com/certbot/certbot.git
synced 2026-03-27 12:53:05 -04: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:
parent
b8a814a13f
commit
6d64bab45e
1 changed files with 3 additions and 1 deletions
|
|
@ -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"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue