aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/backends/openssl/encode_asn1.py
Commit message (Collapse)AuthorAgeFilesLines
* UniversalString needs to be encoded as UCS-4 (#5000)Marko Kreen2019-10-171-0/+2
|
* Allow FreshestCRL extension in CRL (#4975)Marko Kreen2019-09-071-0/+1
| | | Per RFC5280 it is allowed in both certificates and CRL-s.
* fix aia encoding memory leak (#4889)Paul Kehrer2019-05-181-12/+15
| | | | | | * fix aia encoding memory leak * don't return anything from the prealloc func
* Simplify string formatting (#4757)Alex Gaynor2019-02-201-1/+1
|
* encode IssuingDistributionPoint (#4618)Paul Kehrer2018-12-021-0/+23
|
* refactor some code into separate functions in asn1 encode (#4617)Paul Kehrer2018-12-011-20/+31
| | | | | | | | * refactor some code into separate functions in asn1 encode this will be useful in IDP encoding * review feedback
* allow multi-valued RDNs (#4616)Paul Kehrer2018-11-301-1/+1
| | | | RDNs can have multiple values. This allows them in FreshestCRL and upcoming IssuingDistributionPoint encoding support.
* OCSP response builder (#4485)Paul Kehrer2018-10-281-0/+4
| | | | | | | | * ocsp response builder * better prose * review changes
* support extensions in the OCSP request builder (#4481)Paul Kehrer2018-10-061-1/+11
| | | | | | | | | | * support extensions in the OCSP request builder * cover a missed branch * refactor to use new func * review feedback
* Cleanup _encode_asn1_str_gc: don't require the length as an argument (#4484)Alex Gaynor2018-10-071-10/+8
| | | | | | * Cleanup _encode_asn1_str_gc: don't require the length as an argument * Apply the same cleanup to _encode_asn1_str
* Simplify OCSP no check serialization (#4444)Alex Gaynor2018-08-311-5/+2
|
* fix encoding BMPString in x509 name entries (#4321)Paul Kehrer2018-07-091-2/+7
| | | | | | | | | | Previously we encoded them as UTF-8, but as best I can tell in reality a BMPString is fixed-width basic multilingual plane big endian encoding. This is basically UCS-2 (aka original Unicode). However, Python doesn't support UCS-2 encoding so we need to use utf_16_be. This means you can encode surrogate code points that are invalid in the context of what a BMPString is supposed to be, but in reality I strongly suspect the sane encoding ship has sailed and dozens if not hundreds of implementations both do this and expect other systems to handle their nonsense.
* Fix typo (#4178)Tim D. Smith2018-03-291-1/+1
|
* backwards incompatible change to UniformResourceIdentifier (#3954)Paul Kehrer2017-10-101-3/+4
| | | | | | | | | | | | | | | * backwards incompatible change to UniformResourceIdentifier During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies URI to accept two types: U-label strings (which raises a deprecation warning) and A-label strings (the new preferred type). There is also a constructor for URI that bypasses validation so we can parse garbage out of certificates (and round trip it if necessary) * nonsense empty commit 2.6 and codecov are the worst
* backwards incompatible change to RFC822Name (#3953)Paul Kehrer2017-10-101-3/+4
| | | | | | | | | | | | | | | * backwards incompatible change to RFC822Name During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies RFC822Name to accept two types: U-label strings (which raises a deprecation warning) and A-label strings (the new preferred type). There is also a constructor for RFC822Name that bypasses validation so we can parse garbage out of certificates (and round trip it if necessary) * whoops
* Backwards incompatible change to DNSName (#3951)Paul Kehrer2017-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Backwards incompatible change to DNSName During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies DNSName to take three different types. U-label strings (which raises a deprecation warning), A-label strings (the new preferred type), and bytes (which are assumed to be decodable to unicode strings). The latter, while supported, is primarily intended for use by our parser and allows us to return the actual encoded data in a certificate even if it has not been properly encoded to A-label before the certificate is created. (Of course, if the certificate contains invalid utf8 sequences this will still fail, but let's handle one catastrophic failure at a time). * coverage * don't delete that asterisk from a test. it does things. * no bytes in DNSName. Private constructor for bypassing validation * test unicode in dnsname (yuck) * fix docs * empty commit, you disappoint me codecov * CI is the worst
* both parse and encode the ASN1 string type for Name attributes (#3896)Paul Kehrer2017-09-251-11/+3
| | | | | | | | | | | | | | | * both parse and encode the ASN1 string type for Name attributes Previously cryptography encoded everything (except country names) as UTF8String. This caused problems with chain building in libraries like NSS where the subject and issuer are expected to match byte-for-byte. With this change we now parse and store the ASN1 string type as a private _type in NameAttribute. We then use this to encode when issuing a new certificate. This allows the CertificateBuilder to properly construct an identical issuer and fixes the issue with NSS. * make the sentinel private too
* FreshestCRL extension support (#3937)Paul Kehrer2017-09-231-3/+4
| | | | | | | | | | * add freshest CRL support * add tests * add changelog * add tests for FreshestCRL generation
* support delta crl indicator extension (#3936)Paul Kehrer2017-09-221-3/+4
| | | This is an extension for CRLs
* deprecate unicode input for RFC822Name (#3836)Paul Kehrer2017-08-011-1/+1
| | | | | | * deprecate unicode input for RFC822Name * pep8...?
* deprecate auto-idna on UniformResourceIdentifier (#3832)Paul Kehrer2017-08-011-1/+1
| | | | | | | | | | * deprecate auto-idna on UniformResourceIdentifier * fix repr test * docs * some updated language
* Begin the deprecation of auto-idna for x509.DNSName (#3830)Alex Gaynor2017-07-301-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Begin the deprecation of auto-idna for x509.DNSName Refs #3357 * fix warning * py3k fixes * fix docs * sigh * flake8 * these are words * words * tests for coverage * another test * do idna things * more idna things
* fix for latest flake8 (#3829)Alex Gaynor2017-07-271-1/+1
|
* jurisdictionCountryName also must be PrintableString (#3516)Alex Gaynor2017-05-251-2/+5
| | | | | | | | | | | | | | * jurisdictionCountryName also must be PrintableString * flake8 + citation * Write a test, which fails. If my analysis is correct, this is blocked on: https://github.com/openssl/openssl/pull/3284 * This is only true on 1.1.0 * clearly express the version requirement
* Name: add support for multi-value RDNs (#3202)Fraser Tweedale2016-11-111-9/+13
| | | | | | | | Update the Name class to accept and internally store a list of RelativeDistinguishedName objects. Add the 'rdns' attribute to give access to the RDNs. Update ASN.1 routines to correctly decode and encode multi-value RDNs. Fixes: https://github.com/pyca/cryptography/issues/3199
* support encoding IPv4Network and IPv6Network, useful for NameConstraints (#3182)Paul Kehrer2016-10-011-4/+15
| | | | | | | | | | * support encoding IPv4Network and IPv6Network, useful for NameConstraints * add changelog entry * add more networks with full and no masking (/32, /128, /0) * parametrize the nc tests to fix coverage
* fix memory leak reported in #3134 (#3135)Paul Kehrer2016-09-041-0/+4
|
* Add code style settings, new excludes, run 'test_x509_ext (Py3)' (#3041)Marti2016-08-021-5/+10
| | | | | | Fix DNSName wildcard encoding for NameConstraints Previously '.example.com' would get normalised to 'example.com', making it impossible to add wildcard NameConstraints.
* wrong assertPaul Kehrer2016-03-131-1/+1
|
* support PolicyConstraints in the CertificateBuilderPaul Kehrer2016-03-131-0/+18
|
* bytes, my nemesisPaul Kehrer2016-03-131-1/+1
|
* simplify extension creation by using X509V3_EXT_i2dPaul Kehrer2016-03-131-60/+18
|
* opaque X509_NAMEPaul Kehrer2016-03-091-13/+30
|
* move openssl asn1 decode functions to a new modulePaul Kehrer2016-01-101-1/+1
|
* remove duplicated memorybio namedtuplePaul Kehrer2016-01-101-4/+0
|
* move openssl asn1 encode functions to a new modulePaul Kehrer2016-01-101-0/+603