~ubuntu-branches/ubuntu/saucy/m2crypto/saucy

« back to all changes in this revision

Viewing changes to tests/test_smime.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2010-07-09 11:17:57 UTC
  • Revision ID: james.westby@ubuntu.com-20100709111757-1ial0es7w4y3apwe
Tags: 0.20.1-1ubuntu3
* tests/test_smime.py: fix testsuite with newer openssl. (LP: #600549)
  - Backported from http://svn.osafoundation.org/viewvc/m2crypto/trunk/tests/test_smime.py?r1=698&r2=721

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        buf = BIO.MemoryBuffer(self.cleartext)
38
38
        s = SMIME.SMIME()
39
39
        s.load_key('tests/signer_key.pem', 'tests/signer.pem')
40
 
        p7 = s.sign(buf)
 
40
        p7 = s.sign(buf, SMIME.PKCS7_DETACHED)
41
41
        assert len(buf) == 0
42
42
        assert p7.type() == SMIME.PKCS7_SIGNED, p7.type()
43
43
        assert isinstance(p7, SMIME.PKCS7), p7
73
73
        
74
74
        p7, data = SMIME.smime_load_pkcs7_bio(self.signed)
75
75
        
76
 
        assert data.read() == self.cleartext
77
76
        assert isinstance(p7, SMIME.PKCS7), p7
78
 
        v = s.verify(p7)
 
77
        v = s.verify(p7, data) 
79
78
        assert v == self.cleartext
80
79
    
81
80
        t = p7.get0_signers(sk)
169
168
        s.set_cipher(SMIME.Cipher('des_ede3_cbc'))
170
169
        
171
170
        tmp = BIO.MemoryBuffer()
172
 
        s.write(tmp, p7, buf)
 
171
        s.write(tmp, p7)
173
172
 
174
173
        p7 = s.encrypt(tmp)
175
174