From robert.penz at OUTERTECH.COM Thu Nov 11 10:30:45 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Thu, 11 Nov 2004 10:30:45 +0100 Subject: [PYTHON-CRYPTO] M2Crypto: SystemError: error return without exception set Message-ID: Hi! I get following error if I try to decode a smime file. but there is no exception if I use no smime file. it just encodes it. ..... p7, data = SMIME.smime_load_pkcs7("../daten/daten.smime") File "/usr/lib/python2.3/site-packages/M2Crypto/SMIME.py", line 82, in smime_load_pkcs7 p7_ptr, bio_ptr = m2.smime_read_pkcs7(bio) SystemError: error return without exception set you can find the file at http://robert.private.outertech.com/daten.smime From robert.penz at OUTERTECH.COM Wed Nov 17 11:47:48 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Wed, 17 Nov 2004 11:47:48 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem Message-ID: Hi! I've following problem with m2crypto-0.13. p7, data = SMIME.smime_load_pkcs7_bio(BIO.MemoryBuffer(open("../daten/testmail.eml", "rb").read())) returns File "/usr/lib/python2.3/site-packages/M2Crypto/SMIME.py", line 93, in smime_load_pkcs7_bio p7_ptr, bio_ptr = m2.smime_read_pkcs7(p7_bio._ptr()) SystemError: error return without exception set but p7, data = SMIME.smime_load_pkcs7("../daten/testmail.eml") works. -- Regards, Robert ---------- Robert Penz robert dot penz at outertech dot com From ngps at NETMEMETIC.COM Wed Nov 17 13:43:35 2004 From: ngps at NETMEMETIC.COM (Ng Pheng Siong) Date: Wed, 17 Nov 2004 20:43:35 +0800 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: References: Message-ID: <20041117124335.GA832@vista.netmemetic.com> On Wed, Nov 17, 2004 at 11:47:48AM +0100, Robert Penz wrote: > I've following problem with m2crypto-0.13. > > p7, data = > SMIME.smime_load_pkcs7_bio(BIO.MemoryBuffer(open("../daten/testmail.eml", > "rb").read())) > > returns > > File "/usr/lib/python2.3/site-packages/M2Crypto/SMIME.py", line 93, in > smime_load_pkcs7_bio > p7_ptr, bio_ptr = m2.smime_read_pkcs7(p7_bio._ptr()) > SystemError: error return without exception set > > but > > p7, data = SMIME.smime_load_pkcs7("../daten/testmail.eml") > > works. Hi, I've, uh, been unbusy. In fact, I've been enjoying a long holiday weekend. ;-) > 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? 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 to 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.) Cheers. -- Ng Pheng Siong http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption From robert.penz at OUTERTECH.COM Wed Nov 17 14:20:45 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Wed, 17 Nov 2004 14:20:45 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem Message-ID: 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. From ngps at NETMEMETIC.COM Wed Nov 17 14:54:52 2004 From: ngps at NETMEMETIC.COM (Ng Pheng Siong) Date: Wed, 17 Nov 2004 21:54:52 +0800 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: References: Message-ID: <20041117135452.GA1029@vista.netmemetic.com> On Wed, Nov 17, 2004 at 02:20:45PM +0100, Robert Penz wrote: > 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. > [...] > 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. Ah, now I understand. Yes, the code in the howto worked when I wrote it. > 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 something has changed that breaks this... What OS, Python, and OpenSSL versions are you using? Thanks. Cheers. -- Ng Pheng Siong http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption From robert.penz at OUTERTECH.COM Wed Nov 17 15:09:40 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Wed, 17 Nov 2004 15:09:40 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: <20041117135452.GA1029@vista.netmemetic.com> References: <20041117135452.GA1029@vista.netmemetic.com> Message-ID: Ng Pheng Siong writes: > So something has changed that breaks this... What OS, Python, and OpenSSL > versions are you using? suse 9.1 python 2.3.3 OpenSSL 0.9.7d 17 Mar 2004 ps: you should my used methode as check to the test code From m.bizzarri at ICUBE.IT Wed Nov 17 16:53:06 2004 From: m.bizzarri at ICUBE.IT (Marco Bizzarri) Date: Wed, 17 Nov 2004 16:53:06 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: References: <20041117135452.GA1029@vista.netmemetic.com> Message-ID: <419B73E2.5090103@icube.it> Robert Penz wrote: > Ng Pheng Siong writes: > >> So something has changed that breaks this... What OS, Python, and OpenSSL >> versions are you using? > > > suse 9.1 > python 2.3.3 > OpenSSL 0.9.7d 17 Mar 2004 > > ps: you should my used methode as check to the test code Perhaps I'm completely out of the problem, but I suspect it could be a problem in the format of the file... could it be that it is in der rather than in pem format? IIRC, we had a similiar problem, and we create an ad hoc method to resolve the problem... Regards Marco From robert.penz at OUTERTECH.COM Wed Nov 17 17:00:47 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Wed, 17 Nov 2004 17:00:47 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem Message-ID: Marco Bizzarri writes: > Perhaps I'm completely out of the problem, but I suspect it could be a > problem in the format of the file... could it be that it is in der > rather than in pem format? > > IIRC, we had a similiar problem, and we create an ad hoc method to > resolve the problem... but how explains that that it works in the non_bio version but not in the bio version of the function? From m.bizzarri at ICUBE.IT Wed Nov 17 17:44:35 2004 From: m.bizzarri at ICUBE.IT (Marco Bizzarri) Date: Wed, 17 Nov 2004 17:44:35 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: References: Message-ID: <419B7FF3.6000704@icube.it> Robert Penz wrote: > Marco Bizzarri writes: > >> Perhaps I'm completely out of the problem, but I suspect it could be a >> problem in the format of the file... could it be that it is in der >> rather than in pem format? >> >> IIRC, we had a similiar problem, and we create an ad hoc method to >> resolve the problem... > > > but how explains that that it works in the non_bio version but not in the > bio version of the function? My only suggestions is that in the non_bio version it does: m2.bio_new_file(p7file, 'r') while you do open('filename', 'rb') I don't know if it makes any difference, however... Regards Marco From robert.penz at OUTERTECH.COM Wed Nov 17 19:30:22 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Wed, 17 Nov 2004 19:30:22 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem Message-ID: <200411171930.33092.robert.penz@outertech.com> On Wednesday 17 November 2004 17:44, Marco Bizzarri wrote: > My only suggestions is that in the non_bio version it does: > > m2.bio_new_file(p7file, 'r') > > while you do > > open('filename', 'rb') 1. I did also try only r 2. its all base64 encoded so it makes no difference -- Regards, Robert ---------- Robert Penz robert dot penz at outertech dot com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From ngps at NETMEMETIC.COM Thu Nov 18 00:02:06 2004 From: ngps at NETMEMETIC.COM (Ng Pheng Siong) Date: Thu, 18 Nov 2004 07:02:06 +0800 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: References: Message-ID: <20041117230206.GA583@vista.netmemetic.com> On Wed, Nov 17, 2004 at 11:47:48AM +0100, Robert Penz wrote: > p7, data = SMIME.smime_load_pkcs7("../daten/testmail.eml") Am I correct that this file 'testmail.eml' is not the same as this one? http://robert.private.outertech.com/daten.smime If yes, please send me testmail.eml. Thanks. -- Ng Pheng Siong http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption From robert.penz at OUTERTECH.COM Fri Nov 19 08:27:51 2004 From: robert.penz at OUTERTECH.COM (Robert Penz) Date: Fri, 19 Nov 2004 08:27:51 +0100 Subject: [PYTHON-CRYPTO] m2crypto-0.13 problem In-Reply-To: <20041117230206.GA583@vista.netmemetic.com> References: <20041117230206.GA583@vista.netmemetic.com> Message-ID: Ng Pheng Siong writes: > On Wed, Nov 17, 2004 at 11:47:48AM +0100, Robert Penz wrote: >> p7, data = SMIME.smime_load_pkcs7("../daten/testmail.eml") > Am I correct that this file 'testmail.eml' is not the same as this one? > http://robert.private.outertech.com/daten.smime > If yes, please send me testmail.eml. Thanks. no its not the same one. I've uploaded the file under http://robert.private.outertech.com/testmail.eml