[PYTHON-CRYPTO] m2crypto-0.13 problem

Robert Penz robert.penz at OUTERTECH.COM
Wed Nov 17 14:20:45 CET 2004


Ng Pheng Siong writes:

>> SystemError: error return without exception set
>
> This isn't right. Do I understand correctly that, according to the your
> input testmail.eml, this shouldn't throw an error?

the testmail.eml works if I use the smime_load_pkcs7() function. it loads it
directly from the given file. But I don't want to save my smime content to a
file and check it than. so I looked at a way to use a stream. I found the
smime_load_pkcs7_bio() function. This means I normally get a stream, and
don't need to use open("../daten/testmail.eml","rb".read())) and than call
the smime_load_pkcs7_bio(BIO.MemoryBuffer(..)) stuff.

I just used that to show you that there is an error in your code, as its the
same input file, which works in smime_load_pkcs7().

ps: both code examples are used in following howto
http://sandbox.rulemaker.net/ngps/m2/howto.smime.html. so I assume it worked
at some point.

> Or is it the case that the first chunk of code - smime_load_pkcs7_bio() -
> is wrong and the second chunk - smime_load_pkcs7() - is the correct way

no the first code is ok. I've it from the above example.

> do ... whatever it is that you're doing? (I've been away from the S/MIME
> code for quite a while and can't tell off-hand the purpose of the code,
> sorry.)

I hat a look at both functions. the smime_load_pkcs7() uses an c function to
create an BIO object and the smime_load_pkcs7_bio uses the given one. but
than the code is the same.

so I believe there is an error in the code.



More information about the python-crypto mailing list