summaryrefslogtreecommitdiff
path: root/tests/hazmat/primitives
AgeCommit message (Collapse)Author
2021-11-11Upgrade cryptography from 2.5 to 3.3Lucia Li
Source code is from https://github.com/pyca/cryptography/tree/3.3.x Run setup.py locally and rename _openssl.so/_padding.so Bug: 205265538 Test: None Change-Id: If031739ef5830ba2fb177add74515e4660e2906e
2019-01-20deprecate encode_point and migrate all internal callers (#4720)Paul Kehrer
2019-01-20add support for encoding compressed points (#4638)Paul Kehrer
* add support for encoding compressed points * review feedback
2019-01-19shake128/256 support (#4611)Paul Kehrer
* shake128/256 support * remove block_size * doc an exception * change how we detect XOF by adding _xof attribute * interface! * review feedback
2019-01-17support byteslike in KBKDFHMAC (#4711)Paul Kehrer
2019-01-17support byteslike in ConcatKDF{HMAC,Hash}, Scrypt, and X963KDF (#4709)Paul Kehrer
* byteslike concatkdf * byteslike scrypt * byteslike x963kdf
2019-01-17support byteslike for OTP (#4710)Paul Kehrer
2019-01-17normalize KBKDF tests (#4708)Paul Kehrer
2019-01-17Support byteslike in HKDF and PBKDF2HMAC (#4707)Paul Kehrer
* support byteslike in HKDF * support byteslike in PBKDF2HMAC * add missing docs
2019-01-17support bytes-like for X25519PrivateKey.from_private_bytes (#4698)Paul Kehrer
yuck.
2019-01-17x448 and x25519 should enforce key lengths in backend (#4703)Paul Kehrer
* x448 and x25519 should enforce key lengths in from_private_bytes they should also check if the algorithm is supported like the public bytes class methods do * oops * move the checks
2019-01-17support byteslike in hmac update (#4705)Paul Kehrer
needed for some KDF keying material
2019-01-16support byteslike in hash updates (#4702)Paul Kehrer
This is needed to handle keying material in some of the KDFs
2019-01-16support bytes-like keys in CMAC and HMAC contexts (#4701)Paul Kehrer
2019-01-16add support for byteslike password/data to load_{pem,der}_private_key (#4693)Paul Kehrer
* add support for byteslike password/data to load_{pem,der}_private_key * pypy 5.4 can't do memoryview from_buffer
2019-01-15support byteslike in aead for key and nonce (#4695)Paul Kehrer
2019-01-15support byteslike in X448PrivateKey.from_private_bytes (#4694)Paul Kehrer
2019-01-15add support for byteslike on password and data for pkcs12 loading (#4690)Paul Kehrer
* add support for byteslike on password and data for pkcs12 loading * use a contextmanager to yield a null terminated buffer we can zero * review feedback * updated text * one last change
2019-01-14Serialization x25519 (#4688)Paul Kehrer
* modify x25519 serialization to match x448 supports raw and pkcs8 encoding on private_bytes supports raw and subjectpublickeyinfo on public_bytes deprecates zero argument call to public_bytes * add docs * this is public now * don't need that * review feedback
2019-01-13support x448 public/private serialization both raw and pkcs8 (#4653)Paul Kehrer
* support x448 public/private serialization both raw and pkcs8 * add tests for all other asym key types to prevent Raw * more tests * better tests * fix a test * funny story, I'm actually illiterate. * pep8 * require PrivateFormat.Raw or PublicFormat.Raw with Encoding.Raw * missing docs * parametrize * docs fixes * remove dupe line * assert something
2018-12-17handle empty byte string in from_encoded_point (#4649)Paul Kehrer
* handle empty byte string in from_encoded_point * move the error
2018-12-11deprecate old from_encoded_point (#4640)Paul Kehrer
2018-12-11Compressed point support (#4629)Paul Kehrer
* compressed point support * refactor to use oct2point directly * small docs change * remove deprecation for the moment and a bit of review feedback * no backend arg, implicitly import it * missed a spot * double oops * remove superfluous call * use refactored method * use vector file * one last item
2018-12-09allow bytes-like for key/iv/data for symmetric encryption (#4621)Paul Kehrer
* allow bytearrays for key/iv for symmetric encryption * bump pypy/cffi requirements * update docs, fix some tests * old openssl is naught but pain * revert a typo * use trusty for old pypy * better error msg again * restore match
2018-12-08Raise MemoryError when backend.derive_scrypt can't malloc enough (#4592)Tux
* Raise MemoryError when backend.derive_scrypt can't malloc enough * Expose ERR_R_MALLOC_FAILURE and use the reason_match pattern to catch it * Add test_scrypt_malloc_failure in test_scrypt * let's see if this passes * add comment to filippo's blog post about scrypt's params
2018-11-28PKCS12 Basic Parsing (#4553)Paul Kehrer
* PKCS12 parsing support * running all the tests is so gauche * rename func * various significant fixes * dangerous idiot here * move pkcs12 * docs updates * a bit more prose
2018-11-22X448 support (#4580)Paul Kehrer
* x448 support This work was originally authored by derwolfe * update docs to have a more useful derived key length * error if key is not a valid length in from_public_bytes * one more * switch to using evp_pkey_keygen_gc for x448 keygen * review feedback * switch to using evp_pkey_derive * nit fix
2018-11-22add sha3 support (#4573)Paul Kehrer
* add sha3 support * missed versionadded * add prose, remove block_size
2018-11-12error if the key length for x25519 isn't 32 bytes (#4584)Paul Kehrer
* error if the key length for x25519 isn't 32 bytes * also test 33
2018-11-12add SHA512/224 and SHA512/256 support (#4575)Paul Kehrer
* add SHA512/224 and SHA512/256 support * add missing docs
2018-11-04parametrize a bunch of tests (#4365)Paul Kehrer
2018-10-29create & use _evp_md_from_algorithm and _evp_md_non_null_from_algorithm (#4542)Paul Kehrer
* create & use _evp_md_from_algorithm and _evp_md_non_null_from_algorithm * remove unused import
2018-07-28Test for expected CryptographyDeprecationWarnings (#4372)Tim Burke
The remaining calls to `signer()` and `verifier()` are exercising the deprecated API intentionally. Let's test that the deprecation warnings are being raised as expected. Closes #4311; see also #4314.
2018-07-23block_size isn't part of our interface and future hashes won't have it (#4366)Paul Kehrer
2018-07-18improve skip msg when skipping an ECDH test in test_ec (#4355)Paul Kehrer
2018-07-17also check iv length for GCM nonce in AEAD (#4350)Paul Kehrer
* also check iv length for GCM nonce in AEAD * ugh
2018-07-17raise ValueError on zero length GCM IV (#4348)Paul Kehrer
2018-07-17disallow implicit tag truncation with finalize_with_tag (#4342)Paul Kehrer
2018-07-16Change the exception we raise in keywrap unwrapping on invalid length (#4337)Alex Gaynor
I believe this can reasonably be considered backwards compatible since other invalid inputs already lead to InvalidUnwrap, and clients shouldn't be distinguishing between these two conditions, and ValueError wasn't documented anyways.
2018-07-14document one shot AEAD length restrictions (#4322)Paul Kehrer
* 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-12raise valueerror for null x25519 derived keys (#4332)Paul Kehrer
* raise valueerror for null x25519 derived keys OpenSSL errors when it hits this edge case and a null shared key is bad anyway so let's raise an error * empty commit
2018-07-10we don't actually care about the errstack here, it's an invalid signature ↵Paul Kehrer
(#4325) * we don't actually care about the errstack here, it's an invalid signature We previously had no cases where we could error without getting errors on the error stack, but wycheproof contains test cases that can error without adding anything to the stack. Accordingly, we should clear the stack but raise InvalidSignature no matter what (rather than InternalError if we have no error msgs) * add a test
2018-07-06reduce number of deprecated signer/verifier calls in test_rsa (#4314)Paul Kehrer
2018-07-04Fixes #4242 -- added an additional assert to make this test more resillient ↵Alex Gaynor
(#4308)
2018-06-20Add clearer message when key type is not bytes (#4289)Vladyslav Moisieienkov
* Add clearer message in Cipher when key is not bytes * Change location of key type check to verify_key_size function * Replace formated error message with static * Add key type check tests to all ciphers constructors * Change key type error message to lowercase
2018-06-19Correctly pass bytes; refs #4289 (#4290)Alex Gaynor
2018-06-19Correct pass bytes; refs #4289 (#4291)Alex Gaynor
2018-05-30simplify and parametrize DSA tests (#4267)Paul Kehrer
2018-05-30parametrize a few things in test_ec (#4268)Paul Kehrer
2018-05-14Validate the public/private halves of EC keys on import. (#4241)David Benjamin
* Validate the public/private halves of EC keys on import. OpenSSL's API is a little finicky. If one sets the public key before the private key, it does not validate that they match. If set in the other order, it does validate this. In particular, KASValidityTest_ECCStaticUnified_NOKC_ZZOnly_init.fax describes error code 7 as: Result = F (7 - IUT's Static private key d changed-prikey validity) Reordering the two operations makes those tests to fail on key import, which is what CAVP appears to have intended. * Wrap to 79 rather than 80 columns