summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren St?vel <sybren@stuvel.eu>2016-01-18 15:20:10 +0100
committerSybren St?vel <sybren@stuvel.eu>2016-01-18 15:20:10 +0100
commit2811e9264205264dea49fb12b98b16d09de679d0 (patch)
tree4ce8ee2777f63b392568a0a1006b74775307fab2
parentc426dd7698cebf7c30dbd522f8d62fe5844e4916 (diff)
parent8ea8d4785ea4e0e8df75250aeebc3961876c4481 (diff)
downloadrsa-2811e9264205264dea49fb12b98b16d09de679d0.tar.gz
Merged in fale/python-rsa (pull request #15)
Fixed import error in old version code
-rw-r--r--CHANGELOG.txt55
-rw-r--r--requirements-dev-py3x.txt6
-rw-r--r--requirements.txt (renamed from requirements-dev-py2x.txt)3
-rw-r--r--rsa/__init__.py4
-rw-r--r--run_tests.py57
-rw-r--r--tests/test_bigfile.py4
-rw-r--r--tests/test_common.py8
-rw-r--r--tests/test_compat.py4
-rw-r--r--tests/test_integers.py4
-rw-r--r--tests/test_load_save_keys.py6
-rw-r--r--tests/test_pem.py4
-rw-r--r--tests/test_pkcs1.py6
-rw-r--r--tests/test_strings.py4
-rw-r--r--tests/test_transform.py4
-rw-r--r--tox.ini2
15 files changed, 79 insertions, 92 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 2d8f5cf..d1889f8 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,7 +1,60 @@
Python-RSA changelog
========================================
-Version 3.1.1 - in development
+
+Version 3.3 - released 2016-01-13
+----------------------------------------
+
+- Thanks to Filippo Valsorda: Fix BB'06 attack in verify() by
+ switching from parsing to comparison. See [1] for more information.
+- Simplified Tox configuration and dropped Python 3.2 support. The
+ coverage package uses a u'' prefix, which was reintroduced in 3.3
+ for ease of porting.
+
+[1] https://blog.filippo.io/bleichenbacher-06-signature-forgery-in-python-rsa/
+
+
+Version 3.2.3 - released 2015-11-05
+----------------------------------------
+
+- Added character encoding markers for Python 2.x
+
+
+Version 3.2.1 - released 2015-11-05
+----------------------------------------
+
+- Added per-file licenses
+- Added support for wheel packages
+- Made example code more consistent and up to date with Python 3.4
+
+
+Version 3.2 - released 2015-07-29
+----------------------------------------
+
+- Mentioned support for Python 3 in setup.py
+
+
+Version 3.1.4 - released 2014-02-22
+----------------------------------------
+
+- Fixed some bugs
+
+
+Version 3.1.3 - released 2014-02-02
+----------------------------------------
+
+- Dropped support for Python 2.5
+
+
+Version 3.1.2 - released 2013-09-15
+----------------------------------------
+
+- Added Python 3.3 to the test environment.
+- Removed dependency on Distribute
+- Added support for loading public keys from OpenSSL
+
+
+Version 3.1.1 - released 2012-06-18
----------------------------------------
- Fixed doctests for Python 2.7
diff --git a/requirements-dev-py3x.txt b/requirements-dev-py3x.txt
deleted file mode 100644
index 3e4df7b..0000000
--- a/requirements-dev-py3x.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-nose
-sphinx
-pyasn1>=0.1.3
-tox
-unittest2py3k
-wheel
diff --git a/requirements-dev-py2x.txt b/requirements.txt
index c62d8c0..f1c6af1 100644
--- a/requirements-dev-py2x.txt
+++ b/requirements.txt
@@ -1,5 +1,4 @@
-nose
sphinx
pyasn1>=0.1.3
tox
-unittest2
+wheel
diff --git a/rsa/__init__.py b/rsa/__init__.py
index 99fd668..c4654e9 100644
--- a/rsa/__init__.py
+++ b/rsa/__init__.py
@@ -28,8 +28,8 @@ If you want to have a more secure implementation, use the functions from the
"""
__author__ = "Sybren Stuvel, Barry Mead and Yesudeep Mangalapilly"
-__date__ = "2015-11-05"
-__version__ = '3.2.3'
+__date__ = "2016-01-13"
+__version__ = '3.3'
from rsa.key import newkeys, PrivateKey, PublicKey
from rsa.pkcs1 import encrypt, decrypt, sign, verify, DecryptionError, \
diff --git a/run_tests.py b/run_tests.py
deleted file mode 100644
index 10451d1..0000000
--- a/run_tests.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import os
-import sys
-import unittest2 as unittest
-
-current_path = os.path.abspath(os.path.dirname(__file__))
-tests_path = os.path.join(current_path, 'tests')
-sys.path[0:0] = [
- current_path,
- tests_path,
-]
-
-all_tests = [f[:-3] for f in os.listdir(tests_path)
- if f.startswith('test_') and f.endswith(".py")]
-
-def get_suite(tests):
- tests = sorted(tests)
- suite = unittest.TestSuite()
- loader = unittest.TestLoader()
- for test in tests:
- suite.addTest(loader.loadTestsFromName(test))
- return suite
-
-if __name__ == '__main__':
- """
- To run all tests:
- $ python run_tests.py
- To run a single test:
- $ python run_tests.py app
- To run a couple of tests:
- $ python run_tests.py app config sessions
- To run code coverage:
- $ coverage run run_tests.py
- $ coverage report -m
- """
- tests = sys.argv[1:]
- if not tests:
- tests = all_tests
- tests = ['%s' % t for t in tests]
- suite = get_suite(tests)
- unittest.TextTestRunner(verbosity=1).run(suite)
diff --git a/tests/test_bigfile.py b/tests/test_bigfile.py
index 6c3de00..b45b52f 100644
--- a/tests/test_bigfile.py
+++ b/tests/test_bigfile.py
@@ -21,12 +21,12 @@ try:
from StringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
-import unittest2
+import unittest
import rsa
from rsa import bigfile, varblock, pkcs1
-class BigfileTest(unittest2.TestCase):
+class BigfileTest(unittest.TestCase):
def test_encrypt_decrypt_bigfile(self):
diff --git a/tests/test_common.py b/tests/test_common.py
index eba5d27..a563d21 100644
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -15,13 +15,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
import struct
from rsa._compat import byte, b
from rsa.common import byte_size, bit_size, _bit_size
-class Test_byte(unittest2.TestCase):
+class Test_byte(unittest.TestCase):
def test_values(self):
self.assertEqual(byte(0), b('\x00'))
self.assertEqual(byte(255), b('\xff'))
@@ -30,7 +30,7 @@ class Test_byte(unittest2.TestCase):
self.assertRaises(struct.error, byte, 256)
self.assertRaises(struct.error, byte, -1)
-class Test_byte_size(unittest2.TestCase):
+class Test_byte_size(unittest.TestCase):
def test_values(self):
self.assertEqual(byte_size(1 << 1023), 128)
self.assertEqual(byte_size((1 << 1024) - 1), 128)
@@ -55,7 +55,7 @@ class Test_byte_size(unittest2.TestCase):
self.assertRaises(TypeError, byte_size, "")
self.assertRaises(TypeError, byte_size, None)
-class Test_bit_size(unittest2.TestCase):
+class Test_bit_size(unittest.TestCase):
def test_zero(self):
self.assertEqual(bit_size(0), 0)
diff --git a/tests/test_compat.py b/tests/test_compat.py
index 1788ff0..2ab7fd2 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
import struct
from rsa._compat import is_bytes, byte
-class Test_byte(unittest2.TestCase):
+class Test_byte(unittest.TestCase):
def test_byte(self):
for i in range(256):
byt = byte(i)
diff --git a/tests/test_integers.py b/tests/test_integers.py
index f504e45..118204a 100644
--- a/tests/test_integers.py
+++ b/tests/test_integers.py
@@ -16,11 +16,11 @@
'''Tests integer operations.'''
-import unittest2
+import unittest
import rsa.core
-class IntegerTest(unittest2.TestCase):
+class IntegerTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(64)
diff --git a/tests/test_load_save_keys.py b/tests/test_load_save_keys.py
index 1a4ee23..b2b4071 100644
--- a/tests/test_load_save_keys.py
+++ b/tests/test_load_save_keys.py
@@ -17,7 +17,7 @@
'''Unittest for saving and loading keys.'''
import base64
-import unittest2
+import unittest
from rsa._compat import b
import rsa.key
@@ -69,7 +69,7 @@ CLEAN_PUBLIC_PEM = b('''\
''' % B64PUB_DER.decode("utf-8"))
-class DerTest(unittest2.TestCase):
+class DerTest(unittest.TestCase):
'''Test saving and loading DER keys.'''
def test_load_private_key(self):
@@ -104,7 +104,7 @@ class DerTest(unittest2.TestCase):
self.assertEqual(PUBLIC_DER, der)
-class PemTest(unittest2.TestCase):
+class PemTest(unittest.TestCase):
'''Test saving and loading PEM keys.'''
diff --git a/tests/test_pem.py b/tests/test_pem.py
index d1dcf3a..de1b8a6 100644
--- a/tests/test_pem.py
+++ b/tests/test_pem.py
@@ -15,12 +15,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
from rsa._compat import b
from rsa.pem import _markers
-class Test__markers(unittest2.TestCase):
+class Test__markers(unittest.TestCase):
def test_values(self):
self.assertEqual(_markers('RSA PRIVATE KEY'),
(b('-----BEGIN RSA PRIVATE KEY-----'),
diff --git a/tests/test_pkcs1.py b/tests/test_pkcs1.py
index 6150215..7b92197 100644
--- a/tests/test_pkcs1.py
+++ b/tests/test_pkcs1.py
@@ -17,13 +17,13 @@
'''Tests string operations.'''
import struct
-import unittest2
+import unittest
import rsa
from rsa import pkcs1
from rsa._compat import byte, is_integer, b, is_bytes
-class BinaryTest(unittest2.TestCase):
+class BinaryTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(256)
@@ -66,7 +66,7 @@ class BinaryTest(unittest2.TestCase):
self.assertNotEqual(encrypted1, encrypted2)
-class SignatureTest(unittest2.TestCase):
+class SignatureTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(512)
diff --git a/tests/test_strings.py b/tests/test_strings.py
index fe60055..c4ee4c4 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -18,13 +18,13 @@
from __future__ import absolute_import
-import unittest2
+import unittest
import rsa
from constants import unicode_string
-class StringTest(unittest2.TestCase):
+class StringTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(384)
diff --git a/tests/test_transform.py b/tests/test_transform.py
index ed3e38b..f919b1b 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
from rsa._compat import b
from rsa.transform import int2bytes, bytes2int, _int2bytes
-class Test_int2bytes(unittest2.TestCase):
+class Test_int2bytes(unittest.TestCase):
def test_accuracy(self):
self.assertEqual(int2bytes(123456789), b('\x07[\xcd\x15'))
self.assertEqual(_int2bytes(123456789), b('\x07[\xcd\x15'))
diff --git a/tox.ini b/tox.ini
index da0e3c6..5932192 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,8 +11,6 @@ setenv =
commands=py.test []
deps=pyasn1 >=0.1.3
coverage >=3.5
- unittest2
PyTest
pytest-xdist
pytest-cov
-