summaryrefslogtreecommitdiff
path: root/tests/test_rsa.py
Commit message (Collapse)AuthorAgeFilesLines
* Changed required to pass tests on OpenSSL 3.0Petr Mensik2023-02-041-2/+9
| | | | | | | Just changes to make the package pass tests. Some are just cosmetic changes. Some would require proper investigation. Fixes #310
* Fix according to the code review.Matěj Cepl2022-07-121-7/+6
|
* Mitigate the Bleichenbacher timing attacks in the RSA decryption API ↵Matěj Cepl2022-06-281-8/+7
| | | | | | (CVE-2020-25657) Fixes #282
* Make support of RSA_SSLV23_PADDING optional.Matěj Cepl2021-02-251-1/+3
| | | | | | OpenSSL removes support for it in gh#openssl/openssl#14248. Fixes #294.
* Use of RSA_SSLV23_PADDING has been deprecated.Matěj Cepl2021-02-191-5/+0
| | | | Fixes #293.
* Replace 'from . import' with absolute imports.Matěj Cepl2021-01-141-1/+1
|
* Mass removal of deprecated constructs.Matěj Cepl2020-12-021-2/+2
| | | | | * Replace unittest.makeSuite with unittest.TestLoader().loadTestsFromTestCase * import unittest from relative import
* tests.test_rsa: Fix typo to match for proper exceptionSebastian Andrzej Siewior2019-06-081-1/+1
| | | | Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
* Limit tests.test_rsa.RSATestCase.test_public_encrypt just to OpenSSL which ↵Matěj Cepl2019-06-071-3/+5
| | | | | | sustains it. Fixes #258
* Remove duplicate call of the error code.Matěj Cepl2019-06-071-2/+0
|
* PEP8isationMatěj Cepl2018-03-201-5/+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().
* Restore RSA testsMatěj Cepl2018-02-061-5/+6
|
* restore backwards compatibility for rsa_set_e and rsa_set_nHubert Kario2017-09-291-0/+31
|
* Migrated to m2.rsa_set_en_bin() and m2.rsa_set_en()Jim Carroll2017-09-151-3/+3
|
* Elimination of all open() statements w/o context managers.Matěj Cepl2016-12-151-1/+2
|
* M2Crypto.RSA: Add PEP-484 type hints in comments.Matěj Cepl2016-06-171-27/+23
|
* Replace util.py3k with six.PY3Matěj Cepl2016-05-121-4/+6
| | | | | | | | | | | | | | | | (this was the original comment on removing util.py3{bytes,str} describing my plans for future) It seems to that this abstraction goes exactly wrong way. The primary goal of py3k/py2k string abstraction should be IMHO the elimination of the ambiguous py2k str() object. Everything should be (using py2 terminology) either unicode() or bytes(), and when we start working on rebasing the ``python3`` branch on top of ``six``, we should spend all our effort on clarification between these two types and elimination of str(). Which seems to me is exactly what six.u() and six.b() methods do, so I would use them. Also eliminate util.h2b and util.py3ord
* Use the new absolute import syntax to fix Python 3. [PEP 328]Craig Rodrigues2016-03-201-1/+2
| | | | | | | | | | | I used the output of "2to3 -f import M2Crypto" to figure out which imports needed to be fixed. In addition, I added "from __future__ import absolute_import" to all files that I touched. This brings in the new import behavior, and works as far back as Python 2.5.0a1. See: https://docs.python.org/3/library/__future__.html https://www.python.org/dev/peps/pep-0328/
* Setup logging.Matěj Cepl2016-03-201-0/+6
|
* Use assertEqual() instead of assertEquals()Craig Rodrigues2015-12-011-1/+1
| | | | | | | | assertEquals() is a deprecated alias for assertEqual(): https://docs.python.org/3/library/unittest.html#deprecated-aliases The alias exists as far back as Python 2.6: https://hg.python.org/cpython/file/v2.6.2/Lib/unittest.py#l386
* Remove more plain assertsMatěj Cepl2015-11-181-20/+28
|
* Replace deprecated md5 and sha libs with hashlib.Matěj Cepl2015-11-021-34/+30
| | | | Fixes #64
* Change self.assertRaises to context managers.Matěj Cepl2015-10-271-31/+51
|
* Pure whitespace changes ... NOOP differenceMatěj Cepl2015-10-271-32/+36
|
* Fix M2Crypto in FIPS mode.Miloslav Trmač2015-10-131-5/+8
| | | | | | | | | | | | | | | | 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
* Bug 12894, (Re)Enable configuration and use with OpenSSL 0.9.7g and older by ↵Heikki Toivonen2009-10-061-36/+37
| | | | | | disabling RSA PSS methods when using such old OpenSSL. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@715 2715db39-9adf-0310-9c64-84f055769b4b
* Part of bug 12442, make C code follow the way fips_rsa_sign.c does it in ↵Heikki Toivonen2009-07-281-14/+25
| | | | | | OpenSSL. Make the tests use the same digest algorithm as we are testing the signature with. These fix the tests for 64-bit platforms. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@697 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 12742, better fix for FIPS mode issues by Miloslav Trmac.Heikki Toivonen2009-07-221-11/+11
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@692 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 12442, added support for RSASSA-PSS signing and verifying, patch by ↵Heikki Toivonen2009-07-221-0/+28
| | | | | | Koniosis. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@688 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 12742, let's see if we can get rid of assertions that stop tests ↵Heikki Toivonen2009-04-081-4/+4
| | | | | | prematurely on some RHEL machines where OpenSSL was compiled in FIPS mode. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@682 2715db39-9adf-0310-9c64-84f055769b4b
* Add tests for RC4 and improve test coverage of other modules.Heikki Toivonen2009-02-221-0/+5
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@672 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 11686, EVP.PKey.get_rsa() now returns RSA_pub, which fixes segmentation ↵Heikki Toivonen2008-08-231-3/+20
| | | | | | | | | | fault when trying to encrypt using public key from X509 certificate, by Ben Timby. This cascaded into fixing RSA_pub save_key* methods, and some unit tests as well. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@612 2715db39-9adf-0310-9c64-84f055769b4b
* Make all test methods start with test_, so that running individual suites works,Heikki Toivonen2006-12-151-20/+20
| | | | | | | | 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 7077, test command to setup.py. setuptools are now required to run unit ↵Heikki Toivonen2006-12-061-4/+4
| | | | | | tests. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@491 2715db39-9adf-0310-9c64-84f055769b4b
* Since OpenSSL didn't get sha224-512 until 0.9.8, set theHeikki Toivonen2006-05-021-4/+7
| | | | | | versions guards in place. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@433 2715db39-9adf-0310-9c64-84f055769b4b
* Bug 5501, added sign and verify methods to RSA and get_rsa to PKey,Heikki Toivonen2006-04-271-2/+85
| | | | | | original patch by Matt Rodriguez. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@427 2715db39-9adf-0310-9c64-84f055769b4b
* Removed RCS_id, RCS_ID and _RCS_id from Python files. UnneededHeikki Toivonen2006-03-201-2/+0
| | | | | | bloat, and made working with diffs more difficult than it needed to. git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@383 2715db39-9adf-0310-9c64-84f055769b4b
* Fix $ mess (diff always shows changes).Heikki Toivonen2005-06-091-1/+1
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@299 2715db39-9adf-0310-9c64-84f055769b4b
* Prepare for import into CVS.Ng Pheng Siong2002-12-231-15/+45
| | | | git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@141 2715db39-9adf-0310-9c64-84f055769b4b
* Initial revisionNg Pheng Siong2000-11-191-0/+109
git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@79 2715db39-9adf-0310-9c64-84f055769b4b