Commit 6707d22a authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Update from stable branch.

parent 3647bee2
Loading
Loading
Loading
Loading
+21 −11
Original line number Diff line number Diff line
@@ -65,21 +65,31 @@

/* Simple ASN1 OID module: add all objects in a given section */

/* NOTE: doesn't do anything other than print debug messages yet... */
static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
	{
	fprintf(stderr, "Called oid_module_init: name %s, value %s\n",
			CONF_imodule_get_name(md), CONF_imodule_get_value(md));
	return 1;
	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;
		}

static void oid_module_finish(CONF_IMODULE *md)
	for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++)
		{
		oval = sk_CONF_VALUE_value(sktmp, i);
		if(OBJ_create(oval->value, oval->name, oval->name) == NID_undef)
			{
	fprintf(stderr, "Called oid_module_finish: name %s, value %s\n",
			CONF_imodule_get_name(md), CONF_imodule_get_value(md));
			ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ADDING_OBJECT);
			return 0;
			}
		}
	return 1;
}

void ASN1_add_oid_module(void)
	{
	CONF_module_add("oid_section", oid_module_init, oid_module_finish);
	CONF_module_add("oid_section", oid_module_init, 0);
	}