diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-04-18 00:10:09 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-04-18 00:10:09 +0000 |
commit | 354af17288498026713696092004d5f870122d20 (patch) | |
tree | 14b371c2dae140eed5d11a2d973e5fde869d59b1 /lib/libcrypto/asn1/asn_moid.c | |
parent | eb74fae5997a015328501cbe38bdcaaca56a4eaa (diff) |
putting most of the braces in the right column is the very least we can do.
Diffstat (limited to 'lib/libcrypto/asn1/asn_moid.c')
-rw-r--r-- | lib/libcrypto/asn1/asn_moid.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/libcrypto/asn1/asn_moid.c b/lib/libcrypto/asn1/asn_moid.c index fd04d114590..7521496d676 100644 --- a/lib/libcrypto/asn1/asn_moid.c +++ b/lib/libcrypto/asn1/asn_moid.c @@ -69,38 +69,38 @@ static int do_create(char *value, char *name); static int oid_module_init(CONF_IMODULE *md, const CONF *cnf) - { +{ int i; const char *oid_section; STACK_OF(CONF_VALUE) *sktmp; CONF_VALUE *oval; oid_section = CONF_imodule_get_value(md); if(!(sktmp = NCONF_get_section(cnf, oid_section))) - { + { ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ERROR_LOADING_SECTION); return 0; - } + } for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++) - { + { oval = sk_CONF_VALUE_value(sktmp, i); if(!do_create(oval->value, oval->name)) - { + { ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ADDING_OBJECT); return 0; - } } - return 1; } + return 1; +} static void oid_module_finish(CONF_IMODULE *md) - { +{ OBJ_cleanup(); - } +} void ASN1_add_oid_module(void) - { +{ CONF_module_add("oid_section", oid_module_init, oid_module_finish); - } +} /* Create an OID based on a name value pair. Accept two formats. * shortname = 1.2.3.4 @@ -109,24 +109,24 @@ void ASN1_add_oid_module(void) static int do_create(char *value, char *name) - { +{ int nid; ASN1_OBJECT *oid; char *ln, *ostr, *p, *lntmp; p = strrchr(value, ','); if (!p) - { + { ln = name; ostr = value; - } + } else - { + { ln = NULL; ostr = p + 1; if (!*ostr) return 0; while(isspace((unsigned char)*ostr)) ostr++; - } + } nid = OBJ_create(ostr, name, ln); @@ -134,16 +134,16 @@ static int do_create(char *value, char *name) return 0; if (p) - { + { ln = value; while(isspace((unsigned char)*ln)) ln++; p--; while(isspace((unsigned char)*p)) - { + { if (p == ln) return 0; p--; - } + } p++; lntmp = malloc((p - ln) + 1); if (lntmp == NULL) @@ -152,9 +152,9 @@ static int do_create(char *value, char *name) lntmp[p - ln] = 0; oid = OBJ_nid2obj(nid); oid->ln = lntmp; - } + } return 1; - } +} |