Permalink
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also .
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
- 10 commits
- 12 files changed
- 0 comments
- 4 contributors
Commits on Sep 03, 2020
Commits on Sep 20, 2020
Commits on Sep 22, 2020
Commits on Oct 27, 2020
Commits on Nov 01, 2020
Unified
Split
Showing
with
71 additions
and 23 deletions.
- +8 −0 .travis.yml
- +11 −0 Changelog.rst
- +1 −1 Doc/src/cipher/pkcs1_v1_5.rst
- +8 −8 appveyor.yml
- +1 −1 lib/Crypto/Cipher/PKCS1_v1_5.pyi
- +1 −0 lib/Crypto/SelfTest/Util/test_number.py
- +1 −1 lib/Crypto/Util/asn1.py
- +3 −0 lib/Crypto/Util/number.py
- +1 −1 lib/Crypto/__init__.py
- +4 −0 setup.cfg
- +26 −10 travis/travis_after_success.sh
- +6 −1 travis/travis_script.sh
| @@ -1,4 +1,7 @@ | ||
| language: python | ||
| arch: | ||
| - amd64 | ||
| - arm64 | ||
| python: | ||
| - "2.7" | ||
| - "3.4" | ||
| @@ -20,21 +23,26 @@ matrix: | ||
| env: CFFI=no | ||
| dist: trusty | ||
| - python: pypy | ||
| arch: amd64 | ||
| env: CFFI=yes | ||
| - python: pypy3 | ||
| arch: amd64 | ||
| env: CFFI=yes | ||
| - language: c | ||
| script: cd src/test && make | ||
| after_success: true | ||
| - language: c | ||
| dist: trusty | ||
| arch: amd64 | ||
| install: sudo apt-get install libc6-dev-i386 | ||
| script: cd src/test && CFLAGS="-m32" UNDEFS="-UHAVE_UINT128" make | ||
| after_success: true | ||
| - language: c | ||
| arch: amd64 | ||
| script: cd src/test && CPPFLAGS="-DHAVE_X86INTRIN_H" make | ||
| after_success: true | ||
| - python: 3.8 | ||
| arch: amd64 | ||
| install: pip install mypy | ||
| script: mypy lib/ | ||
| after_success: true | ||
| @@ -1,6 +1,17 @@ | ||
| Changelog | ||
| ========= | ||
|
|
||
| 3.9.9 (2 November 2020) | ||
| +++++++++++++++++++++++ | ||
|
|
||
| Resolved issues | ||
| --------------- | ||
| * GH#435: Fixed ``Crypto.Util.number.size`` for negative numbers. | ||
|
|
||
| New features | ||
| ------------ | ||
| * Build Python 3.9 wheels on Windows. | ||
|
|
||
| 3.9.8 (23 June 2020) | ||
| ++++++++++++++++++++ | ||
|
|
||
| @@ -24,7 +24,7 @@ As an example, a sender may encrypt a message in this way:: | ||
| At the receiver side, decryption can be done using the private part of | ||
| the RSA key:: | ||
|
|
||
| >>> From Crypto.Hash import SHA | ||
| >>> from Crypto.Hash import SHA | ||
| >>> from Crypto import Random | ||
| >>> | ||
| >>> key = RSA.importKey(open('privkey.der').read()) | ||
| @@ -16,14 +16,6 @@ environment: | ||
| PYTHON_ARCH: "64" | ||
| WINDOWS_SDK_VERSION: "v7.0" | ||
|
|
||
| - PYTHON: "C:\\Python35" | ||
| PYTHON_VERSION: "3.5.0" | ||
| PYTHON_ARCH: "32" | ||
|
|
||
| - PYTHON: "C:\\Python35-x64" | ||
| PYTHON_VERSION: "3.5.0" | ||
| PYTHON_ARCH: "64" | ||
|
|
||
| - PYTHON: "C:\\Python36" | ||
| PYTHON_VERSION: "3.6.0" | ||
| PYTHON_ARCH: "32" | ||
| @@ -48,6 +40,14 @@ environment: | ||
| PYTHON_VERSION: "3.8.0" | ||
| PYTHON_ARCH: "64" | ||
|
|
||
| - PYTHON: "C:\\Python39" | ||
| PYTHON_VERSION: "3.9.0" | ||
| PYTHON_ARCH: "32" | ||
|
|
||
| - PYTHON: "C:\\Python39-x64" | ||
| PYTHON_VERSION: "3.9.0" | ||
| PYTHON_ARCH: "64" | ||
|
|
||
| init: | ||
| - ECHO "%PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" | ||
|
|
||
| @@ -13,5 +13,5 @@ class PKCS115_Cipher: | ||
| def encrypt(self, message: Buffer) -> bytes: ... | ||
| def decrypt(self, ciphertext: Buffer) -> bytes: ... | ||
|
|
||
| def new(key: Buffer, | ||
| def new(key: RsaKey, | ||
| randfunc: Optional[Callable[[int], bytes]] = ...) -> PKCS115_Cipher: ... | ||
| @@ -129,6 +129,7 @@ def test_size(self): | ||
| self.assertEqual(number.size(0xa2),8) | ||
| self.assertEqual(number.size(0xa2ba40),8*3) | ||
| self.assertEqual(number.size(0xa2ba40ee07e3b2bd2f02ce227f36a195024486e49c19cb41bbbdfbba98b22b0e577c2eeaffa20d883a76e65e394c69d4b3c05a1e8fadda27edb2a42bc000fe888b9b32c22d15add0cd76b3e7936e19955b220dd17d4ea904b1ec102b2e4de7751222aa99151024c7cb41cc5ea21d00eeb41f7c800834d2c6e06bce3bce7ea9a5), 1024) | ||
| self.assertRaises(ValueError, number.size, -1) | ||
|
|
||
|
|
||
| def get_tests(config={}): | ||
| @@ -61,7 +61,7 @@ def remaining_data(self): | ||
| def read(self, length): | ||
| new_index = self._index + length | ||
| if new_index > len(self._buffer): | ||
| raise ValueError | ||
| raise ValueError("Not enough data for DER decoding: expected %d bytes and found %d" % (new_index, len(self._buffer))) | ||
|
|
||
| result = self._buffer[self._index:new_index] | ||
| self._index = new_index | ||
| @@ -50,6 +50,9 @@ def ceil_div(n, d): | ||
| def size (N): | ||
| """Returns the size of the number N in bits.""" | ||
|
|
||
| if N < 0: | ||
| raise ValueError("Size in bits only avialable for non-negative numbers") | ||
|
|
||
| bits = 0 | ||
| while N >> bits: | ||
| bits += 1 | ||
| @@ -1,6 +1,6 @@ | ||
| __all__ = ['Cipher', 'Hash', 'Protocol', 'PublicKey', 'Util', 'Signature', | ||
| 'IO', 'Math'] | ||
|
|
||
| version_info = (3, 9, '8') | ||
| version_info = (3, 9, '9') | ||
|
|
||
| __version__ = ".".join([str(x) for x in version_info]) |
| @@ -1,2 +1,6 @@ | ||
| [flake8] | ||
| max-line-length = 110 | ||
|
|
||
| [metadata] | ||
| project_urls = | ||
| Source=https://github.com/Legrandin/pycryptodome/ |
| @@ -2,26 +2,42 @@ | ||
| set -e -x | ||
|
|
||
| printenv | ||
|
|
||
| if [[ !(${TRAVIS_PYTHON_VERSION} == 2.7 && ${CFFI} == yes) ]]; then | ||
| exit 1 | ||
| ARCH=`uname -m` | ||
|
|
||
| # On Arm64, only build wheels in the Python 3.8 job | ||
| if [[ "$ARCH" = "aarch64" ]]; then | ||
| if [[ !(${TRAVIS_PYTHON_VERSION} == 3.8 && ${CFFI} == yes) ]]; then | ||
| exit 1; | ||
| fi | ||
| # On Arm64, only build wheels in the Python 2.7 job | ||
| elif [[ "$ARCH" = "x86_64" ]]; then | ||
| if [[ !(${TRAVIS_PYTHON_VERSION} == 2.7 && ${CFFI} == yes) ]]; then | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Only builds Linux wheels for tagged commits | ||
| if [ "${TRAVIS_TAG}"x == x ]; then | ||
| exit 2 | ||
| fi | ||
|
|
||
| DOCKER_IMAGE_1=quay.io/pypa/manylinux1_x86_64 | ||
| DOCKER_IMAGE_2=quay.io/pypa/manylinux1_i686 | ||
| if [ "$ARCH" = "aarch64" ]; then | ||
| DOCKER_IMAGE=quay.io/pypa/manylinux2014_aarch64 | ||
|
|
||
| docker pull $DOCKER_IMAGE | ||
| docker run --rm -v `pwd`:/io $DOCKER_IMAGE /io/travis/build-wheels.sh | ||
| else | ||
| DOCKER_IMAGE_1=quay.io/pypa/manylinux1_x86_64 | ||
| DOCKER_IMAGE_2=quay.io/pypa/manylinux1_i686 | ||
|
|
||
| docker pull $DOCKER_IMAGE_1 | ||
| docker run --rm -v `pwd`:/io $DOCKER_IMAGE_1 /io/travis/build-wheels.sh | ||
| docker pull $DOCKER_IMAGE_1 | ||
| docker run --rm -v `pwd`:/io $DOCKER_IMAGE_1 /io/travis/build-wheels.sh | ||
|
|
||
| docker pull $DOCKER_IMAGE_2 | ||
| docker run --rm -v `pwd`:/io $DOCKER_IMAGE_2 linux32 /io/travis/build-wheels.sh | ||
| docker pull $DOCKER_IMAGE_2 | ||
| docker run --rm -v `pwd`:/io $DOCKER_IMAGE_2 linux32 /io/travis/build-wheels.sh | ||
| fi | ||
|
|
||
| ls wheelhouse/ | ||
|
|
||
| # Keep only manylinux files | ||
| find wheelhouse -type f -name '*-linux_*' -delete | ||
| sudo find wheelhouse -type f -name '*-linux_*' -delete | ||
| @@ -2,6 +2,7 @@ | ||
| set -e -x | ||
|
|
||
| export CFLAGS+=" -Wconversion" | ||
| ARCH=`uname -m` | ||
|
|
||
| PYVERSION=$(python -V 2>&1) | ||
| echo ${PYVERSION} | ||
| @@ -26,7 +27,11 @@ if [[ ${PYVERSION} != *"PyPy"* ]] || [ "${MAJOR}" -lt 3 ]; then | ||
| xflags="$xflags -tt" | ||
| fi | ||
|
|
||
| if [[ "$ARCH" = "aarch64" ]]; then | ||
| testflags="$testflags --skip-slow-tests" | ||
| fi | ||
|
|
||
| echo "Custom Python flags:" \"${xflags:-none}\" | ||
|
|
||
| python $xflags setup.py build | ||
| python $xflags setup.py test | ||
| python $xflags setup.py test $testflags | ||