Commit graph

486 commits

Author SHA1 Message Date
Paul Kehrer
169c257a31 Merge pull request #2086 from alex/unify-parse-extensions
Initial stab at unifying the extension parsing code fro CSRs and certificates
2015-06-28 17:18:29 -05:00
Alex Gaynor
a4de4934a5 use a dict here 2015-06-28 16:31:58 -04:00
Alex Gaynor
e0aa76c148 Factor this code out. 2015-06-28 16:06:24 -04:00
Alex Gaynor
70add5fef5 Initial stab at unifying the extension parsing code fro CSRs and certificates 2015-06-28 11:34:02 -04:00
Paul Kehrer
bb81b34c67 move int_from_bytes so we can use it elsewhere 2015-06-27 22:28:53 -05:00
Alex Gaynor
cc3ba51f73 Improvemed branch coverage for ssh public key loading 2015-06-27 14:43:43 -04:00
Paul Kehrer
fad53a2ef0 Merge pull request #2076 from alex/more-branch-coverage
More branch coverage improvements. By virtue of reorganization and a new test
2015-06-27 10:12:03 -05:00
Alex Gaynor
1c453c25e3 More branch coverage improvements. By virtue of reorganization and a new test 2015-06-27 10:33:56 -04:00
Alex Gaynor
b63fc96254 Reorganized some code to improve branch coverage 2015-06-27 09:53:22 -04:00
Alex Gaynor
ba19c2e73f Fixed #2067 -- raise an error if a CSRbuilder doesn't hav a subject 2015-06-27 00:07:09 -04:00
Alex Gaynor
7d85341b21 Merge pull request #2071 from reaperhulk/wildcard-oh-no
handle wildcard DNSNames with IDNA.
2015-06-27 00:03:00 -04:00
Paul Kehrer
666252ce9e do this much more simply 2015-06-26 22:31:05 -05:00
Paul Kehrer
3c6bba5729 handle wildcard DNSNames with IDNA.
fixes #2054
2015-06-26 19:57:47 -05:00
Alex Gaynor
cde1ecbf18 Merge branch 'master' into param-ordering 2015-06-26 20:25:45 -04:00
Alex Gaynor
b3b0fbe2fb Make the parameter ordering in sign() consistent with other code 2015-06-26 19:57:18 -04:00
Paul Kehrer
7e2fbe670a test notimplementederror for unsupported csr extensions in backends 2015-06-26 18:51:29 -05:00
Ian Cordasco
87d61f8a6e Use utf8 to encode attribute values instead of ascii 2015-06-24 19:31:26 -05:00
Ian Cordasco
8ed8edce17 Add tests to the CSR Builder for EC and DSA keys
This skips certain tests on certain versions of differences in how
X509_REQ_sign works on those versions. A separate pull request will address
those differences.
2015-06-24 19:30:04 -05:00
Ian Cordasco
f06b6be823 Address review comments around add_extension method
- Fix typo in the docs (s/buidlder/builder/)
- Remove default from the method declaration and docs
- Replace ValueError with NotImpelementedError for unsupported X.509
  extensions
- Add TODO comment as requested by Alex
- Fix test to pass critical=False since it no longer is a default value
2015-06-24 13:35:50 -05:00
Ian Cordasco
d09ec37cb4 Only allow subject_name to be set once on a Builder 2015-06-24 13:35:50 -05:00
Ian Cordasco
b2b4b6eb91 Unconditionally encode values to ascii 2015-06-24 13:35:50 -05:00
Ian Cordasco
f0388d068f Update registering pp with ffi.gc
This makes it more in-line with existing functions, e.g., L40-L47 of
src/cryptography/hazmat/backends/openssl/x509.py @ b0e8ffa
2015-06-24 13:35:50 -05:00
Ian Cordasco
41f51ce469 Update CSR tests and implementation
- Use keyword arguments for x509.BasicConstraints in tests (missed in
  b790edbdc8fb9a026353d6fb99994326197705c7).
- Place X509_request garbage collection under assertion.
- Assert that X509 extensions created are not null.
- Don't copy the extensions list in CertificateSigningBuilder.
  They're never appended to, so copying isn't necessary.
- Use RSA key fixtures instead of generating new ones on each test run
2015-06-24 13:35:50 -05:00
Ian Cordasco
0112b02427 Address code review regarding style and gc
- Use keyword arguments for x509.BasicConstraints in several places
- Use SHA256 instead of SHA1 in documented examples
- Give function variables meaningful names in _encode_asn1_str
- Accept a x509.BasicConstraints object in _encode_basic_constraints
- Properly garbage-collect some things
- Raise a NotImplementedError instead of a ValueError
2015-06-24 13:35:50 -05:00
Andre Caron
a9a5117f9a Removes set_ prefix on CSR builder method. 2015-06-24 13:35:49 -05:00
Andre Caron
472fd6991e Changes builder extension API. 2015-06-24 13:35:49 -05:00
Andre Caron
99d0f90ff2 Removes CSR builder version setter. 2015-06-24 13:35:49 -05:00
Andre Caron
0fdf009ea0 Fixes memory leak, 2015-06-24 13:35:49 -05:00
Andre Caron
ce02de706e Extends supported range for integer conversion, 2015-06-24 13:35:49 -05:00
Andre Caron
dafd5c28b9 Fixes docstring typo. 2015-06-24 13:35:49 -05:00
Andre Caron
fc164c5e4f Adds method chaining to CSR builder. 2015-06-24 13:35:49 -05:00
Andre Caron
eebe700861 Removes OID to txt to OID conversion. 2015-06-24 13:35:48 -05:00
Andre Caron
b1103d25a7 Cleans up some GC semantics. 2015-06-24 13:35:48 -05:00
Andre Caron
a33ea283d7 Renames sign_509_request to create_x509_csr. 2015-06-24 13:35:48 -05:00
Andre Caron
ca4c4462dc Fixes memory allocation. 2015-06-24 13:35:48 -05:00
Andre Caron
0ef595f1d9 Adds CSR builder. 2015-06-24 13:35:48 -05:00
Alex Gaynor
3aadabf82f Added teh OID for ECDSA with SHA1.
In practice this is rare because the BR requires ECDSA signatures to use SHA256+ (or maybe the requirements for SHA256 just came at the same time as ECDSA, idk)
2015-06-23 22:06:21 -04:00
Paul Kehrer
370c4da9fe fix ec_cdata_to_evp_pkey bug
We weren't actually returning the object and the tests weren't catching
it because we didn't try to use the evp_pkey property in the tests. The
added test confirms it actually works.
2015-06-22 23:27:15 -05:00
Alex Gaynor
6858d62a5f remove unused import 2015-06-22 20:56:00 -04:00
Alex Gaynor
02fe5a8d2d Remove our workarounds for pyasn.1 bugs, a new pyasn.1 is out! 2015-06-22 20:45:41 -04:00
Paul Kehrer
750a37a6a5 add name constraints and general subtree struct and macro stack defs 2015-06-21 22:50:47 -05:00
Paul Kehrer
318942867e add eq/ne support to NameConstraints 2015-06-21 21:46:41 -05:00
Paul Kehrer
e0017be396 add nameconstraints classes 2015-06-21 21:09:44 -05:00
Alex Gaynor
d845ea04b8 Merge pull request #2036 from major/master
Added a repr() method to x509._Certificate
2015-06-21 11:37:51 -04:00
Major Hayden
f315af2ae6 Added a repr() method to x509._Certificate 2015-06-21 10:09:24 -05:00
Alex Gaynor
5e12f87d5c Merge pull request #2034 from reaperhulk/windows-flags
enable ASLR and NX on windows builds (affects 2.x only)
2015-06-20 19:21:43 -04:00
Stephen Holsapple
7a91823c47 Add additional CRL bindings
I sorted the X50_CRL bindings and added two additional bindings:

  1. X509_CRL_set_version
  2. X509_CRL_sort

These two functions are required to make CRL useful in pyOpenSSL re:
https://github.com/pyca/pyopenssl/issues/256
2015-06-20 15:35:53 -07:00
Paul Kehrer
dccbc9b00a enable ASLR and NX on windows builds (affects 2.x only) 2015-06-20 14:43:16 -05:00
Alex Gaynor
f1c176743d Refs #1947 -- add support for IAN to the OpenSSL backend 2015-06-20 14:20:20 -04:00
Paul Kehrer
eaf3466c79 evp_pkey in openssl asymmetric key constructors 2015-06-20 12:49:13 -05:00