aboutsummaryrefslogtreecommitdiff
path: root/tests/test_utils.py
AgeCommit message (Collapse)AuthorFilesLines
2024-06-29utils.int_to_bytes: guard against zero-length (#11173)David Buchanan1-0/+7
* utils: guard against zero-length int_to_bytes * add tests for HBKDF with llen=0 * kbkdf: guard against llen==0 * test that kbkdf rejects llen==0 at __init__ * add standalone test for zero-length int_to_bytes * Update src/cryptography/hazmat/primitives/kdf/kbkdf.py typo Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> --------- Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2024-05-05Apply ruff/flake8-implicit-str-concat rule ISC001 (#10932)Dimitri Papadopoulos Orfanos1-4/+4
ISC001 Implicitly concatenated string literals on one line This rule is currently disabled because it conflicts with the formatter: https://github.com/astral-sh/ruff/issues/8272
2022-12-21Switch from flake8 to ruff (#7920)Alex Gaynor1-3/+1
It's more than 60x faster.
2022-07-30Resolve new flake8 errors (#7462)Alex Gaynor1-18/+42
2022-01-30Remove explicit subclassing of object now that all classes are new-style (#6830)Alex Gaynor1-1/+1
As someone who first with Python in 2.4 or so, this habit is going to be hard to break.
2021-11-25Finally remove deprecated int_from_bytes (#6652)Alex Gaynor1-8/+16
2021-09-13_ModuleWithDeprecations should inherit from types.ModuleType (#6267) (#6268)Sándor Jenei1-0/+12
* _ModuleWithDeprecations should inherit from types.ModuleType (#6267) Update utils.py * fix typos reported by black * flake8 fix * Test should fail when int_from_bytes will be removed. Because this test would become pointless then.
2020-12-09Remove __future__ import from our code (#5610)Alex Gaynor1-1/+0
2020-08-26new black, actually slightly different than the old black (#5429)Paul Kehrer1-1/+2
2020-07-20Paint it Black by the Rolling Stones (#5324)Alex Gaynor1-1343/+1999
2018-12-31HTTPS a bunch of links in random places (#4666)Alex Gaynor1-4/+4
* HTTPS a bunch of links in random places * What the heck happened here?
2018-09-06update pytest config (#4463)Paul Kehrer1-2/+4
* update pytest config pytest 3.8.0 was just released and officially deprecates some of the way we do pytest marks. They introduced a new way to do this in 3.6 so this PR switches to that mechanism and updates our minimum pytest requirement * update the stubs * also update wycheproof test config to remove deprecated paths * don't need this any more
2018-03-18Allow DSA q=224 (#4147)Paul Kehrer1-47/+0
* load Q=224 vectors * DSA parameters should support 224 for q length * oxford comma
2017-06-21implement CCM vector parser (#3699)Paul Kehrer1-3/+187
2017-06-20ed25519 vector loader (#3707)Paul Kehrer1-1/+93
* ed25519 vector loader * refactor to use unpacking
2017-06-03call check_backend_support directly from backend fixture (#3666)Alex Gaynor1-16/+4
2017-06-03Switched our backend to be a normal fixture in tests (#3665)Alex Gaynor1-12/+1
2017-05-20Delete some code (#3563)Alex Gaynor1-44/+1
* Delete some code * removed import * delete more code
2016-04-13Adding CAVP vector parsing for NIST SP 800-108 KDF vectors. (#2865)Jared1-3/+96
2015-10-13Fix load_kasvs_ecdh_vectors() COUNT sourcingSimo Sorce1-2/+2
COUNT is a decimal number in test files, but was erroneously read and converted as if the source was a hexadecimal number. Fix the loader and test the fix. Signed-off-by: Simo Sorce <simo@redhat.com>
2015-09-24Some cleanupsAlex Gaynor1-10/+10
2015-09-24Add vector loader for X9.63 vectorsSimo Sorce1-0/+81
Signed-off-by: Simo Sorce <simo@redhat.com>
2015-08-01add test to cover partial branch in load_kasvs_ecdh_vectorsPaul Kehrer1-0/+4
The loop to find supported parameter sets is partially covered otherwise
2015-08-01add a line for the ecdh vector loader to cover a missed branchPaul Kehrer1-0/+1
2015-07-02fixed testsAlex Gaynor1-2/+2
2015-05-06Modify ECDH Test vector loader for KDF vectorsSimo Sorce1-0/+69
Also add tests for the new vectors Signed-off-by: Simo Sorce <simo@redhat.com>
2015-05-01Add loader for ECDH test vectorsSimo Sorce1-1/+293
Also fix test vector files, they had a truncated line for the EE set in both init and resp files. Signed-off-by: Simo Sorce <simo@redhat.com>
2014-11-27add encode_rfc6979_signature and refactor tests to use itPaul Kehrer1-21/+1
2014-11-16Update the license header for every source file, as well as the documentation.Alex Gaynor1-12/+3
Fixes #1209
2014-10-25move skip_if_empty to separate function for test coveragePaul Kehrer1-1/+8
2014-10-23Change how we represented that a test requires a backend.Alex Gaynor1-19/+6
This way is more extensible and requires less maintaince
2014-08-10KASVS vector loaderAlex Stapleton1-3/+456
2014-04-30negative testPaul Kehrer1-0/+3
2014-04-30rename dss_sig_value -> der_encode_dsa_signaturePaul Kehrer1-6/+8
2014-04-30use pyasn1 for creating the dss-sig-value structurePaul Kehrer1-11/+0
2014-04-30dss_sig_value: Pure python conversion of (r, s) to byte streamPaul Kehrer1-5/+31
2014-04-25Fix some typos.Alex Gaynor1-1/+1
Found with https://github.com/intgr/topy/
2014-04-22fix a coverage miss in the dsa sig vector loaderPaul Kehrer1-0/+11
2014-04-22Modify DSA SigVer loader to be able to load SigGen vectorsMohammed Attia1-2/+234
2014-04-22Add DSA SigVer vectors loaderMohammed Attia1-39/+296
2014-04-19SigVer.rsp loadingAlex Stapleton1-4/+7
2014-04-16Missed an unhexlifyAlex Stapleton1-1/+1
2014-04-15Use binascii.hexlify instead of just hexlifyAlex Stapleton1-4/+4
2014-04-13ECDSA SigGen.{txt,rsp} vector loaderAlex Stapleton1-2/+161
2014-04-12ECDSA vector loaderAlex Stapleton1-2/+124
2014-03-29expand pkcs1 loader to support OAEP as wellPaul Kehrer1-0/+214
2014-03-27Pain the bikeshed a different colourAlex Stapleton1-1/+1
2014-03-27Fixes to @alex's commentsAlex Stapleton1-17/+20
2014-03-27Update testsAlex Stapleton1-11/+16
2014-03-27Address most of my own commentsAlex Stapleton1-1/+32