Skip to content
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 or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pyca/cryptography
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.2.1
Choose a base ref
...
head repository: pyca/cryptography
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.3
Choose a head ref

Commits on Oct 26, 2020

  1. Reopen master for 3.3 (#5509)

    * Reopen master for 3.3
    
    * its how you know its authentic alex gaynor code
    alex authored Oct 26, 2020
    Copy the full SHA
    558cf91 View commit details
  2. Copy the full SHA
    d3eae8d View commit details
  3. Copy the full SHA
    5a7dfb7 View commit details
  4. Copy the full SHA
    b187b80 View commit details
  5. Copy the full SHA
    956e096 View commit details

Commits on Oct 27, 2020

  1. Copy the full SHA
    b0a3d89 View commit details
  2. Fix installation docs link in README.rst (#5520)

    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh authored Oct 27, 2020
    Copy the full SHA
    48211dd View commit details
  3. Copy the full SHA
    b165616 View commit details

Commits on Oct 28, 2020

  1. Copy the full SHA
    46d35a8 View commit details
  2. Drop python 3.5 (#5527)

    alex authored Oct 28, 2020
    Copy the full SHA
    d9e174d View commit details
  3. Copy the full SHA
    95049c5 View commit details
  4. Copy the full SHA
    6c43bbc View commit details
  5. Copy the full SHA
    ec8b0b2 View commit details

Commits on Oct 29, 2020

  1. Copy the full SHA
    2ce289f View commit details
  2. Copy the full SHA
    a48bcfb View commit details

Commits on Oct 30, 2020

  1. Copy the full SHA
    851acb5 View commit details

Commits on Oct 31, 2020

  1. tense (#5538)

    alex authored Oct 31, 2020
    Copy the full SHA
    e06e5c6 View commit details
  2. we have abi3 wheels for windows now (#5536)

    * we have abi3 wheels for windows now
    
    * Update faq.rst
    alex authored Oct 31, 2020
    Copy the full SHA
    752f966 View commit details
  3. abi3 only on windows (#5537)

    alex authored Oct 31, 2020
    Copy the full SHA
    753965c View commit details
  4. updated faq entry (#5541)

    the error will be opensslv.h these days and we don't need to talk
    specifically about macOS
    reaperhulk authored Oct 31, 2020
    Copy the full SHA
    81e5de8 View commit details
  5. print some stuff in setup.py to try to educate people (#5539)

    This is likely futile, but maybe it will slightly help out people who
    run into compilation errors and actually choose to look at the output.
    reaperhulk authored Oct 31, 2020
    Copy the full SHA
    66654d6 View commit details

Commits on Nov 1, 2020

  1. Copy the full SHA
    d59b7c2 View commit details

Commits on Nov 3, 2020

  1. Attempt to move docker builds from travis to GHA (#5545)

    * Attempt to move docker builds from travis to GHA
    
    * fix linkcheck
    alex authored Nov 3, 2020
    Copy the full SHA
    923de98 View commit details

Commits on Nov 4, 2020

  1. Copy the full SHA
    4ba0d6e View commit details
  2. padding: Tip-toe around bytes subclasses. (#5548)

    This change allows future's newbytes class to be padded again.
    
    Fixes #5547.
    benjaminp authored Nov 4, 2020
    Copy the full SHA
    15771e2 View commit details

Commits on Nov 9, 2020

  1. GCM IV size limits (#5553)

    * GCM IV size limits
    
    OpenSSL 3.0.0 is going to enforce these size limits so we might as well
    put them in now.
    
    * fix the tests
    
    * black
    
    * these cases can't happen if we're limiting IV size already
    reaperhulk authored Nov 9, 2020
    Copy the full SHA
    b59d2de View commit details

Commits on Nov 11, 2020

  1. Fix broken links (#5552)

    * Fix broken links.
    
    * Shorter lines.
    felixfontein authored Nov 11, 2020
    Copy the full SHA
    b9b921a View commit details
  2. Copy the full SHA
    e0b446e View commit details
  3. Copy the full SHA
    94f32c1 View commit details
  4. Copy the full SHA
    d74a477 View commit details
  5. Copy the full SHA
    49109ce View commit details
  6. migrate more from Travis to GHA (#5555)

    * migrate more from Travis to GHA
    
    * actually upload coverage
    
    * use cache checks properly
    
    * also do coverage
    
    * simplify coverage check
    
    * refactor a bit
    
    * oops
    
    * remove unused things in travis
    
    * this needs to be stored to the github env...
    reaperhulk authored Nov 11, 2020
    Copy the full SHA
    23ce563 View commit details
  7. Copy the full SHA
    ce9645a View commit details
  8. port docs and docs-linkcheck (#5563)

    * port docs and docs-linkcheck
    
    * allow linkcheck if the commit msg says linkcheck
    
    combine docs job into lint jobs
    
    * can't get the commit msg at this time on a PR
    reaperhulk authored Nov 11, 2020
    Copy the full SHA
    a07da37 View commit details

Commits on Nov 12, 2020

  1. Copy the full SHA
    9e08151 View commit details
  2. Added python2 removal to the changelog (#5567)

    * Added python2 removal to the changelog
    
    * Update CHANGELOG.rst
    alex authored Nov 12, 2020
    Copy the full SHA
    548b1b2 View commit details

Commits on Nov 13, 2020

  1. Copy the full SHA
    eb02f21 View commit details
  2. Copy the full SHA
    488cd74 View commit details

Commits on Nov 14, 2020

  1. Copy the full SHA
    d22bdc8 View commit details

Commits on Nov 19, 2020

  1. Copy the full SHA
    239fddf View commit details

Commits on Nov 20, 2020

  1. Copy the full SHA
    fd582e8 View commit details
  2. Copy the full SHA
    2b85c4d View commit details

Commits on Nov 22, 2020

  1. Simplify CI scripts (#5582)

    alex authored Nov 22, 2020
    Copy the full SHA
    21144be View commit details

Commits on Nov 24, 2020

  1. Copy the full SHA
    5cd265a View commit details

Commits on Nov 26, 2020

  1. Copy the full SHA
    417f684 View commit details
  2. define OAEP properties for all openssl versions (#5589)

    In 3.0 these aren't macros so we can't test this way. All our supported
    OpenSSLs have these bindings now and LibreSSL does not.
    reaperhulk authored Nov 26, 2020
    Copy the full SHA
    d890e2a View commit details
  3. Reduce granularity of error msging when deserializing keys (#5588)

    * Reduce granularity of error msging when deserializing keys
    
    In OpenSSL 3.0 it is no longer possible to determine whether the reason
    a key failed to deserialize is because of an unsupported cipher. Since
    we want to be more resilient to OpenSSL error code instability we'll
    just remove these paths.
    
    * black
    
    * changelog and update docs
    reaperhulk authored Nov 26, 2020
    Copy the full SHA
    ac4c221 View commit details
  4. don't require errors to be on the stack when loading a key (#5590)

    In OpenSSL 3.0.0 no error is added in many cases for this path and
    since we don't do anything with the error anyway we should just
    consume and move on
    reaperhulk authored Nov 26, 2020
    Copy the full SHA
    fd7ed67 View commit details

Commits on Nov 29, 2020

  1. disallow p less than 512-bit on DH (#5592)

    * disallow p less than 512-bit on DH
    
    OpenSSL 3.0.0 enforces this so we'll go ahead and enforce it everywhere
    that's practical for us. (Note that we do not enforce on deserializing
    PKCS1/PKCS8 keys in < 3.0.0, but this PR adds a test so that in the
    3.0.0 support branch we can test an error path)
    
    * missing test
    
    * black
    
    * _MIN_MODULUS_SIZE is now a thing
    
    * skip on fips
    reaperhulk authored Nov 29, 2020
    Copy the full SHA
    4645f02 View commit details
  2. Don't build our custom osrandom engine on libressl (#5593)

    * Don't build our custom osrandom engine on libressl
    
    As far as I can tell it's never used on LibreSSL -- they're `RAND_bytes` function unconditionally calls `arc4random_buf`
    
    * Update cryptography.py
    alex authored Nov 29, 2020
    Copy the full SHA
    f133a30 View commit details
Showing with 1,021 additions and 1,483 deletions.
  1. +19 −0 .github/actions/upload-coverage/action.yml
  2. 0 {.travis → .github}/downstream.d/aws-encryption-sdk.sh
  3. 0 {.travis → .github}/downstream.d/certbot-josepy.sh
  4. 0 {.travis → .github}/downstream.d/certbot.sh
  5. 0 {.travis → .github}/downstream.d/dynamodb-encryption-sdk.sh
  6. 0 {.travis → .github}/downstream.d/paramiko.sh
  7. 0 {.travis → .github}/downstream.d/pyopenssl.sh
  8. 0 {.travis → .github}/downstream.d/twisted.sh
  9. +34 −0 .github/workflows/build_openssl.sh
  10. +155 −13 .github/workflows/ci.yml
  11. +1 −0 .github/workflows/download_openssl.py
  12. +6 −10 .github/workflows/wheel-builder.yml
  13. +5 −0 .readthedocs.yml
  14. +0 −155 .travis.yml
  15. +0 −13 .travis/downstream.d/README.rst
  16. +0 −69 .travis/install.sh
  17. +0 −13 .travis/openssl_config.sh
  18. +0 −41 .travis/run.sh
  19. +0 −21 .travis/upload_coverage.sh
  20. +3 −3 .zuul.d/jobs.yaml
  21. +42 −0 CHANGELOG.rst
  22. +2 −2 LICENSE
  23. +1 −3 MANIFEST.in
  24. +3 −6 README.rst
  25. +1 −1 docs/api-stability.rst
  26. +0 −4 docs/conf.py
  27. +2 −2 docs/development/c-bindings.rst
  28. +2 −0 docs/development/test-vectors.rst
  29. +23 −37 docs/faq.rst
  30. +3 −2 docs/fernet.rst
  31. +1 −1 docs/hazmat/backends/openssl.rst
  32. +54 −0 docs/hazmat/primitives/asymmetric/rsa.rst
  33. +9 −5 docs/hazmat/primitives/asymmetric/serialization.rst
  34. +2 −7 docs/installation.rst
  35. +20 −0 docs/limitations.rst
  36. +3 −4 docs/security.rst
  37. +1 −0 docs/spelling_wordlist.txt
  38. +1 −1 pyproject.toml
  39. +103 −81 setup.py
  40. +12 −22 src/_cffi_src/build_openssl.py
  41. +0 −6 src/_cffi_src/openssl/bio.py
  42. +1 −133 src/_cffi_src/openssl/callbacks.py
  43. +1 −11 src/_cffi_src/openssl/crypto.py
  44. +2 −17 src/_cffi_src/openssl/cryptography.py
  45. +6 −4 src/_cffi_src/openssl/ct.py
  46. +1 −73 src/_cffi_src/openssl/dh.py
  47. +0 −66 src/_cffi_src/openssl/dsa.py
  48. +12 −16 src/_cffi_src/openssl/evp.py
  49. +2 −24 src/_cffi_src/openssl/hmac.py
  50. +0 −14 src/_cffi_src/openssl/nid.py
  51. +4 −4 src/_cffi_src/openssl/ocsp.py
  52. +0 −3 src/_cffi_src/openssl/rand.py
  53. +3 −117 src/_cffi_src/openssl/rsa.py
  54. +29 −88 src/_cffi_src/openssl/ssl.py
  55. +1 −43 src/_cffi_src/openssl/x509.py
  56. +2 −24 src/_cffi_src/openssl/x509_vfy.py
  57. +1 −10 src/_cffi_src/openssl/x509name.py
  58. +2 −2 src/cryptography/__about__.py
  59. +2 −9 src/cryptography/__init__.py
  60. +26 −35 src/cryptography/hazmat/backends/openssl/backend.py
  61. +1 −1 src/cryptography/hazmat/backends/openssl/decode_asn1.py
  62. +3 −3 src/cryptography/hazmat/backends/openssl/ec.py
  63. +4 −4 src/cryptography/hazmat/backends/openssl/ed25519.py
  64. +4 −4 src/cryptography/hazmat/backends/openssl/ed448.py
  65. +14 −1 src/cryptography/hazmat/backends/openssl/encode_asn1.py
  66. +4 −4 src/cryptography/hazmat/backends/openssl/hashes.py
  67. +4 −6 src/cryptography/hazmat/backends/openssl/hmac.py
  68. +2 −2 src/cryptography/hazmat/backends/openssl/poly1305.py
  69. +62 −16 src/cryptography/hazmat/backends/openssl/rsa.py
  70. +2 −1 src/cryptography/hazmat/backends/openssl/utils.py
  71. +13 −36 src/cryptography/hazmat/bindings/openssl/_conditional.py
  72. +1 −51 src/cryptography/hazmat/bindings/openssl/binding.py
  73. +8 −0 src/cryptography/hazmat/primitives/asymmetric/dh.py
  74. +6 −0 src/cryptography/hazmat/primitives/asymmetric/rsa.py
  75. +2 −2 src/cryptography/hazmat/primitives/ciphers/aead.py
  76. +7 −5 src/cryptography/hazmat/primitives/ciphers/modes.py
  77. +8 −2 src/cryptography/hazmat/primitives/padding.py
  78. +1 −3 tests/conftest.py
  79. +1 −6 tests/hazmat/backends/test_openssl.py
  80. +1 −25 tests/hazmat/bindings/test_openssl.py
  81. +11 −2 tests/hazmat/primitives/test_aead.py
  82. +22 −0 tests/hazmat/primitives/test_aes_gcm.py
  83. +7 −0 tests/hazmat/primitives/test_ciphers.py
  84. +70 −26 tests/hazmat/primitives/test_dh.py
  85. +24 −0 tests/hazmat/primitives/test_padding.py
  86. +66 −4 tests/hazmat/primitives/test_rsa.py
  87. +5 −4 tests/hazmat/primitives/test_serialization.py
  88. +4 −0 tests/hazmat/primitives/utils.py
  89. +0 −7 tests/utils.py
  90. +11 −6 tests/wycheproof/test_aes.py
  91. +1 −16 tests/wycheproof/test_rsa.py
  92. +1 −10 tests/wycheproof/test_utils.py
  93. +11 −11 tests/x509/test_x509.py
  94. +29 −4 tests/x509/test_x509_ext.py
  95. +2 −4 tox.ini
  96. +2 −2 vectors/cryptography_vectors/__about__.py
  97. +4 −0 vectors/cryptography_vectors/asymmetric/DH/dh_key_256.pem
19 changes: 19 additions & 0 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Upload Coverage
description: Upload coverage to codecov

inputs:
name:
description: "Job name"
required: true

runs:
using: "composite"

steps:
- run: |
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash
bash codecov.sh -n "${{ inputs.name }}"
shell: bash
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/workflows/build_openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -e
set -x

shlib_sed() {
# modify the shlib version to a unique one to make sure the dynamic
# linker doesn't load the system one.
sed -i "s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=100/" Makefile
sed -i "s/^SHLIB_MINOR=.*/SHLIB_MINOR=0.0/" Makefile
sed -i "s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=100.0.0/" Makefile
}

if [[ "${TYPE}" == "openssl" ]]; then
curl -O "https://www.openssl.org/source/openssl-${VERSION}.tar.gz"
tar zxf "openssl-${VERSION}.tar.gz"
pushd "openssl-${VERSION}"
# CONFIG_FLAGS is a global coming from a previous step
./config ${CONFIG_FLAGS} -fPIC --prefix="${OSSL_PATH}"
shlib_sed
make depend
make -j"$(nproc)"
# avoid installing the docs (for performance)
# https://github.com/openssl/openssl/issues/6685#issuecomment-403838728
make install_sw install_ssldirs
popd
elif [[ "${TYPE}" == "libressl" ]]; then
curl -O "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz"
tar zxf "libressl-${VERSION}.tar.gz"
pushd "libressl-${VERSION}"
./config -Wl -Wl,-Bsymbolic-functions -fPIC shared --prefix="${OSSL_PATH}"
shlib_sed
make -j"$(nproc)" install
popd
fi
168 changes: 155 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -10,13 +10,118 @@ on:
- '*.*.*'

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
PYTHON:
- {VERSION: "3.9", TOXENV: "pep8,packaging,docs", COVERAGE: "false"}
- {VERSION: "pypy2", TOXENV: "pypy-nocoverage", COVERAGE: "false"}
- {VERSION: "pypy3", TOXENV: "pypy3-nocoverage", COVERAGE: "false"}
- {VERSION: "2.7", TOXENV: "py27", OPENSSL: {TYPE: "openssl", VERSION: "1.1.0l"}}
- {VERSION: "2.7", TOXENV: "py27-ssh", OPENSSL: {TYPE: "openssl", VERSION: "1.1.0l"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "openssl", VERSION: "1.1.0l"}}
- {VERSION: "2.7", TOXENV: "py27", OPENSSL: {TYPE: "openssl", VERSION: "1.1.1h"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "openssl", VERSION: "1.1.1h"}}
- {VERSION: "3.9", TOXENV: "py39-ssh", OPENSSL: {TYPE: "openssl", VERSION: "1.1.1h"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "openssl", VERSION: "1.1.1h", CONFIG_FLAGS: "no-engine no-rc2 no-srtp no-ct"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "libressl", VERSION: "2.9.2"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "libressl", VERSION: "3.0.2"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "libressl", VERSION: "3.1.4"}}
- {VERSION: "3.9", TOXENV: "py39", OPENSSL: {TYPE: "libressl", VERSION: "3.2.2"}}
name: "${{ matrix.PYTHON.TOXENV }} ${{ matrix.PYTHON.OPENSSL.TYPE }} ${{ matrix.PYTHON.OPENSSL.VERSION }} ${{ matrix.PYTHON.OPENSSL.CONFIG_FLAGS }}"
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- run: git clone --depth=1 https://github.com/google/wycheproof
- run: python -m pip install tox requests coverage
- name: Compute config hash and set config vars
run: |
DEFAULT_CONFIG_FLAGS="shared no-ssl2 no-ssl3"
CONFIG_FLAGS="$DEFAULT_CONFIG_FLAGS $CONFIG_FLAGS"
CONFIG_HASH=$(echo "$CONFIG_FLAGS" | sha1sum | sed 's/ .*$//')
echo "CONFIG_FLAGS=${CONFIG_FLAGS}" >> $GITHUB_ENV
echo "CONFIG_HASH=${CONFIG_HASH}" >> $GITHUB_ENV
echo "OSSL_INFO=${{ matrix.PYTHON.OPENSSL.TYPE }}-${{ matrix.PYTHON.OPENSSL.VERSION }}-${CONFIG_FLAGS}" >> $GITHUB_ENV
echo "OSSL_PATH=${{ github.workspace }}/osslcache/${{ matrix.PYTHON.OPENSSL.TYPE }}-${{ matrix.PYTHON.OPENSSL.VERSION }}-${CONFIG_HASH}" >> $GITHUB_ENV
env:
CONFIG_FLAGS: ${{ matrix.PYTHON.OPENSSL.CONFIG_FLAGS }}
if: matrix.PYTHON.OPENSSL
- name: Load cache
uses: actions/cache@v2
id: ossl-cache
with:
path: ${{ github.workspace }}/osslcache
# When altering the openssl build process you may need to increment the value on the end of this cache key
# so that you can prevent it from fetching the cache and skipping the build step.
key: ${{ matrix.PYTHON.OPENSSL.TYPE }}-${{ matrix.PYTHON.OPENSSL.VERSION }}-${{ env.CONFIG_HASH }}-1
if: matrix.PYTHON.OPENSSL
- name: Build custom OpenSSL/LibreSSL
run: .github/workflows/build_openssl.sh
env:
TYPE: ${{ matrix.PYTHON.OPENSSL.TYPE }}
VERSION: ${{ matrix.PYTHON.OPENSSL.VERSION }}
if: matrix.PYTHON.OPENSSL && steps.ossl-cache.outputs.cache-hit != 'true'
- name: Set CFLAGS/LDFLAGS
run: |
echo "CFLAGS=${CFLAGS} -I${OSSL_PATH}/include" >> $GITHUB_ENV
echo "LDFLAGS=${LDFLAGS} -L${OSSL_PATH}/lib -Wl,-rpath=${OSSL_PATH}/lib" >> $GITHUB_ENV
if: matrix.PYTHON.OPENSSL
- name: Tests
run: |
tox -r -- --color=yes --wycheproof-root=wycheproof
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
- uses: ./.github/actions/upload-coverage
with:
name: "tox -e ${{ matrix.PYTHON.TOXENV }} ${{ env.OSSL_INFO }}"
if: matrix.PYTHON.COVERAGE != 'false'

linux-distros:
runs-on: ubuntu-latest
container: ${{ matrix.IMAGE.IMAGE }}
strategy:
matrix:
IMAGE:
- {IMAGE: "pyca/cryptography-runner-centos8", TOXENV: "py27"}
- {IMAGE: "pyca/cryptography-runner-centos8", TOXENV: "py36"}
- {IMAGE: "pyca/cryptography-runner-centos8-fips", TOXENV: "py36", FIPS: true}
- {IMAGE: "pyca/cryptography-runner-stretch", TOXENV: "py27"}
- {IMAGE: "pyca/cryptography-runner-buster", TOXENV: "py37"}
- {IMAGE: "pyca/cryptography-runner-bullseye", TOXENV: "py38"}
- {IMAGE: "pyca/cryptography-runner-sid", TOXENV: "py39"}
- {IMAGE: "pyca/cryptography-runner-ubuntu-bionic", TOXENV: "py36"}
- {IMAGE: "pyca/cryptography-runner-ubuntu-focal", TOXENV: "py38"}
- {IMAGE: "pyca/cryptography-runner-ubuntu-rolling", TOXENV: "py27"}
- {IMAGE: "pyca/cryptography-runner-ubuntu-rolling", TOXENV: "py38"}
- {IMAGE: "pyca/cryptography-runner-ubuntu-rolling", TOXENV: "py38-randomorder"}
- {IMAGE: "pyca/cryptography-runner-fedora", TOXENV: "py39"}
- {IMAGE: "pyca/cryptography-runner-alpine", TOXENV: "py38"}
name: "tox -e ${{ matrix.IMAGE.TOXENV }} on ${{ matrix.IMAGE.IMAGE }}"
steps:
- uses: actions/checkout@v2
- run: 'git clone --depth=1 https://github.com/google/wycheproof "$HOME/wycheproof"'
- run: |
echo "OPENSSL_FORCE_FIPS_MODE=1" >> $GITHUB_ENV
echo "CFLAGS=-DUSE_OSRANDOM_RNG_FOR_TESTING" >> $GITHUB_ENV
if: matrix.IMAGE.FIPS
- run: 'tox -- --wycheproof-root="$HOME/wycheproof"'
env:
TOXENV: ${{ matrix.IMAGE.TOXENV }}
- uses: ./.github/actions/upload-coverage
with:
name: "tox -e ${{ matrix.IMAGE.TOXENV }} on ${{ matrix.IMAGE.IMAGE }}"

macos:
runs-on: macos-latest
strategy:
matrix:
PYTHON:
- {VERSION: "2.7", TOXENV: "py27", EXTRA_CFLAGS: ""}
- {VERSION: "3.5", TOXENV: "py35", EXTRA_CFLAGS: ""}
- {VERSION: "3.6", TOXENV: "py36", EXTRA_CFLAGS: ""}
- {VERSION: "3.9", TOXENV: "py39", EXTRA_CFLAGS: "-DUSE_OSRANDOM_RNG_FOR_TESTING"}
name: "Python ${{ matrix.PYTHON.VERSION }} on macOS"
steps:
@@ -32,23 +137,22 @@ jobs:

- name: Download OpenSSL
run: |
python .github/workflows/download_openssl.py macos openssl-macos
python .github/workflows/download_openssl.py macos openssl-macos-x86-64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tests
run: |
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 \
LDFLAGS="${HOME}/openssl-macos/lib/libcrypto.a ${HOME}/openssl-macos/lib/libssl.a" \
CFLAGS="-I${HOME}/openssl-macos/include -Werror -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=unused-function -Wno-error=unused-command-line-argument -mmacosx-version-min=10.10 -march=core2 $EXTRA_CFLAGS" \
LDFLAGS="${HOME}/openssl-macos-x86-64/lib/libcrypto.a ${HOME}/openssl-macos-x86-64/lib/libssl.a" \
CFLAGS="-I${HOME}/openssl-macos-x86-64/include -Werror -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=unused-function -Wno-error=unused-command-line-argument -mmacosx-version-min=10.10 -march=core2 $EXTRA_CFLAGS" \
tox -r -- --color=yes --wycheproof-root=wycheproof
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
EXTRA_CFLAGS: ${{ matrix.PYTHON.EXTRA_CFLAGS }}

- name: Upload coverage
run: |
curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash
bash codecov.sh -n "Python ${{ matrix.PYTHON.VERSION }} on macOS"
- uses: ./.github/actions/upload-coverage
with:
name: "Python ${{ matrix.PYTHON.VERSION }} on macOS"

windows:
runs-on: windows-latest
@@ -59,7 +163,6 @@ jobs:
- {ARCH: 'x64', WINDOWS: 'win64'}
PYTHON:
- {VERSION: "2.7", TOXENV: "py27", MSVC_VERSION: "2010", CL_FLAGS: ""}
- {VERSION: "3.5", TOXENV: "py35", MSVC_VERSION: "2019", CL_FLAGS: ""}
- {VERSION: "3.6", TOXENV: "py36", MSVC_VERSION: "2019", CL_FLAGS: ""}
- {VERSION: "3.7", TOXENV: "py37", MSVC_VERSION: "2019", CL_FLAGS: ""}
- {VERSION: "3.8", TOXENV: "py38", MSVC_VERSION: "2019", CL_FLAGS: ""}
@@ -96,7 +199,46 @@ jobs:
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}

- name: Upload coverage
run: |
curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash || curl -o codecov.sh -f https://codecov.io/bash
bash codecov.sh -n "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
- uses: ./.github/actions/upload-coverage
with:
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"

linux-downstream:
runs-on: ubuntu-latest
strategy:
matrix:
DOWNSTREAM:
- paramiko
- pyopenssl
- twisted
- aws-encryption-sdk
- dynamodb-encryption-sdk
- certbot
- certbot-josepy
name: "Downstream tests for ${{ matrix.DOWNSTREAM }}"
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.7
- run: python -m pip install -U pip wheel
- run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh install
- run: pip uninstall -y enum34
- run: pip install .
- run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh run

docs-linkcheck:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: "linkcheck"
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python -m pip install -U tox
- run: tox -r -- --color=yes
env:
TOXENV: docs-linkcheck
1 change: 1 addition & 0 deletions .github/workflows/download_openssl.py
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ def main(platform, target):
os.path.join(path, artifact["name"])
)
return
raise ValueError("Didn't find {} in {}".format(target, response))


if __name__ == "__main__":
16 changes: 6 additions & 10 deletions .github/workflows/wheel-builder.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
container: ${{ matrix.MANYLINUX.CONTAINER }}
strategy:
matrix:
PYTHON: ["cp27-cp27m", "cp27-cp27mu", "cp35-cp35m"]
PYTHON: ["cp27-cp27m", "cp27-cp27mu", "cp36-cp36m"]
MANYLINUX:
- NAME: manylinux1_x86_64
CONTAINER: "pyca/cryptography-manylinux1:x86_64"
@@ -47,7 +47,7 @@ jobs:
.venv/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
- run: mkdir cryptography-wheelhouse
- run: mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
- uses: actions/upload-artifact@v2.2.0
- uses: actions/upload-artifact@v1
with:
name: "cryptography-${{ github.event.inputs.version }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON }}"
path: cryptography-wheelhouse/
@@ -62,7 +62,7 @@ jobs:
DOWNLOAD_URL: 'https://www.python.org/ftp/python/2.7.17/python-2.7.17-macosx10.9.pkg'
BIN_PATH: '/Library/Frameworks/Python.framework/Versions/2.7/bin/python'
- VERSION: '3.8'
ABI_VERSION: '3.5'
ABI_VERSION: '3.6'
DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.8.2/python-3.8.2-macosx10.9.pkg'
BIN_PATH: '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3'
name: "${{ matrix.PYTHON.VERSION }} ABI ${{ matrix.PYTHON.ABI_VERSION }} macOS"
@@ -76,7 +76,7 @@ jobs:
- run: ${{ matrix.PYTHON.BIN_PATH }} -m pip install -U virtualenv requests
- name: Download OpenSSL
run: |
${{ matrix.PYTHON.BIN_PATH }} .github/workflows/download_openssl.py macos openssl-macos
${{ matrix.PYTHON.BIN_PATH }} .github/workflows/download_openssl.py macos openssl-macos-x86-64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@@ -92,8 +92,8 @@ jobs:
cd cryptography*
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" \
LDFLAGS="${HOME}/openssl-macos/lib/libcrypto.a ${HOME}/openssl-macos/lib/libssl.a" \
CFLAGS="-I${HOME}/openssl-macos/include -mmacosx-version-min=10.10 -march=core2" \
LDFLAGS="${HOME}/openssl-macos-x86-64/lib/libcrypto.a ${HOME}/openssl-macos-x86-64/lib/libssl.a" \
CFLAGS="-I${HOME}/openssl-macos-x86-64/include -mmacosx-version-min=10.10 -march=core2" \
../venv/bin/python setup.py bdist_wheel $PY_LIMITED_API && mv dist/cryptography*.whl ../wheelhouse
- run: venv/bin/pip install -f wheelhouse --no-index cryptography
- run: |
@@ -115,10 +115,6 @@ jobs:
- {ARCH: 'x64', WINDOWS: 'win64'}
PYTHON:
- {VERSION: "2.7", MSVC_VERSION: "2010"}
- {VERSION: "3.5", MSVC_VERSION: "2019"}
- {VERSION: "3.6", MSVC_VERSION: "2019"}
- {VERSION: "3.7", MSVC_VERSION: "2019"}
- {VERSION: "3.8", MSVC_VERSION: "2019"}
- {VERSION: "3.8", MSVC_VERSION: "2019", "USE_ABI3": "true", "ABI_VERSION": "cp36"}
name: "${{ matrix.PYTHON.VERSION }} ${{ matrix.WINDOWS.WINDOWS }} ${{ matrix.PYTHON.ABI_VERSION }}"
steps:
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 2

build:
image: "7.0"

Loading