diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2018-08-31 17:43:39 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-08-31 18:43:39 -0400 |
commit | abfd57240cc7f0004eb513520d612dafe282dd16 (patch) | |
tree | 98a590494de62c8d71020c0fbd5dbecfb48baa3b | |
parent | c4cd5ba933d26a2602295d3de95d50585523594c (diff) | |
download | cryptography-abfd57240cc7f0004eb513520d612dafe282dd16.tar.gz cryptography-abfd57240cc7f0004eb513520d612dafe282dd16.tar.bz2 cryptography-abfd57240cc7f0004eb513520d612dafe282dd16.zip |
Simplify OCSP no check serialization (#4444)
-rw-r--r-- | src/_cffi_src/openssl/asn1.py | 3 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/encode_asn1.py | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/_cffi_src/openssl/asn1.py b/src/_cffi_src/openssl/asn1.py index 51acf10c..82bf7979 100644 --- a/src/_cffi_src/openssl/asn1.py +++ b/src/_cffi_src/openssl/asn1.py @@ -30,6 +30,7 @@ typedef struct asn1_string_st ASN1_UTF8STRING; typedef ... ASN1_TYPE; typedef ... ASN1_GENERALIZEDTIME; typedef ... ASN1_ENUMERATED; +typedef ... ASN1_NULL; static const int V_ASN1_GENERALIZEDTIME; @@ -97,6 +98,8 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *, ASN1_INTEGER *); int i2d_ASN1_TYPE(ASN1_TYPE *, unsigned char **); ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **, const unsigned char **, long); + +ASN1_NULL *ASN1_NULL_new(void); """ CUSTOMIZATIONS = """ diff --git a/src/cryptography/hazmat/backends/openssl/encode_asn1.py b/src/cryptography/hazmat/backends/openssl/encode_asn1.py index a2c7ed73..896ea055 100644 --- a/src/cryptography/hazmat/backends/openssl/encode_asn1.py +++ b/src/cryptography/hazmat/backends/openssl/encode_asn1.py @@ -245,11 +245,8 @@ def _txt2obj_gc(backend, name): def _encode_ocsp_nocheck(backend, ext): - """ - The OCSP No Check extension is defined as a null ASN.1 value embedded in - an ASN.1 string. - """ - return _encode_asn1_str_gc(backend, b"\x05\x00", 2) + # Doesn't need to be GC'd + return backend._lib.ASN1_NULL_new() def _encode_key_usage(backend, key_usage): |