diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2021-10-19 19:42:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-19 07:42:32 -0400 |
| commit | fb9186eb4bfd68830bdf9947f0fa0a2efbd2e6b2 (patch) | |
| tree | bd7d7a57a56765b2ea06e693106d93ea314ac1fb /src/_cffi_src/openssl | |
| parent | 16f6e14818dbebe71f8bdf6dbf9e4917c193470b (diff) | |
| download | cryptography-fb9186eb4bfd68830bdf9947f0fa0a2efbd2e6b2.tar.gz | |
shrink bindings now that we have oxidized all extensions (#6442)
* shrink bindings now that we have oxidized all extensions
* re-add for pyopenssl
* another pyopenssl required binding
Diffstat (limited to 'src/_cffi_src/openssl')
| -rw-r--r-- | src/_cffi_src/openssl/x509.py | 14 | ||||
| -rw-r--r-- | src/_cffi_src/openssl/x509v3.py | 142 |
2 files changed, 3 insertions, 153 deletions
diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py index 778894303..0090f1a25 100644 --- a/src/_cffi_src/openssl/x509.py +++ b/src/_cffi_src/openssl/x509.py @@ -174,17 +174,9 @@ int X509_EXTENSION_get_critical(X509_EXTENSION *); int X509_REVOKED_get_ext_count(X509_REVOKED *); X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *, int); -/* This became const X509_CRL * in 1.1.0 */ -X509_EXTENSION *X509_CRL_get_ext(X509_CRL *, int); -int X509_CRL_get_ext_count(X509_CRL *); - -int X509_CRL_get0_by_serial(X509_CRL *, X509_REVOKED **, ASN1_INTEGER *); - X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *); X509_REVOKED *Cryptography_X509_REVOKED_dup(X509_REVOKED *); -int X509_get_signature_nid(const X509 *); - const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *); long X509_get_version(X509 *); @@ -217,12 +209,6 @@ void sk_X509_EXTENSION_pop_free(X509_EXTENSIONS *, sk_X509_EXTENSION_freefunc); int sk_X509_REVOKED_num(Cryptography_STACK_OF_X509_REVOKED *); X509_REVOKED *sk_X509_REVOKED_value(Cryptography_STACK_OF_X509_REVOKED *, int); -Cryptography_STACK_OF_X509_CRL *sk_X509_CRL_new_null(void); -void sk_X509_CRL_free(Cryptography_STACK_OF_X509_CRL *); -int sk_X509_CRL_num(Cryptography_STACK_OF_X509_CRL *); -int sk_X509_CRL_push(Cryptography_STACK_OF_X509_CRL *, X509_CRL *); -X509_CRL *sk_X509_CRL_value(Cryptography_STACK_OF_X509_CRL *, int); - long X509_CRL_get_version(X509_CRL *); ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *); ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *); diff --git a/src/_cffi_src/openssl/x509v3.py b/src/_cffi_src/openssl/x509v3.py index fae312c8a..4c6f9b4a4 100644 --- a/src/_cffi_src/openssl/x509v3.py +++ b/src/_cffi_src/openssl/x509v3.py @@ -13,14 +13,9 @@ INCLUDES = """ * together with another opaque typedef for the same name in the TYPES section. * Note that the result is an opaque type. */ -typedef STACK_OF(ACCESS_DESCRIPTION) Cryptography_STACK_OF_ACCESS_DESCRIPTION; -typedef STACK_OF(DIST_POINT) Cryptography_STACK_OF_DIST_POINT; -typedef STACK_OF(GENERAL_SUBTREE) Cryptography_STACK_OF_GENERAL_SUBTREE; """ TYPES = """ -typedef ... Cryptography_STACK_OF_ACCESS_DESCRIPTION; -typedef ... Cryptography_STACK_OF_GENERAL_SUBTREE; typedef ... EXTENDED_KEY_USAGE; typedef ... CONF; @@ -30,30 +25,14 @@ typedef struct { ...; } X509V3_CTX; -static const int GEN_OTHERNAME; static const int GEN_EMAIL; -static const int GEN_X400; static const int GEN_DNS; static const int GEN_URI; -static const int GEN_DIRNAME; -static const int GEN_EDIPARTY; -static const int GEN_IPADD; -static const int GEN_RID; -typedef struct { - ASN1_OBJECT *type_id; - ASN1_TYPE *value; -} OTHERNAME; - -typedef struct { - ...; -} EDIPARTYNAME; - -typedef struct { - Cryptography_STACK_OF_GENERAL_SUBTREE *permittedSubtrees; - Cryptography_STACK_OF_GENERAL_SUBTREE *excludedSubtrees; -} NAME_CONSTRAINTS; +typedef ... OTHERNAME; +typedef ... EDIPARTYNAME; +typedef struct stack_st_GENERAL_NAME GENERAL_NAMES; typedef struct { int type; @@ -79,136 +58,21 @@ typedef struct { } d; ...; } GENERAL_NAME; - -typedef struct { - GENERAL_NAME *base; - ASN1_INTEGER *minimum; - ASN1_INTEGER *maximum; -} GENERAL_SUBTREE; - -typedef struct stack_st_GENERAL_NAME GENERAL_NAMES; - -typedef struct { - ASN1_OCTET_STRING *keyid; - GENERAL_NAMES *issuer; - ASN1_INTEGER *serial; -} AUTHORITY_KEYID; - -typedef struct { - ASN1_OBJECT *method; - GENERAL_NAME *location; -} ACCESS_DESCRIPTION; - - -typedef ... Cryptography_STACK_OF_DIST_POINT; - -typedef struct { - int type; - union { - GENERAL_NAMES *fullname; - Cryptography_STACK_OF_X509_NAME_ENTRY *relativename; - } name; - ...; -} DIST_POINT_NAME; - -typedef struct { - DIST_POINT_NAME *distpoint; - ASN1_BIT_STRING *reasons; - GENERAL_NAMES *CRLissuer; - ...; -} DIST_POINT; - -typedef struct { - DIST_POINT_NAME *distpoint; - int onlyuser; - int onlyCA; - ASN1_BIT_STRING *onlysomereasons; - int indirectCRL; - int onlyattr; -} ISSUING_DIST_POINT; - -typedef void (*sk_GENERAL_NAME_freefunc)(GENERAL_NAME *); -typedef void (*sk_DIST_POINT_freefunc)(DIST_POINT *); -typedef void (*sk_ACCESS_DESCRIPTION_freefunc)(ACCESS_DESCRIPTION *); """ FUNCTIONS = """ void X509V3_set_ctx(X509V3_CTX *, X509 *, X509 *, X509_REQ *, X509_CRL *, int); int GENERAL_NAME_print(BIO *, GENERAL_NAME *); -GENERAL_NAMES *GENERAL_NAMES_new(void); void GENERAL_NAMES_free(GENERAL_NAMES *); void *X509V3_EXT_d2i(X509_EXTENSION *); /* The last two char * args became const char * in 1.1.0 */ X509_EXTENSION *X509V3_EXT_nconf(CONF *, X509V3_CTX *, char *, char *); -/* This is a macro defined by a call to DECLARE_ASN1_FUNCTIONS in the - x509v3.h header. */ -AUTHORITY_KEYID *AUTHORITY_KEYID_new(void); -void AUTHORITY_KEYID_free(AUTHORITY_KEYID *); - -NAME_CONSTRAINTS *NAME_CONSTRAINTS_new(void); -void NAME_CONSTRAINTS_free(NAME_CONSTRAINTS *); - -OTHERNAME *OTHERNAME_new(void); -void OTHERNAME_free(OTHERNAME *); void *X509V3_set_ctx_nodb(X509V3_CTX *); -int i2d_GENERAL_NAMES(GENERAL_NAMES *, unsigned char **); - int sk_GENERAL_NAME_num(struct stack_st_GENERAL_NAME *); -int sk_GENERAL_NAME_push(struct stack_st_GENERAL_NAME *, GENERAL_NAME *); GENERAL_NAME *sk_GENERAL_NAME_value(struct stack_st_GENERAL_NAME *, int); -void sk_GENERAL_NAME_pop_free(struct stack_st_GENERAL_NAME *, - sk_GENERAL_NAME_freefunc); - -Cryptography_STACK_OF_ACCESS_DESCRIPTION *sk_ACCESS_DESCRIPTION_new_null(void); -int sk_ACCESS_DESCRIPTION_num(Cryptography_STACK_OF_ACCESS_DESCRIPTION *); -ACCESS_DESCRIPTION *sk_ACCESS_DESCRIPTION_value( - Cryptography_STACK_OF_ACCESS_DESCRIPTION *, int -); -void sk_ACCESS_DESCRIPTION_free(Cryptography_STACK_OF_ACCESS_DESCRIPTION *); -void sk_ACCESS_DESCRIPTION_pop_free(Cryptography_STACK_OF_ACCESS_DESCRIPTION *, - sk_ACCESS_DESCRIPTION_freefunc); -int sk_ACCESS_DESCRIPTION_push(Cryptography_STACK_OF_ACCESS_DESCRIPTION *, - ACCESS_DESCRIPTION *); - -ACCESS_DESCRIPTION *ACCESS_DESCRIPTION_new(void); -void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *); - -Cryptography_STACK_OF_DIST_POINT *sk_DIST_POINT_new_null(void); -void sk_DIST_POINT_free(Cryptography_STACK_OF_DIST_POINT *); -int sk_DIST_POINT_num(Cryptography_STACK_OF_DIST_POINT *); -DIST_POINT *sk_DIST_POINT_value(Cryptography_STACK_OF_DIST_POINT *, int); -int sk_DIST_POINT_push(Cryptography_STACK_OF_DIST_POINT *, DIST_POINT *); -void sk_DIST_POINT_pop_free(Cryptography_STACK_OF_DIST_POINT *, - sk_DIST_POINT_freefunc); -void CRL_DIST_POINTS_free(Cryptography_STACK_OF_DIST_POINT *); - -Cryptography_STACK_OF_GENERAL_SUBTREE *sk_GENERAL_SUBTREE_new_null(void); -void sk_GENERAL_SUBTREE_free(Cryptography_STACK_OF_GENERAL_SUBTREE *); -int sk_GENERAL_SUBTREE_num(Cryptography_STACK_OF_GENERAL_SUBTREE *); -GENERAL_SUBTREE *sk_GENERAL_SUBTREE_value( - Cryptography_STACK_OF_GENERAL_SUBTREE *, int -); -int sk_GENERAL_SUBTREE_push(Cryptography_STACK_OF_GENERAL_SUBTREE *, - GENERAL_SUBTREE *); - -GENERAL_SUBTREE *GENERAL_SUBTREE_new(void); - -X509_EXTENSION *X509V3_EXT_i2d(int, int, void *); - -DIST_POINT *DIST_POINT_new(void); -void DIST_POINT_free(DIST_POINT *); - -DIST_POINT_NAME *DIST_POINT_NAME_new(void); -void DIST_POINT_NAME_free(DIST_POINT_NAME *); - -GENERAL_NAME *GENERAL_NAME_new(void); -void GENERAL_NAME_free(GENERAL_NAME *); - -ISSUING_DIST_POINT *ISSUING_DIST_POINT_new(void); -void ISSUING_DIST_POINT_free(ISSUING_DIST_POINT *); """ CUSTOMIZATIONS = """ |
