summaryrefslogtreecommitdiff
path: root/tests/test_smime.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace 'from . import' with absolute imports.Matěj Cepl2021-01-141-1/+1
|
* Mass removal of deprecated constructs.Matěj Cepl2020-12-021-3/+3
| | | | | * Replace unittest.makeSuite with unittest.TestLoader().loadTestsFromTestCase * import unittest from relative import
* Deleted duplicate test from a wrong locationKonstantin Shemyak2018-07-231-23/+0
|
* Show detailed OpenSSL error messagesKonstantin Shemyak2018-07-231-0/+23
| | | | | | | | | | | | | | When OpenSSL encounters an error, M2Crypto prints only the "reason string" (given by ERR_reason_error_string()). This string often contains only very generic message. For example, for all certificate verification errors, the string is the same "certificate verify error". OpenSSL applications (e.g. the command-line utilities from OpenSSL distribution) additionally show "optional text message" as given by ERR_get_error_line_data(). This message contains more detailed error reason, such as for example "certificate revoked". Added this message (if given by OpenSSL) to the Python error text.
* PEP8isationMatěj Cepl2018-03-201-4/+1
| | | | | | | Specially replace complicated construct with unittest2 to one import to M2Crypto top module. Also, Rand.load_file should have first parameter as bytes(), not str().
* Clean up after test_ssl.WriteLoadTestCase tests.Jim Carroll2017-09-191-2/+7
|
* Add tests for `SMIME.load_pkcs7_der()` and `SMIME.load_pkcs7_bio_der()`Nick Gaya2017-03-091-6/+19
|
* Elimination of all open() statements w/o context managers.Matěj Cepl2016-12-151-12/+8
|
* Add possibility to set custom callback for X509 verification.Konstantin Shemyak2016-12-111-1/+68
| | | | | Added wrapper over OpenSSL's X509_STORE_set_verify_cb(). It can be used to set custom options for PKCS#7 verification.
* Add possibility to sign PKCS7 with a non-default digest.Konstantin Shemyak2016-11-281-0/+25
| | | | | | An optional parameter "algo" is added to SMIME.sign(). This is what is done by "-md" option in the command "openssl smime -sign -md <digest_name> ..."
* SSL and SMIME modules: Add PEP-484 type hints in comments.Matěj Cepl2016-06-301-18/+18
|
* Fix ordering of imports in test_smimeMatěj Cepl2016-02-271-1/+1
|
* Fix whitespace using suggestions from autopep8Craig Rodrigues2015-12-011-4/+3
|
* One more random result added to test_write_pkcs7_derMatěj Cepl2015-11-281-1/+1
|
* Workaround missing algorithm for counting The Right Length™Matěj Cepl2015-11-271-1/+1
| | | | | See #84, but we should really find a better algorithm, this is just an ugly hack.
* Regenerate testing PEM filesMatěj Cepl2015-11-251-1/+1
| | | | | | And fix expected values to new certs. Fix #77
* Strip trailinig spaces and expand tabs.Matěj Cepl2015-11-191-39/+39
| | | | | | | Just run $ find . -name \*.py -exec sed -r -i -e "s/\t/ /g" '{}' \; $ find . -name \*.py -exec sed -r -i -e "s/[ ]+$//" '{}' \;
* Remove more plain assertsMatěj Cepl2015-11-181-32/+39
|
* Change self.assertRaises to context managers.Matěj Cepl2015-10-271-16/+27
|
* Account for SHA-256 signatures.Miloslav Trmač2015-10-131-1/+1
| | | | | The test case uses OpenSSL’s default algorithm; the length 1243 corresponds to SHA-1, 1263 to SHA-256.
* Fix M2Crypto in FIPS mode.Miloslav Trmač2015-10-131-1/+1
| | | | | | | | | | | | | | | | More comments and rationale is at https://bugzilla.redhat.com/show_bug.cgi?id=565662 * Some algorithms are not available in FIPS mode, in particular MD5. * Ignoring the error returned by HMAC_Init IIRC results in a NULL deference. * FIPS mode prohibits 512-bit RSA keys, so the tests have to increase the key length. * MD5 is prohibited in FIPS mode, had to use a different algorithm (and different known answers) for testing HMAC. * RC4 is unavailable in FIPS mode. Should probably use @unittest.skip nowadays. * The same goes for RIPEMD-160
* Switch unit testing to have at least 2.7 unittest API available.Matěj Cepl2015-10-131-1/+5
| | | | Fixes #48
* Support OpenSSL 1.0. Thanks to Miloslav Trmac for figuring out how to fix ↵Heikki Toivonen2010-02-131-6/+5
| | | | | | test_smime.py. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@721 2715db39-9adf-0310-9c64-84f055769b4b
* Created new test certificates that will be valid until 2019.Heikki Toivonen2009-07-281-1/+1
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@698 2715db39-9adf-0310-9c64-84f055769b4b
* x509_crl_new was not wrapped, as I found when writing more coverage tests; ↵Heikki Toivonen2009-02-231-0/+2
| | | | | | now it is. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@673 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 12713, do not raise str exceptions:Heikki Toivonen2009-02-061-1/+18
| | | | | | | | | | | | | | | - EVP.load_key and load_key_bio fixed to raise EVP.EVPError and BIO.BIOError - SSL.Session.load_session fixed to raise SSL.SSLError - SMIME.load_pkcs7, load_pkcs7_bio, smime_load_pkcs7, smime_load_pkcs7_bio, text_crlf, text_crlf_bio fixed to raise BIO.BIOError, SMIME.PKCS7_Error and SMIME.SMIME_Error as appropriate Additionally fixed: - SMIME.text_crlf and text_crlf_bio were always raising TypeError git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@663 2715db39-9adf-0310-9c64-84f055769b4b
* X509_Store.load_info now returns the value from the underlyingHeikki Toivonen2008-07-221-1/+6
| | | | | | m2.x509_store_load_locations call, and in case of error raises X509Error. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@610 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 7795, added back PKCS7.get0_signers (which was removed in 0.16 due to ↵Heikki Toivonen2007-06-081-0/+4
| | | | | | always causing a crash). git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@531 2715db39-9adf-0310-9c64-84f055769b4b
* Make all test methods start with test_, so that running individual suites works,Heikki Toivonen2006-12-151-16/+16
| | | | | | | | for example: python setup.py test --test-suite=tests.test_x509 -q git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@504 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 7140, new certificates with 3 year expiration period.Heikki Toivonen2006-12-141-1/+1
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@496 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 7077, test command to setup.py. setuptools are now required to run unit ↵Heikki Toivonen2006-12-061-16/+16
| | | | | | tests. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@491 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 5929, SMIME.smime_load_pkcs7_bio failed with memory BIO.Heikki Toivonen2006-09-061-20/+1
| | | | | | | Made it automatically call BIO_set_mem_eof_return for memory BIOs, as explained in the OpenSSL FAQ. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@469 2715db39-9adf-0310-9c64-84f055769b4b
* Minor changes, mostly commented out, to show that readingHeikki Toivonen2006-04-271-3/+3
| | | | | | signed and encrypted from memory does not seem to work. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@429 2715db39-9adf-0310-9c64-84f055769b4b
* Fixed load_pkcs7 (was always raising exceptions). FixedHeikki Toivonen2006-04-251-5/+66
| | | | | | | potential memory leaks in load_pkcs7 and smime_load_pkcs7 (would leak bio objects if pkcs7 read failed). git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@425 2715db39-9adf-0310-9c64-84f055769b4b
* Got signEncryptDecryptVerify working but the decrypt partHeikki Toivonen2006-04-251-19/+21
| | | | | | | only when reading from file - reading from bio results in error. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@424 2715db39-9adf-0310-9c64-84f055769b4b
* Fixed all but decryptVerify tests, still not sure how to fixHeikki Toivonen2006-04-241-49/+42
| | | | | | that one. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@421 2715db39-9adf-0310-9c64-84f055769b4b
* New test certificates to replace expired ones.Heikki Toivonen2006-04-241-3/+3
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@416 2715db39-9adf-0310-9c64-84f055769b4b
* S/MIME unit tests, not yet complete...Heikki Toivonen2006-02-251-0/+198
git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@356 2715db39-9adf-0310-9c64-84f055769b4b