Commit graph

1963 commits

Author SHA1 Message Date
Paul Kehrer
1d865a8b78 Backport three fixes from master to 2.3.x (#4396)
* make a certificate expire a few years in the future, fixes doctests (#4383)

* make a certificate expire a few years in the future, fixes doctests

👋 to future alex when this test breaks in two years

* short lived certs are a good idea

* Fixes #4388 -- when running the aws-encryption-sdk tests only point pytest at one directory (#4391)

* Fixes #4388 -- when running the aws-encryption-sdk tests only point pytest at one directory

* Drop -l, there's no purpose for how we use these

* Updated wycheproof tests for new upstream vectors (#4378)

* updated tests for upstream wycheproof changes

* Updated AES tests

* oops, flake8
2018-08-14 12:45:29 -04:00
Paul Kehrer
c563b576b3 min_tag_length is an int (#4351) 2018-07-17 12:15:55 -04:00
Paul Kehrer
12a1cacb6a raise ValueError on zero length GCM IV (#4348) 2018-07-17 10:56:12 -04:00
Paul Kehrer
d4378e4293 disallow implicit tag truncation with finalize_with_tag (#4342) 2018-07-17 09:49:03 -04:00
Paul Kehrer
5d18740277 add crl.get_revoked_certificate method (#4331)
* add crl.get_revoked_certificate method

* lexicographic is the best ographic

* rename
2018-07-16 11:19:51 -04:00
Paul Kehrer
bb23c6c7cb document one shot AEAD length restrictions (#4322)
* document one shot AEAD length restrictions

* write a test that won't consume infinity ram

continue to raise OverflowError since that's what cffi did.

* this applies to associated_data too

* remove unneeded arg

* review feedback on docs
2018-07-14 23:45:16 -04:00
Paul Kehrer
01c9dac7c0 document that an ECPublicNumbers object has some unexpected properties (#4319)
* document that an ECPublicNumbers object has some unexpected properties

It is not guaranteed to be a valid point on the curve as that is not
checked until you convert it to a PublicKey object.

* different language

* move the text, make it a warning, alter the language

* new language
2018-07-09 10:43:01 -04:00
Marti Raudsepp
9e1873af35 Make RelativeDistinguishedName preserve attribtue order (#4306)
Duplicate attributes now raise an error instead of silently discarding
duplicates.
2018-07-09 18:41:18 +05:30
Alex Gaynor
d6256094b2 Make the docs clearer on why truncated tags are a bad idea (#4312)
* Make the docs clearer on why truncated tags are a bad idea

* clarify
2018-07-06 08:34:46 +05:30
Marti Raudsepp
3367806cd4 Add OID for RSASSA-PSS X.509 signature algorithm (RFC 4055) (#4294)
In 2005, IETF devised a more secure padding scheme to replace PKCS #1
v1.5. To make sure that nobody can easily support or use it, they
mandated lots of complicated parameters in the certificate, unlike any
other X.509 signature scheme.

https://tools.ietf.org/html/rfc4055

`_SIG_OIDS_TO_HASH` and `Certificate.signature_hash_algorithm` cannot be
supported as-is, because the hash algorithm is defined in the signature
algorithm parameters, not by the OID itself.
2018-06-29 16:27:28 -07:00
Paul Kehrer
4ee1cb9497 Add py37 (#4298)
* test against python 3.7 for windows

* update docs to say we test on 3.7

* more succinct

* maybe make this actually work.

* link properly

* moar changes
2018-06-27 23:07:14 -04:00
Коренберг Марк
3bab819c55 Add serialisation output examples (#4286) 2018-06-26 13:26:27 -05:00
Thom Dixon
488c04830c Make AuthorityKeyIdentifier docs reflect reality (#4252)
The `AuthorityKeyIdentifier.authority_cert_issuer` docs state that it returns a `Name` instance, but it [actually returns a list of `GeneralName` instances or `None`](https://github.com/pyca/cryptography/blob/master/src/cryptography/x509/extensions.py#L157).
2018-05-18 06:55:29 -04:00
Paul Kehrer
20b57be8d8 remove block size as a required part of HashAlgorithm (#4249)
Internal block size isn't a particularly useful piece of information and
constructions like SHA3 make it even harder to determine what that
really means. Accordingly, we're removing it from the interface (but
leaving it on all existing hashes)
2018-05-16 10:42:10 -04:00
Paul Kehrer
aedb3f0714 Add SHA512/224 and SHA512/256 test vectors from NIST CAVP (#4237) 2018-05-14 08:45:42 -04:00
Ville Skyttä
40c6d40512 Use pytest instead of py.test per upstream recommendation, #dropthedot (#4236)
http://blog.pytest.org/2016/whats-new-in-pytest-30/
https://twitter.com/hashtag/dropthedot
2018-05-13 10:23:49 -04:00
Paul Kehrer
056c9ddc41 switch to py3 on docs job (#4230)
* switch to py3 on docs job

* somehow unicode isn't a word
2018-05-12 15:17:06 -04:00
Alex Gaynor
617825d026 Fixed some confusing type descriptions in docs (#4231) 2018-05-12 14:33:19 -04:00
Paul Kehrer
36ad98fd5e Add support for extracting timestamp from a Fernet token (#4229)
* Add API for retrieving the seconds-to-expiry for the token, given a TTL.

* Process PR feedback:

* Do compute the TTL, but just the age of the token. The caller
can decided what to do next.

* Factored out the HMAC signature verification to a separate function.

* Fixed a copy&paste mistake in the test cases

* Tests cleanup.

* `struct` no longer needed

* Document `def age()`

* typo in `age()` documentation

* token, not data

* remove test for TTL expiry that is already covered by the parameterized `test_invalid()`.

* let's call this extract_timestamp and just return timestamp

* review comments

* it's UNIX I know this
2018-05-12 11:57:32 -04:00
Alex Gaynor
0830f92333 Use a checklist for bumping openssl version (#4221)
* Use a checklist for bumping openssl version

* words

* empty commit to retrigger jenkins
2018-05-09 15:34:45 -05:00
Paul Kehrer
2bc941d85d add SHA3 and SHAKE vectors (#4213)
These can be used when OpenSSL 1.1.1 is released
2018-05-09 12:45:55 -04:00
Justin Holmes
dd0518217b Updated pip wheel option in installation script. (#4212) 2018-04-30 22:22:43 -04:00
Alex Gaynor
3414f5c885 Update URLs for new pypi! (#4194)
* Update URLs for new pypi!

* trailing slash

* grump
2018-04-16 07:41:11 +08:00
Alex Gaynor
2920a310f2 Fixed links to sphinx docs (#4182) 2018-04-01 09:19:18 -05:00
Alex Gaynor
b9051a3532 updated link to sphinx docs (#4181) 2018-04-01 08:16:41 -05:00
Joshua Crowgey
99470a4648 Added badtime.pem vector (#4179)
* Added badtime.pem vector

In connection with forthcoming PR to fix #4158

* shortened line, corrected and->and
2018-03-30 13:10:29 -05:00
Paul Kehrer
9b4423b254 add botan's AESKWP vectors reformatted for our NIST loader (#4159) 2018-03-20 12:14:59 -04:00
Paul Kehrer
cd6cf4aa75 implement AES KW with padding (RFC 5649) (#3880)
* implement AES KW with padding (RFC 5649)

fixes #3791

* oops, 2.2

* make sure this is the right valueerror

* more match

* make key padding easier to read

* review feedback

* review feedback
2018-03-18 22:06:13 -04:00
Paul Kehrer
17c8f126c7 Brainpool curves (#4129)
* added brainpool ec-curves key_length >= 256bit

* limit brainpool curves to the set that appear required + docs

* oops

* typos all around me

* add brainpool ECDH kex tests

* switch to using rfc 7027 vectors

* review feedback

* empty commits are the best
2018-03-15 13:35:10 -04:00
Paul Kehrer
2250aafd6f brainpool vectors from rfc 7027 (#4143) 2018-03-15 11:59:22 -04:00
Jeremy Lainé
d87f80619b Document motivation for a KDF after key-exchange (#4005) (#4124) 2018-03-05 14:05:38 -04:00
Paul Kehrer
2c1277936b switch RSA OAEP examples to use SHA256 (#4117) 2018-02-22 09:44:46 -05:00
Alex Gaynor
98cba4142c Reorder this to reflect Alex's Opinions On What Is Good (#4115) 2018-02-22 10:25:54 +08:00
Alex Gaynor
9402044dae fixed docs with latest sphinx (#4107) 2018-02-13 19:31:05 +04:00
David Tucker
038146fdc7 Add a Versioning section to the API stability docs (#4027) 2018-01-07 10:32:36 -06:00
Alex Gaynor
15cc998c1f Fixed import path in go script (#4075) 2018-01-06 18:39:57 -06:00
Paul Kehrer
323f2ad66b add 1200 byte HKDF test vector and a generator/verifier for it (#4074)
* add 1200 byte HKDF test vector and a generator/verifier for it

* exit non-zero when failing

* ugh
2018-01-06 16:00:28 -05:00
Alex Gaynor
f8327a977f Drop conda workaround from installation docs (#4073)
I don't think it's relevant anymore
2018-01-06 10:07:40 -06:00
Paul Kehrer
754c693bc7 DH interfaces existed in 0.9 but we didn't implement until 1.7 (#4068)
* DH interfaces existed in 0.9 but we didn't implement until 1.7

* sigh empty
2018-01-05 07:51:39 -05:00
Alex Gaynor
c0c70fb78d grammar nit, use a comma here (#4066) 2017-12-29 10:09:30 -06:00
Pablo Lefort
a481e660a8 Add import default backend (#4061)
* Add import default backend

* Revert blank line in
2017-12-20 21:33:07 -05:00
Paul Kehrer
582b2b4d85 remove whirlpool vectors since we no longer support whirlpool (#4054) 2017-12-10 21:31:42 -05:00
Alex Gaynor
3e38506e0d Don't use whirlpool as an example (#4053)
Both because it's weirdo crypto, but also because we don't even support it.

Adhere to our documented policy of using good crypto for all examples
2017-12-11 08:54:02 +08:00
Alex Gaynor
270933c1a2 Use a different warning class so users get warnings (#4014)
* Use a different warning class so users get warnings

* fixed tests

* do our own warning class

* typo

* flake8
2017-11-11 12:19:05 +08:00
Alex Gaynor
30d35aef4a Fixes #3947 -- remove the docutils.conf (#3995)
* Fixes #3947 -- remove the docutils.conf

* include minimum versions
2017-10-23 18:09:27 -05:00
Alex Gaynor
a17bcba39a fixed #3986 -- properly use unicode for DNSName (#3988) 2017-10-19 20:43:46 +08:00
Chris Wolfe
af6f990064 Add Multifernet.rotate method (#3979)
* add rotate method

* add some more tests for the failure modes

* start adding some documentation for the rotate method

* operate on a single token at a time, leave lists to the caller

* add versionadded
add versionadded, drop rotate from class doctest

* give rotate a doctest

* single level, not aligned

* add changelog for mf.rotate

* show that, once rotated, the old fernet instance can no longer decrypt the token

* add the instead of just the how

* update docs to reflect removal of ttl from rotate

* update tests

* refactor internal methods so that we can extract the timestamp

* implement rotate

* update wordlist (case sensitive?)

* lints

* consistent naming

* get_token_data/get_unverified_token_data -> better name

* doc changes

* use the static method, do not treat as imethod

* move up to MultiFernet docs

* add to authors

* alter wording

* monkeypatch time to make it less possible for the test to pass simply due to calls occuring in less than one second

* set the time after encryption to make sure that the time is preserved as part of re-encryption
2017-10-19 03:23:53 +08:00
Paul Kehrer
d0db04c989 add a faq entry for a message outdated pip/setuptools can output (#3971)
* add a faq entry for a message outdated pip/setuptools can output

* attention to detail is not my strong suit
2017-10-12 00:38:06 -04:00
Paul Kehrer
4cf6e785ca expunge python 2.6 (#3962)
* expunge python 2.6

* how did THAT happen

* remove another unsupported python from the tox envlist

* hypothesis can now be unconditionally imported
2017-10-11 18:06:01 -04:00
Paul Kehrer
e885bd65a8 Update docs and changelog for URI, RFC822Name, and DNSName (#3955)
* Update docs and changelog for URI, RFC822Name, and DNSName

As of 2.1 we want users to pass A-label strings, but we still accept
U-label strings and auto-encode on their behalf (with a deprecation
warning). However, we do not return U-label in the value attribute so
we are making a backwards incompatible change for users that utilize
internationalized domain names.

* language updates

* add presentational to the word list

* the linux dictionary is pathetic
2017-10-11 08:29:23 -04:00