[tahoe-dev] Fwd: help needed from a C++ expert for pycryptopp

Ruben Kerkhof ruben at rubenkerkhof.com
Tue Feb 10 21:08:47 UTC 2009


Hey Zooko,

I just tried this on a fedora rawhide machine, the first 2 test pass,  
but the third fails:

test_encrypt_zeroes (pycryptopp.test.test_aes.AES128) ... ok
test_encrypt_zeroes_in_two_parts (pycryptopp.test.test_aes.AES128) ...  
ok
test_init_type_check (pycryptopp.test.test_aes.AES128) ... terminate  
called after throwing an instance of 'CryptoPP::InvalidKeyLength'
   what():  AES/CTR: 1 is not a valid key length
/var/tmp/rpm-tmp.HrfKSX: line 27:  5818 Aborted                  
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions - 
fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic" /usr/ 
bin/python setup.py test
error: Bad exit status from /var/tmp/rpm-tmp.HrfKSX (%check)

It is linked against the system provided cryptopp (5.5.2)

Almost there...

Regards,

Ruben

On Feb 10, 2009, at 3:58 PM, zooko wrote:

> Folks:
>
> Hooray!  I posted a plea for help on the Crypto++ mailing list, and
> Geoff Beier responded by pointing out that the dlopen flags can be
> dynamically changed, from Python.  See appended message from him.
>
> Before committing this fix, I would like to have builders for
> pycryptopp which are red because of this issue.  I guess that means
> they have libcryptopp.so installed in the system, and the buildmaster
> configures them with --disable-embedded-cryptopp .
>
> Thanks a lot, Geoff Beier!
>
> Regards,
>
> Zooko
>
> Begin forwarded message:
>
>> From: Geoff Beier <geoffbeier at gmail.com>
>> Date: February 10, 2009 7:27:50 AM MST
>> To: zooko <zooko at zooko.com>
>> Cc: "Crypto++ Users" <cryptopp-users at googlegroups.com>
>> Subject: Re: help needed from a C++ expert for pycryptopp
>>
>> Changing test_aes.py to load crypto++ differently does the job on
>> my ubuntu amd64 machine. You can probably find a suitable place in
>> the python portion of your library to do this; I'm no python  
>> expert ;)
>>
>> Change:
>> from pycryptopp.cipher import aes
>>
>> to:
>> import sys, ctypes
>> flags = sys.getdlopenflags()
>> sys.setdlopenflags(flags|ctypes.RTLD_GLOBAL)
>> from pycryptopp.cipher import aes
>> sys.setdlopenflags(flags)
>>
>> and all the tests pass.
>>
>> HTH,
>>
>> Geoff
> _______________________________________________
> tahoe-dev mailing list
> tahoe-dev at allmydata.org
> http://allmydata.org/cgi-bin/mailman/listinfo/tahoe-dev




More information about the tahoe-dev mailing list