check_key segfault

Paul Washburn <[email protected]> Fri, 10 Apr 2009 09:49:26 -0600
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
--000e0cd150b62deece0467354f1f
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello all,

Using nearly the same code as the test_x509_public_encrypt unit test in
tests/test_rsa.py, and the recipient.pem from the same folder, I get a
segfault when calling check_key() on the RSA object returned by
x509.get_pubkey().get_rsa(). The test code to reproduce is as follows:

from M2Crypto import X509, RSA

x509 = X509.load_cert("certs/recipient.pem")
rsa = x509.get_pubkey().get_rsa()
rsa.save_pub_key('certs/pubkey.pem')
print "key saved"
rsa.check_key()
print "checked"
rsa.public_encrypt("data", RSA.pkcs1_padding)
print "encrypted"

Which produces the following:

key saved
Segmentation fault

I'm using the python-m2crypto package, version 0.18.2-2, from the Ubuntu
repos, along with openssl version 0.9.8g-10.1ubuntu2.2

Any help would be greatly appreciated!

-- 
Paul
[email protected]

--000e0cd150b62deece0467354f1f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,<br><br>Using nearly the same code as the test_x509_public_encryp=
t unit test in tests/test_rsa.py, and the recipient.pem from the same folde=
r, I get a segfault when calling check_key() on the RSA object returned by =
x509.get_pubkey().get_rsa(). The test code to reproduce is as follows:<br>
<br>from M2Crypto import X509, RSA<br><br>x509 =3D X509.load_cert(&quot;cer=
ts/recipient.pem&quot;)<br>rsa =3D x509.get_pubkey().get_rsa()<br>rsa.save_=
pub_key(&#39;certs/pubkey.pem&#39;)<br>print &quot;key saved&quot;<br>rsa.c=
heck_key()<br>
print &quot;checked&quot;<br>rsa.public_encrypt(&quot;data&quot;, RSA.pkcs1=
_padding)<br>print &quot;encrypted&quot;<br><br>Which produces the followin=
g:<br><br>key saved<br>Segmentation fault<br><br>I&#39;m using the python-m=
2crypto package, version 0.18.2-2, from the Ubuntu repos, along with openss=
l version 0.9.8g-10.1ubuntu2.2<br>
<br>Any help would be greatly appreciated!<br clear=3D"all"><br>-- <br>Paul=
<br><a href=3D"mailto:[email protected]">[email protected]</a> <br>

--000e0cd150b62deece0467354f1f--