From 750a37a6a5fddf1a09ceb83131e173e1b857b743 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 21 Jun 2015 22:30:32 -0500 Subject: add name constraints and general subtree struct and macro stack defs --- src/_cffi_src/openssl/x509v3.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/_cffi_src/openssl/x509v3.py') diff --git a/src/_cffi_src/openssl/x509v3.py b/src/_cffi_src/openssl/x509v3.py index e9bc461a..166fa59d 100644 --- a/src/_cffi_src/openssl/x509v3.py +++ b/src/_cffi_src/openssl/x509v3.py @@ -24,6 +24,7 @@ typedef STACK_OF(DIST_POINT) Cryptography_STACK_OF_DIST_POINT; typedef STACK_OF(POLICYQUALINFO) Cryptography_STACK_OF_POLICYQUALINFO; typedef STACK_OF(POLICYINFO) Cryptography_STACK_OF_POLICYINFO; typedef STACK_OF(ASN1_INTEGER) Cryptography_STACK_OF_ASN1_INTEGER; +typedef STACK_OF(GENERAL_SUBTREE) Cryptography_STACK_OF_GENERAL_SUBTREE; """ TYPES = """ @@ -31,6 +32,7 @@ typedef ... Cryptography_STACK_OF_ACCESS_DESCRIPTION; typedef ... Cryptography_STACK_OF_POLICYQUALINFO; typedef ... Cryptography_STACK_OF_POLICYINFO; typedef ... Cryptography_STACK_OF_ASN1_INTEGER; +typedef ... Cryptography_STACK_OF_GENERAL_SUBTREE; typedef struct { X509 *issuer_cert; @@ -69,6 +71,12 @@ typedef struct { ASN1_INTEGER *pathlen; } BASIC_CONSTRAINTS; +typedef struct { + Cryptography_STACK_OF_GENERAL_SUBTREE *permittedSubtrees; + Cryptography_STACK_OF_GENERAL_SUBTREE *excludedSubtrees; +} NAME_CONSTRAINTS; + + typedef struct { int type; union { @@ -94,6 +102,12 @@ typedef struct { ...; } 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 { @@ -173,6 +187,9 @@ void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *); x509v3.h header. */ void AUTHORITY_KEYID_free(AUTHORITY_KEYID *); +NAME_CONSTRAINTS *NAME_CONSTRAINTS_new(void); +void NAME_CONSTRAINTS_free(NAME_CONSTRAINTS *); + void *X509V3_set_ctx_nodb(X509V3_CTX *); int sk_GENERAL_NAME_num(struct stack_st_GENERAL_NAME *); int sk_GENERAL_NAME_push(struct stack_st_GENERAL_NAME *, GENERAL_NAME *); @@ -207,6 +224,14 @@ int sk_POLICYQUALINFO_num(Cryptography_STACK_OF_POLICYQUALINFO *); POLICYQUALINFO *sk_POLICYQUALINFO_value(Cryptography_STACK_OF_POLICYQUALINFO *, int); +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 *); + void sk_ASN1_INTEGER_free(Cryptography_STACK_OF_ASN1_INTEGER *); int sk_ASN1_INTEGER_num(Cryptography_STACK_OF_ASN1_INTEGER *); ASN1_INTEGER *sk_ASN1_INTEGER_value(Cryptography_STACK_OF_ASN1_INTEGER *, int); -- cgit v1.2.3