diff options
Diffstat (limited to 'src/libstrongswan/credentials/certificates/x509.h')
-rw-r--r-- | src/libstrongswan/credentials/certificates/x509.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libstrongswan/credentials/certificates/x509.h b/src/libstrongswan/credentials/certificates/x509.h index 24e30a7ae..d668ceba3 100644 --- a/src/libstrongswan/credentials/certificates/x509.h +++ b/src/libstrongswan/credentials/certificates/x509.h @@ -31,6 +31,7 @@ typedef struct x509_cert_policy_t x509_cert_policy_t; typedef struct x509_policy_mapping_t x509_policy_mapping_t; typedef struct x509_cdp_t x509_cdp_t; typedef enum x509_flag_t x509_flag_t; +typedef enum x509_constraint_t x509_constraint_t; /** * X.509 certificate flags. @@ -57,6 +58,18 @@ enum x509_flag_t { }; /** + * Different numerical X.509 constraints. + */ +enum x509_constraint_t { + /** pathLenConstraint basicConstraints */ + X509_PATH_LEN, + /** inhibitPolicyMapping policyConstraint */ + X509_INHIBIT_POLICY_MAPPING, + /** requireExplicitPolicy policyConstraint */ + X509_REQUIRE_EXPLICIT_POLICY, +}; + +/** * X.509 certPolicy extension. */ struct x509_cert_policy_t { @@ -130,19 +143,12 @@ struct x509_t { chunk_t (*get_authKeyIdentifier)(x509_t *this); /** - * Get an optional path length constraint. - * - * @return pathLenConstraint, X509_NO_CONSTRAINT if none found - */ - int (*get_pathLenConstraint)(x509_t *this); - - /** - * Get a policyConstraint, inhibitPolicyMapping or requireExplicitPolicy. + * Get a numerical X.509 constraint. * - * @param inhibit TRUE to get inhibitPolicyMapping + * @param type type of constraint to get * @return constraint, X509_NO_CONSTRAINT if none found */ - int (*get_policyConstraint)(x509_t *this, bool inhibit); + int (*get_constraint)(x509_t *this, x509_constraint_t type); /** * Create an enumerator over all subjectAltNames. |