[Planetlab-devel] key convert error?

Barış Metin Talip-Baris.Metin at sophia.inria.fr
Tue Jul 13 17:06:07 EDT 2010


Hi Josh,

Looks like a bug in the version of M2Crypto you have. I could
reproduce it on Fedora 8. The package on Fedora 12 doesn't have the
issue.

I have prepared a quick fix as a workaround (see below). I guess we'll
need to depend on a newer version of M2Crypto.


--- /usr/lib/python2.5/site-packages/M2Crypto/RSA.py	2010-07-13
23:01:20.000000000 +0200
+++ RSA.py.new	2010-07-13 23:01:16.000000000 +0200
@@ -226,7 +226,12 @@

     save_key = RSA.save_pub_key

-    save_key_bio = RSA.save_pub_key_bio
+    def save_key_bio(self, bio, *args, **kw):
+        """
+        Save public key to BIO.
+        """
+        return self.save_pub_key_bio(bio)
+

     #save_key_der = RSA.save_pub_key_der



On Tue, Jul 13, 2010 at 8:04 PM, Josh Karlin <jkarlin at bbn.com> wrote:
>  Hi all,
>
> It looks like the key converter was switched to a python script in trunk
> recently.  I'm getting the following issue on a fresh install of SFA trunk
> when I run sfa-import-plc.py:
>
> Hierarchy: creating authority: plc
> Hierarchy: creating authority: plc.gpo4
> Importing site: plc.gpo4.gpolab14
> importing site gpolab14
> Hierarchy: creating authority: plc.gpo4.gpolab14
> Traceback (most recent call last):
>  File "/usr/bin/keyconvert.py", line 101, in <module>
>    convert(fin, fout)
>  File "/usr/bin/keyconvert.py", line 82, in convert
>    rsa.save_pem(fout)
>  File "/usr/lib/python2.5/site-packages/M2Crypto/RSA.py", line 110, in
> save_key
>    return self.save_key_bio(bio, cipher, callback)
> TypeError: save_pub_key_bio() takes exactly 2 arguments (4 given)
> Traceback (most recent call last):
>  File "usr/lib/python2.5/site-packages/sfa/trust/certificate.py", line 55,
> in convert_public_key
>  File "usr/lib/python2.5/site-packages/sfa/trust/certificate.py", line 123,
> in load_pubkey_from_file
>  File "/usr/lib/python2.5/site-packages/M2Crypto/RSA.py", line 344, in
> load_pub_key
>    return load_pub_key_bio(bio)
>  File "/usr/lib/python2.5/site-packages/M2Crypto/RSA.py", line 360, in
> load_pub_key_bio
>    rsa_error()
>  File "/usr/lib/python2.5/site-packages/M2Crypto/RSA.py", line 240, in
> rsa_error
>    raise RSAError, m2.err_reason_error_string(m2.err_get_error())
> RSAError: no start line
>
> Any ideas?  Thanks!
>
> Josh
>
> _______________________________________________
> Devel mailing list
> Devel at lists.planet-lab.org
> https://lists.planet-lab.org/mailman/listinfo/devel
>



-- 
Baris



More information about the Devel mailing list