Commit graph

6795 commits

Author SHA1 Message Date
Paul Kehrer
bd54a2c68f 1.8.2 changelog and version bump (#3614) 2017-05-26 02:26:45 -04:00
Paul Kehrer
d9787c4c4b various backports for 1.8.2 (#3615)
* Switch to jenkinsfile (#3525)

* [WIP] add a jenkinsfile

* various jenkinsfile fixes [ci skip]

* experiments

* escape the escaping

* can't do that with /usr/bin/env bash

* continue isolation

* bleh

* optimistically enable everything

* things

* add timeout, codecov

* derp

* sigh

* add credentials for codecov upload

* print the env

* nonsense

* checkout without jenkins because jenkins sucks

* maybe we're not allowed to shadow

* maybe if we actually pass the variable

* scope

* cd into a thing

* also here

* print the commit and run all the jobs again

* son of a

* add labels

* ch-ch-ch-changes

* damn it

* add docs, pep8, py3pep8

* try some downstreams

* make this maybe work

* this is probably what we need

* faster testing

* run this in docker duh

* delete me some dirs

* wtf

* god

* more things

* oh boy locales

* re-enable everything, remove the locales now that they're embedded

* refactor, this will probably break everything

* small test

* sigh

* actually bind some variables. also rename things to be camelCase

* oookay

* this is not gonna work

* test all the things

* add docs-linkcheck, remove libre 2.5.3 because it is bad

* syntax is for losers

* append a thing

* add yosemite, run this thing daily

* oops

* some finally cleanup

* twisted is dead to us for a brief moment

* add randomorder and setup.py test

* whatever

* re-enable twisted

* delete everything. eat arby's

* delete everything this time

* all is emptiness

* master builds should use the commit at the time it was merged (#3577)

* Fixes #3573 -- archive the built docs in that builder (#3580)

* Fixes #3573 -- archive the built docs in that builder

* syntax

* try it without this

* I am an idiot

* this is unused

* uhh, let's try this

* maybe this?

* eh, html is the only thing

* ffffuuuu

* Ignore doctree

* broader exclude

* This works now

* pin sphinx version to avoid test breakage (#3544)

* fix compilation on 1.1.0f (#3603)
2017-05-26 01:58:19 -04:00
Paul Kehrer
6c5a519f9b 1.8.1 time, oops (#3439) 2017-03-09 22:58:42 -05:00
Paul Kehrer
928e4ee285 1.8 version bump and changelog date (#3438) 2017-03-09 21:43:42 -05:00
Paul Kehrer
524e745dbb it's called macOS and let's document openssl 1.1.0 installation on mac (#3437)
* it's called macOS and let's document openssl 1.1.0 installation on mac

* wrap that line
2017-03-09 18:18:24 -05:00
Paul Kehrer
e9dbbd8d30 document that we're not building universal wheels now (#3436)
Also updates the doing a release documentation
2017-03-09 17:43:40 -05:00
Paul Kehrer
20fe2bedd9 add changelog entry, fixes #3427 (#3435) 2017-03-09 12:06:51 -05:00
Paul Kehrer
4bd9a076a8 reverts a change to our exceptions (#3429)
Trying to be too specific about why key loading fails is very difficult
when you're using the same logic across DH, EC, RSA, and DSA. This makes
it less fancy.
2017-03-09 08:21:25 -05:00
Alex Gaynor
d5e05f27f0 Refs #3430 -- fixed a memory leak in extension parsing for CRL dp (#3431)
* Refs #3430 -- fixed a memory leak in extension parsing for CRL dp

* same fix for policy info

* make this private

* consistency cleanup
2017-03-09 07:19:06 -04:00
Paul Kehrer
722235c467 missing coverage for dh_x942_serialization_supported in MultiBackend (#3432) 2017-03-08 19:37:45 -05:00
Aviv Palivoda
e44efb634f DH subgroup order (q) (#3369)
* Support DH q (subgroup order)

* Change RFC5114.txt to NIST format

* Add tests for DH q

* Update docs for DH q

* Fix pep8

* Improve test covergae for DH q

* Create _dh_params_dup that copy q if DHparams_dup don't

On OpenSSL < 1.0.2 DHparams_dup don't copy q. _dh_params_dup
call DHparams_dup and if the version is smaller than 1.0.2
copy q manually

* Copy q manually on libressl

* Add to test vectors serialized RFC5114 2048 bit DH parameters with 224 bit subgroup

* Support serialization of DH with q

* Add tests for serialization of DH with q

* Support DH serialization with q only if Cryptography_HAS_EVP_PKEY_DHX is true

* Raise exception when trying to serialize DH X9.42 when not supported

* raise unsupported key type when deserilizing DH X9.42 if not supported

* pep8 fixes

* Fix test_serialization

* Add dhx_serialization_supported method to DHBacked

* document q in dh_parameters_supported

* Rename dhx_serialization_supported to dh_x942_serialization_supported
2017-03-05 22:24:55 -04:00
Alex Gaynor
3bab4e5e35 Fixed #3422 -- Remove some legacy code which is now in 1.0.1 (#3423)
* Fixed #3422 -- Remove some legacy code which is now in 1.0.1

* _int_to_bn doesnt like negatives

* minimize the diff

* some additional cleanup
2017-03-01 10:12:11 -06:00
Alex Gaynor
64f1f429bb Update NIST urls in docs (#3418) 2017-02-27 19:25:37 -08:00
Alex Gaynor
500047b1c3 SHA-1 is broken, run for the hills (#3417) 2017-02-23 12:57:55 -06:00
Alex Gaynor
9a59ad87f6 Use HTTPS urls for a few more websites (#3416) 2017-02-23 04:38:41 -06:00
Aviv Palivoda
b1d5b32bfd Add ASN1_F_ASN1_CHECK_TLEN (#3414) 2017-02-21 19:52:46 -06:00
Alex Gaynor
8ad694c28c Fixes #3409 -- bump idna dep to a version with massively improved performance/memory usage (#3411) 2017-02-20 10:45:20 -06:00
Alex Gaynor
5ad6df9eb6 This is HTTPS now (#3407) 2017-02-18 11:52:50 -06:00
Alex Gaynor
127e862029 use official API for unreachable C code (#3404) 2017-02-18 10:28:07 -06:00
Alex Gaynor
8aa893b3c3 Two random grammar fixes (#3402) 2017-02-18 00:26:06 -06:00
Alex Gaynor
401ac6f88e Fixed #3398 -- document the serial deprecation in the changelog (#3401)
* Fixed #3398 -- document the serial deprecation in the changelog

* fix

* sigh, fix
2017-02-17 07:23:22 -06:00
Paul Kehrer
9b34ca92c3 add support for update_into on CipherContext (#3190)
* add support for update_into on CipherContext

This allows you to provide your own buffer (like recv_into) to improve
performance when repeatedly calling encrypt/decrypt on large payloads.

* another skip_if

* more skip_if complexity

* maybe do this right

* correct number of args

* coverage for the coverage gods

* add a cffi minimum test tox target and travis builder

This tests against macOS so we capture some commoncrypto branches

* extra arg

* need to actually install py35

* fix

* coverage for GCM decrypt in CC

* no longer relevant

* 1.8 now

* pep8

* dramatically simplify

* update docs

* remove unneeded test

* changelog entry

* test improvements

* coverage fix

* add some comments to example

* move the comments to their own line

* fix and move comment
2017-02-16 23:20:38 -05:00
Alex Gaynor
83d3adee77 bump openssl for tests to 1.1.0e (#3399) 2017-02-16 15:15:24 -06:00
Paul Kehrer
a39b20d6ff Refactor binding initialization to allow specified errors (#3278)
If pyca/cryptography sees any errors on the error stack during its own
initialization it immediately raises InternalError and refuses to
proceed. This was a safety measure since we weren't sure if it was
safe to proceed. However, reality has intervened and we have to
bow to the god of pragmatism and just clear the error queue. In
practice this is safe since we religiously check the error queue
in operation.
2017-02-13 19:28:02 -08:00
Paul Kehrer
4a90c25427 switch the PEM password callback to a C implementation (#3382)
* switch the PEM password callback to a C implementation

Calling from C to Python is fraught with edge cases, especially in
subinterpreter land. This commit moves the PEM password callback logic
into a small C function and then removes all the infrastructure for the
cffi callbacks (as we no longer have any)

* review feedback and update tests

* rename the struct

* aaand one more fix
2017-02-13 18:01:23 -08:00
Paul Kehrer
bd7cd2d43f faq entry for setuptools_ext issues (#3393) 2017-02-13 18:01:06 -08:00
AlexanderWeyman
979458830c Update tutorial.rst (#3394)
eliminated inconsitency of variable name in sample code
2017-02-13 10:00:19 +08:00
Aviv Palivoda
84cdca7aec Add EVP_PKEY_DHX (#3388)
* Add EVP_PKEY_DHX

* Add Cryptography_HAS_EVP_PKEY_DHX to _conditional.py
2017-02-13 08:59:16 +08:00
Paul Kehrer
f99e3f5c38 bump our latest pypy builds to use the latest pypy (#3391) 2017-02-11 12:06:57 -05:00
Alex Gaynor
54be255af5 Bump openssl on travis (#3390) 2017-02-12 00:23:43 +08:00
Alex Gaynor
5a059026a9 Fixed #3306 -- changelog entry for linking against OpenSSL 1.1.0 (#3389) 2017-02-11 23:05:34 +08:00
Paul Kehrer
f19fef1628 support defining which windows libraries to link with an env var (#3356)
* support defining which windows libraries to link with an env var

CRYPTOGRAPHY_WINDOWS_LIBRARIES is your new friend

* add some docs

* change to CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110

* lib prefixing is not a thing msvc does, right
2017-02-09 00:53:44 -05:00
Paul Kehrer
7a13085afc enforce password must be bytes when loading PEM/DER asymmetric keys (#3383)
* enforce password must be bytes when loading PEM/DER asymmetric keys

Previously we were using an ffi.buffer on the Python string, which was
allowing text implicitly, but our documentation explicitly requires
bytes.

* add changelog entry
2017-02-08 16:55:34 -05:00
Ofek Lev
0e6a129724 replace pyasn1 with asn1crypto (#3361)
* replace pyasn1 with asn1crypto

* allow trailing bytes

* fix x509 test

* update CHANGELOG.rst

* fix assert

* make asn1crypto code more idiomatic

* find tag

* final clean-up

* leave trailing byte logic unchanged

* document dependency change

* spelling

* fix spelling
2017-02-08 13:09:41 +08:00
Aviv Palivoda
1c7bd66eef Dh serialization changelog (#3385)
* Add CHANGELOG entries for DH serialization

* update AUTHORS
2017-02-08 12:38:42 +08:00
Aviv Palivoda
6723a12712 DH serialization (#3297)
* DH keys support serialization

* Add DH serialization documentation

* Add tests for DH keys serialization in DER encoding

* update version to 1.8

* Allow only SubjectPublicKeyInfo serialization

* Remove support in TraditionalOpenSSL format

* Fix pep8

* Refactor dh serialization tests
2017-02-07 21:24:56 +08:00
Mark Williams
523b132b27 Backport DH_check from OpenSSL 1.1.0. (#3375)
* Backport DH_check from OpenSSL 1.1.0.

OpenSSL 1.0.2's DH_check considers the q parameter, allowing it
validate more generators and primes; however, OpenSSL 1.1.0's DH_check
includes code to handle errors in BN functions, so it's preferred.

* Wrap DH_Check when using OpenSSL 1.1.0 or higher.

* Adding DH_CHECK_* values missing from older OpenSSLs

* Defensively guard DH_CHECK_* definitions with ifndef.

This will prevent duplicate definitions when LibreSSL supports a
version of DH_check that can return these.

* Document the OpenSSL of origin for the DH_check code
2017-02-03 17:20:00 +08:00
Paul Kehrer
a840aa2799 make cryptography fallback to /dev/urandom on mac on macOS < 10.12 (#3354) 2017-01-31 14:34:00 -05:00
Paul Kehrer
c7a2e72c6c port 1.7.2 changelog (#3371) 2017-01-28 02:45:57 -06:00
Alex Gaynor
d0c69837d2 Point people to python3-dev if needed (#3359)
* Point people to python3-dev if needed

* oops, syntax fix

* Fedora/RHEL as well
2017-01-21 22:20:54 +08:00
Alex Gaynor
4e87cf4529 Removed dead link from docs (#3360) 2017-01-21 21:50:53 +08:00
Christian Heimes
d078e546e2 Use static callbacks with Python 3.x again (#3350)
* Use static callbacks with Python 3.x again

Static callbacks were disabled for Python 3.5+ to work around an issue
with subinterpreters, locking callbacks and osrandom engine. Locking
callback and osrandom engine were replaced with a C implementations in
version 1.6 and 1.7.

https://github.com/pyca/cryptography/issues/2970

Closes: #3348
Signed-off-by: Christian Heimes <christian@python.org>

* remove unused import
2017-01-18 15:02:38 +08:00
Paul Kehrer
1bab7bcf7b add a SAN to the certificatebuilder example (#3353)
Evidently users copy/paste these examples so adding a SAN here will help
people screw up less. Fixes #3314
2017-01-18 00:44:40 -05:00
Paul Kehrer
5ab97a0694 update comment to be more descriptive (#3349) 2017-01-18 00:44:08 -05:00
Paul Kehrer
66a2372ab3 fix #3308 (#3352) 2017-01-18 00:42:09 -05:00
Dan Sully
aa396c0805 Move pkg_resources import location. (#3347) 2017-01-17 22:54:49 +08:00
Paul Kehrer
d74ba3298d add memory limit check for scrypt (#3328)
* add memory limit check for scrypt

fixes #3323

* test a pass

* move _MEM_LIMIT to the scrypt module
2017-01-05 14:11:17 -05:00
Alex Gaynor
1c2458e0ce It is 2017, in UTC (#3342) 2016-12-31 16:53:11 -08:00
Jan-Philip Gehrcke
1341bb71ee openssl backend: s/unserialize/deserialize/ in exception messages (#3339) 2016-12-28 09:46:34 -08:00
Alex Gaynor
93c1a8c815 Inline a pair of functions that became trivial post-1.0.0 (#3336) 2016-12-25 19:10:03 -08:00