diff options
Diffstat (limited to 'pipermail/pycrypto/2010q2/000246.html')
-rw-r--r-- | pipermail/pycrypto/2010q2/000246.html | 318 |
1 files changed, 318 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2010q2/000246.html b/pipermail/pycrypto/2010q2/000246.html new file mode 100644 index 0000000..7932bf2 --- /dev/null +++ b/pipermail/pycrypto/2010q2/000246.html @@ -0,0 +1,318 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] _fastmath None !! + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20_fastmath%20None%20%21%21&In-Reply-To=630225.6817.qm%40web114216.mail.gq1.yahoo.com"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000245.html"> + <LINK REL="Next" HREF="000247.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] _fastmath None !!</H1> + <B>Lorenz Quack</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20_fastmath%20None%20%21%21&In-Reply-To=630225.6817.qm%40web114216.mail.gq1.yahoo.com" + TITLE="[pycrypto] _fastmath None !!">don at amberfisharts.com + </A><BR> + <I>Wed May 19 07:50:51 CST 2010</I> + <P><UL> + <LI>Previous message: <A HREF="000245.html">[pycrypto] _fastmath None !! +</A></li> + <LI>Next message: <A HREF="000247.html">[pycrypto] SHA-224, SHA-384 and SHA-512 Implementations +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#246">[ date ]</a> + <a href="thread.html#246">[ thread ]</a> + <a href="subject.html#246">[ subject ]</a> + <a href="author.html#246">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Hi, + +the code looks fine too me. +I also ran it and had no problems. Even when generating the keys on my 32-bit Netbook and loading them on my 64-bit +desktop I couldn't reproduce the problem (both with and without gmp installed). However both use pycrypto 2.1.0. + +Without being able to reproduce the problem I'm afraid I won't be able to help you. Sorry. + +cheers and good luck +//Lorenz + + + +On 05/19/2010 06:17 AM, jd wrote: +><i> Ok... here is attached program. +</I>><i> +</I>><i> The problem seems to be +</I>><i> a. Either package specific (pycrypto package installed using easy_install and/or from rpm as dependency from paramiko.) +</I>><i> I use virtual env, and when I install pycrypto using easy_install, the _fastmath.so is not present in the egg. +</I>><i> +</I>><i> b. serialization of keys in to file. +</I>><i> +</I>><i> Basically, if u run the attached program it works on all my test machines. +</I>><i> If you create the keys and save them on one machine, and try to read them (comment the key generation, saving part), then it does not work on some machines. +</I>><i> +</I>><i> I am using picke and base64, to my knowledge both should work across m/c architecture (32bit, 64bit) and different python versions. Or I am mistaken ? +</I>><i> +</I>><i> One observation is that the keys generated and saved on a 32 bit machines are running in to the problem when read on a 64 bit machine. But if I generate it on a 64 bit machine.. it seems to work on a 32 bit machine. +</I>><i> +</I>><i> NOTE: This is just one variable... the machines have different python version, different linux distro..etc. +</I>><i> +</I>><i> Thanks in advance. +</I>><i> +</I>><i> /Jd +</I>><i> p.s. I am going to switch serialization and see if that helps. +</I>><i> +</I>><i> --- On Tue, 5/18/10, Lorenz Quack<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">don at amberfisharts.com</A>> wrote: +</I>><i> +</I>>><i> From: Lorenz Quack<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">don at amberfisharts.com</A>> +</I>>><i> Subject: Re: [pycrypto] _fastmath None !! +</I>>><i> To: "PyCrypto discussion list"<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto at lists.dlitz.net</A>> +</I>>><i> Date: Tuesday, May 18, 2010, 3:20 AM +</I>>><i> Hi +</I>>><i> +</I>>><i> On 05/18/2010 08:19 AM, jd wrote: +</I>>>><i> +</I>>>><i> Hi Lorenz, +</I>>>><i> Thanks for quick response. +</I>>>><i> +</I>>>><i> It is happening on someone else's machine, I have +</I>>><i> requested them to check and send me details. +</I>>>><i> +</I>>>><i> In the mean time I looked that the code. +</I>>>><i> In RSA.py +</I>>>><i> +</I>>>><i> try: +</I>>>><i> from Crypto.PublicKey import +</I>>><i> _fastmath +</I>>>><i> except ImportError: +</I>>>><i> _fastmath = None +</I>>>><i> +</I>>>><i> +</I>>>><i> Could this be problem ? +</I>>><i> +</I>>><i> I don't think so. That should happen when PyCrypto was +</I>>><i> compiled without gmp support. +</I>>><i> According to my analysis the relevant parts are the +</I>>><i> __setstate__ method in the class _RSAobj +</I>>><i> and the __init__ in the class RSAImplementation. +</I>>><i> In the __init__ the attribute _math is set which is later +</I>>><i> being accessed by both the construct +</I>>><i> method and in the _RSAobj.__setstate__ method. +</I>>><i> The way the _math attribute is set seems pretty safe to me +</I>>><i> so I believe things must be going +</I>>><i> astray somewhere else. But it's hard to tell without any +</I>>><i> code. +</I>>><i> +</I>>><i> cheers +</I>>><i> //Lorenz +</I>>><i> +</I>>><i> +</I>>>><i> Thanks +</I>>>><i> /Jd +</I>>>><i> +</I>>>><i> +</I>>>><i> --- On Mon, 5/17/10, Lorenz Quack<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">don at amberfisharts.com</A>> +</I>>><i> wrote: +</I>>>><i> +</I>>>>><i> From: Lorenz Quack<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">don at amberfisharts.com</A>> +</I>>>>><i> Subject: Re: [pycrypto] _fastmath None !! +</I>>>>><i> To: "PyCrypto discussion list"<<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto at lists.dlitz.net</A>> +</I>>>>><i> Date: Monday, May 17, 2010, 8:40 AM +</I>>>>><i> Hi again, +</I>>>>><i> +</I>>>>><i> no idea what's going wrong. normally pycrypto +</I>>><i> should fall +</I>>>>><i> back to _slowmath (a pure python implementation) +</I>>><i> when gmp is +</I>>>>><i> +</I>>>>><i> not installed meaning _fastmath is not available +</I>>><i> (_fastmath +</I>>>>><i> is a C implementation using gmp). +</I>>>>><i> +</I>>>>><i> Maybe you could prvide some more information, like +</I>>><i> python +</I>>>>><i> version, pycrypto version, is gmp installed? +</I>>>>><i> Also it would be a good idea to provide a +</I>>>>><i> small/minimalistic example demonstrating the +</I>>><i> problem. +</I>>>>><i> That way it is easyier to figure out if it's a bug +</I>>><i> in +</I>>>>><i> pycrypto or in your code. +</I>>>>><i> +</I>>>>><i> cheers, +</I>>>>><i> //Lorenz +</I>>>>><i> +</I>>>>><i> +</I>>>>><i> +</I>>>>><i> On 05/17/2010 04:48 PM, jd wrote: +</I>>>>>><i> Hi Guys +</I>>>>>><i> I am serializing +</I>>><i> the pycrypto keys +</I>>>>><i> using pickle.. as suggested in one of recent +</I>>><i> posts. It is +</I>>>>><i> working fine, but giving following problem on +</I>>><i> cenos 5.1. +</I>>>>><i> (stack at the bottom of email) +</I>>>>>><i> +</I>>>>>><i> 'NoneType' object has no attribute +</I>>><i> 'rsa_construct' +</I>>>>>><i> +</I>>>>>><i> +</I>>>>>><i> I looked at the +</I>>><i> code.. it seems +</I>>>>><i> while constructing _fastmath is used. Any +</I>>><i> workarounds / +</I>>>>><i> fixes ? I do not think changing to saving tuple +</I>>><i> would help +</I>>>>><i> as it would also need to use __setstate__.. +</I>>>>>><i> +</I>>>>>><i> Help is greatly appreciated. +</I>>>>>><i> Thanks +</I>>>>>><i> /Jd +</I>>>>>><i> +</I>>>>>><i> File "/tg2env/bin/paster", line 7, in ? +</I>>>>>><i> sys.exit( +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", +</I>>>>><i> line 84, in run +</I>>>>>><i> invoke(command, +</I>>><i> command_name, +</I>>>>><i> options, args[1:]) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", +</I>>>>><i> line 123, in invoke +</I>>>>>><i> exit_code = +</I>>><i> runner.run(args) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/command.py", +</I>>>>><i> line 218, in run +</I>>>>>><i> result = +</I>>><i> self.command() +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/serve.py", +</I>>>>><i> line 276, in command +</I>>>>>><i> relative_to=base, +</I>>>>><i> global_conf=vars) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteScript-1.7.3-py2.4.egg/paste/script/serve.py", +</I>>>>><i> line 311, in loadapp +</I>>>>>><i> return loadapp( +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", +</I>>>>><i> line 204, in loadapp +</I>>>>>><i> return loadobj(APP, +</I>>><i> uri, +</I>>>>><i> name=name, **kw) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", +</I>>>>><i> line 225, in loadobj +</I>>>>>><i> return +</I>>><i> context.create() +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", +</I>>>>><i> line 625, in create +</I>>>>>><i> return +</I>>>>><i> self.object_type.invoke(self) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/loadwsgi.py", +</I>>>>><i> line 110, in invoke +</I>>>>>><i> return +</I>>><i> fix_call(context.object, +</I>>>>><i> context.global_conf, **context.local_conf) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/tg2env/lib/python2.4/site-packages/PasteDeploy-1.3.3-py2.4.egg/paste/deploy/util/fixtypeerror.py", +</I>>>>><i> line 57, in fix_call +</I>>>>>><i> val = +</I>>><i> callable(*args, **kw) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/m2svn/trunk/src/app/web/app/app/config/middleware.py", +</I>>>>><i> line 46, in make_app +</I>>>>>><i> if +</I>>><i> verify_license(): +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/m2svn/trunk/src/app/web/app/app/core/utils/utils.py", +</I>>><i> line +</I>>>>><i> 2221, in verify_license +</I>>>>>><i> l_info = +</I>>>>><i> read_license_using_embeded(license_file) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/m2svn/trunk/src/app/web/app/app/core/utils/utils.py", +</I>>><i> line +</I>>>>><i> 2202, in read_license_using_embeded +</I>>>>>><i> pub_key +</I>>><i> =get_embeded_key() +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "/m2svn/trunk/src/app/web/app/app/core/utils/utils.py", +</I>>><i> line +</I>>>>><i> 2197, in get_embeded_key +</I>>>>>><i> key = +</I>>><i> pickle.loads(str) +</I>>>>>><i> File +</I>>><i> "/usr/lib64/python2.4/pickle.py", +</I>>>>><i> line 1394, in loads +</I>>>>>><i> return +</I>>><i> Unpickler(file).load() +</I>>>>>><i> File +</I>>><i> "/usr/lib64/python2.4/pickle.py", +</I>>>>><i> line 872, in load +</I>>>>>><i> +</I>>><i> dispatch[key](self) +</I>>>>>><i> File +</I>>><i> "/usr/lib64/python2.4/pickle.py", +</I>>>>><i> line 1237, in load_build +</I>>>>>><i> setstate(state) +</I>>>>>><i> File +</I>>>>><i> +</I>>><i> "build/bdist.linux-x86_64/egg/Crypto/PublicKey/RSA.py", +</I>>><i> line +</I>>>>><i> 171, in __setstate__ +</I>>>>>><i> AttributeError: 'NoneType' object has no +</I>>><i> attribute +</I>>>>><i> 'rsa_construct' +</I>>>>>><i> +</I> +</PRE> + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000245.html">[pycrypto] _fastmath None !! +</A></li> + <LI>Next message: <A HREF="000247.html">[pycrypto] SHA-224, SHA-384 and SHA-512 Implementations +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#246">[ date ]</a> + <a href="thread.html#246">[ thread ]</a> + <a href="subject.html#246">[ subject ]</a> + <a href="author.html#246">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto +mailing list</a><br> +</body></html> |