aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_serialization.py
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup serialize (#5149)Marko Kreen2020-05-251-4/+119
| | | | | | | | | | | | | | * Additional tests for public/private_bytes They expose few places that raise TypeError and AssertionError! before, and ValueError later. * Cleanup of private_bytes() backend Also pass key itself down to backend. * Cleanup of public_bytes() backend * Test handling of unsupported key type
* add new branch for unsupported openssh serialization (#4813)Paul Kehrer2019-03-181-1/+10
| | | | | we don't support ed448 openssh keys so we'll use that to test this branch. if we ever do support ed448 keys we can always just call this private method directly to keep coverage.
* add OpenSSH serialization for ed25519 keys (#4808) (#4811)bernhl2019-03-171-0/+11
| | | | | | * add OpenSSH serialization for ed25519 keys (#4808) * address review comments
* support ed25519 openssh public keys (#4785)Paul Kehrer2019-02-271-1/+37
| | | | | | * support ed25519 openssh public keys * don't need this check
* ed448 support (#4610)Paul Kehrer2019-02-271-0/+64
| | | | | | | | * ed448 support * move the changelog entry * flake8
* ed25519 support (#4114)Paul Kehrer2019-02-261-0/+64
| | | | | | * ed25519 support * review feedback
* add support for byteslike password/data to load_{pem,der}_private_key (#4693)Paul Kehrer2019-01-161-0/+49
| | | | | | * add support for byteslike password/data to load_{pem,der}_private_key * pypy 5.4 can't do memoryview from_buffer
* Serialization x25519 (#4688)Paul Kehrer2019-01-141-0/+64
| | | | | | | | | | | | | | | | | * 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
* support x448 public/private serialization both raw and pkcs8 (#4653)Paul Kehrer2019-01-131-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Dh parameters serialization (#3504)Aviv Palivoda2017-06-241-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support DH parameter serizalization - no X9.42 * Support X9.42 serialization - DER not working * Fix dhp_rfc5114_2.der Changing the DER parameters serialization after the fix in openssl commit a292c9f1b835 * DH parameters X9.42 DER serialization fixed * fix _skip_dhx_unsupported * document DH parameter_bytes * PEP8 fixes * Document load_pem_parameters * Document load_der_parameters * document ParameterFormat * Increase test coverage * Increase test covrage * Remove unneeded check * Fix typo * Fix error in load_der_parameters * Add load_pem_parameters and load_der_parameters to interfaces * CR fixes * Removed unverified phrase * Update version to 2.0 * Fix pep8 * Rename ParameterFormat.ASN1 to ParameterFormat.DHParameter * link pkcs3 * Add new line at end of file to serialization.rst * Rename DHparameters to PKCS3 * doc CR fix
* reverts a change to our exceptions (#3429)Paul Kehrer2017-03-091-17/+8
| | | | | 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.
* DH subgroup order (q) (#3369)Aviv Palivoda2017-03-051-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* enforce password must be bytes when loading PEM/DER asymmetric keys (#3383)Paul Kehrer2017-02-081-0/+39
| | | | | | | | | | * 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
* Handle two more error conditions correctlyAlex Gaynor2016-04-021-0/+11
| | | | | | * Handle two more error conditions correctly * fixed test case
* Fixes #2199 -- allow SSH keys to have spaces in their commentsAlex Gaynor2015-08-031-6/+4
|
* require serialization in asym testsPaul Kehrer2015-06-271-46/+39
|
* Fixed the deprecation warnings being triggered by the testsAlex Gaynor2015-03-101-6/+6
|
* support "PKCS1" RSA public keysPaul Kehrer2015-03-051-1/+9
|
* address review commentsPaul Kehrer2015-02-251-19/+4
|
* Support for traditional OpenSSL and PKCS8 RSA private key serializationPaul Kehrer2015-02-251-2/+27
|
* Fixed the use of deprecated names in the serialization testsAlex Gaynor2015-02-241-33/+28
|
* remove unneeded parensPaul Kehrer2015-02-221-2/+2
|
* support DER public and private key loading in the openssl backendPaul Kehrer2015-02-191-2/+267
|
* Get us up to 100% coverageAlex Gaynor2014-12-251-0/+10
|
* Added test cases for NIST P-384 and 521. Fixed handling of key sizes which ↵Alex Gaynor2014-12-251-0/+49
| | | | aren't divisibly by 8
* Write some tests for failure casesAlex Gaynor2014-12-251-0/+29
|
* this test requires a specific curveAlex Gaynor2014-12-241-0/+2
|
* Fixes #1533 -- Initial work at parsing ECDSA public keys in OpenSSH formatAlex Gaynor2014-12-241-1/+26
|
* add both types of EC key formats to parametrized testPaul Kehrer2014-12-231-6/+7
|
* final cleanup for PEM serializationPaul Kehrer2014-12-231-60/+11
|
* Combined duplicated serialization testsAlex Gaynor2014-12-231-23/+5
|
* Merge pull request #1567 from reaperhulk/consolidate-moreAlex Stapleton2014-12-221-25/+19
|\ | | | | consolidate dsa serialization loading tests and improve verifier
| * consolidate dsa serialization loading tests and improve verifierPaul Kehrer2014-12-221-25/+19
| |
* | parametrize some more serialization testsPaul Kehrer2014-12-221-57/+31
|/
* Reduce duplication in the serialization tests -- refs #1564Alex Gaynor2014-12-211-35/+22
|
* modify serialization tests to not use deprecated functionsPaul Kehrer2014-12-181-35/+32
|
* update docs, hoist b64decode up and re-add test for itPaul Kehrer2014-12-171-1/+7
|
* add OpenSSH DSS public key loadingPaul Kehrer2014-12-161-24/+120
| | | | fixes #1531
* Added two more tests to get coverage back upAlex Gaynor2014-12-151-1/+17
|
* A handful of tiny fixesAlex Gaynor2014-12-151-32/+37
|
* Added better parsing for RFC 4251 string and mpint values.Mark Adams2014-12-141-0/+45
| | | | | Also moved several of the SSH key splitting and validation checks up into the load_ssh_public_key method since they will apply to more than just RSA. Added additional checks to make sure the key doesn't contain extraneous data
* Removed redundant tests for _load_ssh_rsa_public_key since it is now a ↵Mark Adams2014-12-131-67/+24
| | | | non-public part of the API and made a number of minor changes to tests and documentation
* Standardized the assignment statement for str_key in TestSSHSerialization.Mark Adams2014-12-131-16/+16
|
* Privatized the load_ssh_rsa_public_key function and fixed some coverage ↵Mark Adams2014-12-131-43/+39
| | | | issues on test_serialization.
* Added load_ssh_rsa_public_key to hazmat.primitives.serialization to allow ↵Mark Adams2014-12-131-3/+100
| | | | | | for loading of OpenSSH RSA public keys Also added load_ssh_public_key as a generic method that can be later extended to support more public key algorithms.
* Update the license header for every source file, as well as the documentation.Alex Gaynor2014-11-161-13/+3
| | | | Fixes #1209
* Change how we represented that a test requires a backend.Alex Gaynor2014-10-231-6/+12
| | | | This way is more extensible and requires less maintaince
* Wrap lines appropriatelyAlex Gaynor2014-09-291-2/+1
|
* add curve name parsing to public key loaderPaul Kehrer2014-09-261-0/+2
|
* Process curve name when loading EC keys. Fixes #1336Paul Kehrer2014-09-261-0/+2
|