diff options
Diffstat (limited to 'crypto/x509v3/v3_conf.c')
-rw-r--r-- | crypto/x509v3/v3_conf.c | 95 |
1 files changed, 30 insertions, 65 deletions
diff --git a/crypto/x509v3/v3_conf.c b/crypto/x509v3/v3_conf.c index 54ee2a53ca..59a24ef871 100644 --- a/crypto/x509v3/v3_conf.c +++ b/crypto/x509v3/v3_conf.c @@ -78,11 +78,11 @@ static X509_EXTENSION *do_ext_conf(); static X509V3_EXTENSION *v3_generic_extension(); #endif -X509_EXTENSION *X509V3_EXT_conf(conf, ctx, name, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -char *name; /* Name */ -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *name: Name */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, + char *value) { int crit; int ext_type; @@ -98,11 +98,10 @@ char *value; /* Value */ return ret; } -X509_EXTENSION *X509V3_EXT_conf_nid(conf, ctx, ext_nid, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -int ext_nid; -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, + char *value) { int crit; int ext_type; @@ -113,12 +112,10 @@ char *value; /* Value */ return do_ext_conf(conf, ctx, ext_nid, crit, value); } -static X509_EXTENSION *do_ext_conf(conf, ctx, ext_nid, crit, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -int ext_nid; -int crit; -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *value: Value */ +static X509_EXTENSION *do_ext_conf(LHASH *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value) { X509_EXTENSION *ext = NULL; X509V3_EXT_METHOD *method; @@ -179,8 +176,7 @@ char *value; /* Value */ } /* Check the extension string for critical flag */ -static int v3_check_critical(value) -char **value; +static int v3_check_critical(char **value) { char *p = *value; if((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0; @@ -191,8 +187,7 @@ char **value; } /* Check extension string for generic extension and return the type */ -static int v3_check_generic(value) -char **value; +static int v3_check_generic(char **value) { char *p = *value; if((strlen(p) < 4) || strncmp(p, "RAW:,", 4)) return 0; @@ -203,11 +198,8 @@ char **value; } /* Create a generic extension: for now just handle RAW type */ -static X509_EXTENSION *v3_generic_extension(ext, value, crit, type) -const char *ext; -char *value; -int crit; -int type; +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int type) { unsigned char *ext_der=NULL; long ext_len; @@ -249,11 +241,8 @@ return extension; * section */ -int X509V3_EXT_add_conf(conf, ctx, section, cert) -LHASH *conf; -X509V3_CTX *ctx; -char *section; -X509 *cert; +int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, + X509 *cert) { X509_EXTENSION *ext; STACK *nval; @@ -272,11 +261,8 @@ X509 *cert; /* Same as above but for a CRL */ -int X509V3_EXT_CRL_add_conf(conf, ctx, section, crl) -LHASH *conf; -X509V3_CTX *ctx; -char *section; -X509_CRL *crl; +int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, + X509_CRL *crl) { X509_EXTENSION *ext; STACK *nval; @@ -295,54 +281,40 @@ X509_CRL *crl; /* Config database functions */ -char * X509V3_get_string(ctx, name, section) -X509V3_CTX *ctx; -char *name; -char *section; +char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) { if(ctx->db_meth->get_string) return ctx->db_meth->get_string(ctx->db, name, section); return NULL; } -STACK * X509V3_get_section(ctx, section) -X509V3_CTX *ctx; -char *section; +STACK * X509V3_get_section(X509V3_CTX *ctx, char *section) { if(ctx->db_meth->get_section) return ctx->db_meth->get_section(ctx->db, section); return NULL; } -void X509V3_string_free(ctx, str) -X509V3_CTX *ctx; -char *str; +void X509V3_string_free(X509V3_CTX *ctx, char *str) { if(!str) return; if(ctx->db_meth->free_string) return ctx->db_meth->free_string(ctx->db, str); } -void X509V3_section_free(ctx, section) -X509V3_CTX *ctx; -STACK *section; +void X509V3_section_free(X509V3_CTX *ctx, STACK *section) { if(!section) return; if(ctx->db_meth->free_section) return ctx->db_meth->free_section(ctx->db, section); } -static char *conf_lhash_get_string(db, section, value) -void *db; -char *section; -char *value; +static char *conf_lhash_get_string(void *db, char *section, char *value) { return CONF_get_string(db, section, value); } -static STACK *conf_lhash_get_section(db, section) -void *db; -char *section; +static STACK *conf_lhash_get_section(void *db, char *section) { return CONF_get_section(db, section); } @@ -354,21 +326,14 @@ NULL, NULL }; -void X509V3_set_conf_lhash(ctx, lhash) -X509V3_CTX *ctx; -LHASH *lhash; +void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash) { ctx->db_meth = &conf_lhash_method; ctx->db = lhash; } -void X509V3_set_ctx(ctx, issuer, subj, req, crl, flags) -X509V3_CTX *ctx; -X509 *issuer; -X509 *subj; -X509_REQ *req; -X509_CRL *crl; -int flags; +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, + X509_CRL *crl, int flags) { ctx->issuer_cert = issuer; ctx->subject_cert = subj; |