Beispiel #1
0
int
STORE_store_number(STORE *s, BIGNUM *data, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	STORE_OBJECT *object;
	int i;

	check_store(s, STORE_F_STORE_STORE_NUMBER,
	    store_object, STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION);

	object = STORE_OBJECT_new();
	if (!object) {
		STOREerr(STORE_F_STORE_STORE_NUMBER,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}

	object->data.number = data;

	i = s->meth->store_object(s, STORE_OBJECT_TYPE_NUMBER, object,
	    attributes, parameters);

	STORE_OBJECT_free(object);

	if (!i) {
		STOREerr(STORE_F_STORE_STORE_NUMBER,
		    STORE_R_FAILED_STORING_NUMBER);
		return 0;
	}
	return 1;
}
Beispiel #2
0
int
STORE_store_arbitrary(STORE *s, BUF_MEM *data, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	STORE_OBJECT *object;
	int i;

	check_store(s, STORE_F_STORE_STORE_ARBITRARY,
	    store_object, STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION);

	object = STORE_OBJECT_new();
	if (!object) {
		STOREerr(STORE_F_STORE_STORE_ARBITRARY,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}

	object->data.arbitrary = data;

	i = s->meth->store_object(s, STORE_OBJECT_TYPE_ARBITRARY, object,
	    attributes, parameters);

	STORE_OBJECT_free(object);

	if (!i) {
		STOREerr(STORE_F_STORE_STORE_ARBITRARY,
		    STORE_R_FAILED_STORING_ARBITRARY);
		return 0;
	}
	return 1;
}
Beispiel #3
0
int
STORE_store_certificate(STORE *s, X509 *data, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	STORE_OBJECT *object;
	int i;

	check_store(s, STORE_F_STORE_CERTIFICATE,
	    store_object, STORE_R_NO_STORE_OBJECT_FUNCTION);

	object = STORE_OBJECT_new();
	if (!object) {
		STOREerr(STORE_F_STORE_STORE_CERTIFICATE,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}

	CRYPTO_add(&data->references, 1, CRYPTO_LOCK_X509);
	object->data.x509.certificate = data;

	i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE,
	    object, attributes, parameters);

	STORE_OBJECT_free(object);

	if (!i) {
		STOREerr(STORE_F_STORE_STORE_CERTIFICATE,
		    STORE_R_FAILED_STORING_CERTIFICATE);
		return 0;
	}
	return 1;
}
Beispiel #4
0
STORE *
STORE_new_method(const STORE_METHOD *method)
{
	STORE *ret;

	if (method == NULL) {
		STOREerr(STORE_F_STORE_NEW_METHOD, ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}

	ret = malloc(sizeof(STORE));
	if (ret == NULL) {
		STOREerr(STORE_F_STORE_NEW_METHOD, ERR_R_MALLOC_FAILURE);
		return NULL;
	}

	ret->meth = method;

	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_STORE, ret, &ret->ex_data);
	if (ret->meth->init && !ret->meth->init(ret)) {
		STORE_free(ret);
		ret = NULL;
	}
	return ret;
}
Beispiel #5
0
int
STORE_store_crl(STORE *s, X509_CRL *data, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	STORE_OBJECT *object;
	int i;

	check_store(s, STORE_F_STORE_STORE_CRL,
	    store_object, STORE_R_NO_STORE_OBJECT_FUNCTION);

	object = STORE_OBJECT_new();
	if (!object) {
		STOREerr(STORE_F_STORE_STORE_CRL,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}

	CRYPTO_add(&data->references, 1, CRYPTO_LOCK_X509_CRL);
	object->data.crl = data;

	i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object,
	    attributes, parameters);

	STORE_OBJECT_free(object);

	if (!i) {
		STOREerr(STORE_F_STORE_STORE_CRL,
		    STORE_R_FAILED_STORING_KEY);
		return 0;
	}
	return i;
}
Beispiel #6
0
static STORE_OBJECT *mem_list_next(STORE *s, void *handle)
	{
	int i;
	struct mem_ctx_st *context = (struct mem_ctx_st *)handle;
	struct mem_object_data_st key = { 0, 0, 1 };
	struct mem_data_st *store =
		(struct mem_data_st *)STORE_get_ex_data(s, 1);
	int srch;
	int cres = 0;

	if (!context)
		{
		STOREerr(STORE_F_MEM_LIST_NEXT, ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
		}
	if (!store)
		{
		STOREerr(STORE_F_MEM_LIST_NEXT, STORE_R_NO_STORE);
		return NULL;
		}

	if (context->search_index == -1)
		{
		for (i = 0; i < sk_num(context->search_attributes); i++)
			{
			key.attr_info =
				(STORE_ATTR_INFO *)sk_value(context->search_attributes, i);
			srch = sk_find_ex(store->data, (char *)&key);

			if (srch >= 0)
				{
				context->search_index = srch;
				break;
				}
			}
		}
	if (context->search_index < 0)
		return NULL;
	
	key.attr_info =
		(STORE_ATTR_INFO *)sk_value(context->search_attributes,
			context->search_index);
	for(srch = context->search_index;
	    srch < sk_num(store->data)
		    && STORE_ATTR_INFO_in_range(key.attr_info,
			    (STORE_ATTR_INFO *)sk_value(store->data, srch))
		    && !(cres = STORE_ATTR_INFO_in_ex(key.attr_info,
				 (STORE_ATTR_INFO *)sk_value(store->data, srch)));
	    srch++)
		;

	context->search_index = srch;
	if (cres)
		return ((struct mem_object_data_st *)sk_value(store->data,
				srch))->object;
	return NULL;
	}
Beispiel #7
0
int
STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void))
{
	if (store == NULL) {
		STOREerr(STORE_F_STORE_CTRL, ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (store->meth->ctrl)
		return store->meth->ctrl(store, cmd, i, p, f);
	STOREerr(STORE_F_STORE_CTRL, STORE_R_NO_CONTROL_FUNCTION);
	return 0;
}
Beispiel #8
0
BIGNUM *
STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_GET0_NUMBER,
		    ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}
	if (ATTR_IS_SET(attrs, code))
		return attrs->values[code].number;
	STOREerr(STORE_F_STORE_ATTR_INFO_GET0_NUMBER, STORE_R_NO_VALUE);
	return NULL;
}
Beispiel #9
0
X509_NAME *
STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_GET0_DN,
		    ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}
	if (ATTR_IS_SET(attrs, code))
		return attrs->values[code].dn;
	STOREerr(STORE_F_STORE_ATTR_INFO_GET0_DN, STORE_R_NO_VALUE);
	return NULL;
}
Beispiel #10
0
unsigned char *
STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_GET0_SHA1STR,
		    ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}
	if (ATTR_IS_SET(attrs, code))
		return attrs->values[code].sha1string;
	STOREerr(STORE_F_STORE_ATTR_INFO_GET0_SHA1STR, STORE_R_NO_VALUE);
	return NULL;
}
Beispiel #11
0
/* The list functions may be the hardest to understand.  Basically,
   mem_list_start compiles a stack of attribute info elements, and
   puts that stack into the context to be returned.  mem_list_next
   will then find the first matching element in the store, and then
   walk all the way to the end of the store (since any combination
   of attribute bits above the starting point may match the searched
   for bit pattern...). */
static void *mem_list_start(STORE *s, STORE_OBJECT_TYPES type,
	OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[])
	{
	struct mem_ctx_st *context =
		(struct mem_ctx_st *)OPENSSL_malloc(sizeof(struct mem_ctx_st));
	void *attribute_context = NULL;
	STORE_ATTR_INFO *attrs = NULL;

	if (!context)
		{
		STOREerr(STORE_F_MEM_LIST_START, ERR_R_MALLOC_FAILURE);
		return 0;
		}
	memset(context, 0, sizeof(struct mem_ctx_st));

	attribute_context = STORE_parse_attrs_start(attributes);
	if (!attribute_context)
		{
		STOREerr(STORE_F_MEM_LIST_START, ERR_R_STORE_LIB);
		goto err;
		}

	while((attrs = STORE_parse_attrs_next(attribute_context)))
		{
		if (context->search_attributes == NULL)
			{
			context->search_attributes =
				sk_new((int (*)(const char * const *, const char * const *))STORE_ATTR_INFO_compare);
			if (!context->search_attributes)
				{
				STOREerr(STORE_F_MEM_LIST_START,
					ERR_R_MALLOC_FAILURE);
				goto err;
				}
			}
		sk_push(context->search_attributes,(char *)attrs);
		}
	if (!STORE_parse_attrs_endp(attribute_context))
		goto err;
	STORE_parse_attrs_end(attribute_context);
	context->search_index = -1;
	context->index = -1;
	return context;
 err:
	if (attribute_context) STORE_parse_attrs_end(attribute_context);
	mem_list_end(s, context);
	return NULL;
	}
Beispiel #12
0
void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes)
	{
	if (attributes)
		{
		struct attr_list_ctx_st *context =
			(struct attr_list_ctx_st *)malloc(sizeof(struct attr_list_ctx_st));
		if (context)
			context->attributes = attributes;
		else
			STOREerr(STORE_F_STORE_PARSE_ATTRS_START,
				ERR_R_MALLOC_FAILURE);
		return context;
		}
	STOREerr(STORE_F_STORE_PARSE_ATTRS_START, ERR_R_PASSED_NULL_PARAMETER);
	return 0;
	}
Beispiel #13
0
X509_CRL *STORE_get_crl(STORE *s, OPENSSL_ITEM attributes[],
	OPENSSL_ITEM parameters[])
	{
	STORE_OBJECT *object;
	X509_CRL *crl;

	check_store(s,STORE_F_STORE_GET_CRL,
		get_object,STORE_R_NO_GET_OBJECT_FUNCTION);

	object = s->meth->get_object(s, STORE_OBJECT_TYPE_X509_CRL,
		attributes, parameters);
	if (!object || !object->data.crl)
		{
		STOREerr(STORE_F_STORE_GET_CRL,
			STORE_R_FAILED_GETTING_KEY);
		return 0;
		}
	CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
#ifdef REF_PRINT
	REF_PRINT("X509_CRL",data);
#endif
	crl = object->data.crl;
	STORE_OBJECT_free(object);
	return crl;
	}
Beispiel #14
0
X509 *STORE_get_certificate(STORE *s, OPENSSL_ITEM attributes[],
	OPENSSL_ITEM parameters[])
	{
	STORE_OBJECT *object;
	X509 *x;

	check_store(s,STORE_F_STORE_GET_CERTIFICATE,
		get_object,STORE_R_NO_GET_OBJECT_FUNCTION);

	object = s->meth->get_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE,
		attributes, parameters);
	if (!object || !object->data.x509.certificate)
		{
		STOREerr(STORE_F_STORE_GET_CERTIFICATE,
			STORE_R_FAILED_GETTING_CERTIFICATE);
		return 0;
		}
	CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509);
#ifdef REF_PRINT
	REF_PRINT("X509",data);
#endif
	x = object->data.x509.certificate;
	STORE_OBJECT_free(object);
	return x;
	}
Beispiel #15
0
EVP_PKEY *STORE_get_public_key(STORE *s, OPENSSL_ITEM attributes[],
	OPENSSL_ITEM parameters[])
	{
	STORE_OBJECT *object;
	EVP_PKEY *pkey;

	check_store(s,STORE_F_STORE_GET_PUBLIC_KEY,
		get_object,STORE_R_NO_GET_OBJECT_FUNCTION);

	object = s->meth->get_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY,
		attributes, parameters);
	if (!object || !object->data.key || !object->data.key)
		{
		STOREerr(STORE_F_STORE_GET_PUBLIC_KEY,
			STORE_R_FAILED_GETTING_KEY);
		return 0;
		}
	CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
#ifdef REF_PRINT
	REF_PRINT("EVP_PKEY",data);
#endif
	pkey = object->data.key;
	STORE_OBJECT_free(object);
	return pkey;
	}
Beispiel #16
0
static int mem_store(STORE *s, STORE_OBJECT_TYPES type,
	STORE_OBJECT *data, OPENSSL_ITEM attributes[],
	OPENSSL_ITEM parameters[])
	{
	STOREerr(STORE_F_MEM_STORE, STORE_R_NOT_IMPLEMENTED);
	return 0;
	}
Beispiel #17
0
STORE *STORE_new_engine(ENGINE *engine)
	{
	STORE *ret = NULL;
	ENGINE *e = engine;
	const STORE_METHOD *meth = 0;

#ifdef OPENSSL_NO_ENGINE
	e = NULL;
#else
	if (engine)
		{
		if (!ENGINE_init(engine))
			{
			STOREerr(STORE_F_STORE_NEW_ENGINE, ERR_R_ENGINE_LIB);
			return NULL;
			}
		e = engine;
		}
	else
		{
		STOREerr(STORE_F_STORE_NEW_ENGINE,ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
		}
	if(e)
		{
		meth = ENGINE_get_STORE(e);
		if(!meth)
			{
			STOREerr(STORE_F_STORE_NEW_ENGINE,
				ERR_R_ENGINE_LIB);
			ENGINE_finish(e);
			return NULL;
			}
		}
#endif

	ret = STORE_new_method(meth);
	if (ret == NULL)
		{
		STOREerr(STORE_F_STORE_NEW_ENGINE,ERR_R_STORE_LIB);
		return NULL;
		}

	ret->engine = e;

	return(ret);
	}
Beispiel #18
0
static int mem_modify(STORE *s, STORE_OBJECT_TYPES type,
	OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[],
	OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[],
	OPENSSL_ITEM parameters[])
	{
	STOREerr(STORE_F_MEM_MODIFY, STORE_R_NOT_IMPLEMENTED);
	return 0;
	}
Beispiel #19
0
int
STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
    char *cstr, size_t cstr_size)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_CSTR,
		    ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (!ATTR_IS_SET(attrs, code)) {
		if ((attrs->values[code].cstring = BUF_strndup(cstr, cstr_size)))
			return 1;
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_CSTR,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}
	STOREerr(STORE_F_STORE_ATTR_INFO_SET_CSTR, STORE_R_ALREADY_HAS_A_VALUE);
	return 0;
}
Beispiel #20
0
int STORE_store_public_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[],
	OPENSSL_ITEM parameters[])
	{
	STORE_OBJECT *object;
	int i;

	check_store(s,STORE_F_STORE_STORE_PUBLIC_KEY,
		store_object,STORE_R_NO_STORE_OBJECT_FUNCTION);

	object = STORE_OBJECT_new();
	if (!object)
		{
		STOREerr(STORE_F_STORE_STORE_PUBLIC_KEY,
			ERR_R_MALLOC_FAILURE);
		return 0;
		}
	object->data.key = EVP_PKEY_new();
	if (!object->data.key)
		{
		STOREerr(STORE_F_STORE_STORE_PUBLIC_KEY,
			ERR_R_MALLOC_FAILURE);
		return 0;
		}
	
	CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY);
#ifdef REF_PRINT
	REF_PRINT("EVP_PKEY",data);
#endif
	object->data.key = data;

	i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object,
		attributes, parameters);

	STORE_OBJECT_free(object);

	if (!i)
		{
		STOREerr(STORE_F_STORE_STORE_PUBLIC_KEY,
			STORE_R_FAILED_STORING_KEY);
		return 0;
		}
	return i;
	}
Beispiel #21
0
int
STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
    X509_NAME *dn)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_DN,
		    ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (!ATTR_IS_SET(attrs, code)) {
		if ((attrs->values[code].dn = X509_NAME_dup(dn)))
			return 1;
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_DN,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}
	STOREerr(STORE_F_STORE_ATTR_INFO_SET_DN, STORE_R_ALREADY_HAS_A_VALUE);
	return 0;
}
Beispiel #22
0
int
STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
    BIGNUM *number)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_NUMBER,
		    ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (!ATTR_IS_SET(attrs, code)) {
		if ((attrs->values[code].number = BN_dup(number)))
			return 1;
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_NUMBER,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}
	STOREerr(STORE_F_STORE_ATTR_INFO_SET_NUMBER,
	    STORE_R_ALREADY_HAS_A_VALUE);
	return 0;
}
Beispiel #23
0
int
STORE_parse_attrs_endp(void *handle)
{
	struct attr_list_ctx_st *context = (struct attr_list_ctx_st *)handle;

	if (context && context->attributes) {
		return context->attributes->code == STORE_ATTR_END;
	}
	STOREerr(STORE_F_STORE_PARSE_ATTRS_ENDP, ERR_R_PASSED_NULL_PARAMETER);
	return 0;
}
Beispiel #24
0
int
STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
    unsigned char *sha1str, size_t sha1str_size)
{
	if (!attrs) {
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_SHA1STR,
		    ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (!ATTR_IS_SET(attrs, code)) {
		if ((attrs->values[code].sha1string =
		    (unsigned char *)BUF_memdup(sha1str,
		    sha1str_size)))
			return 1;
		STOREerr(STORE_F_STORE_ATTR_INFO_SET_SHA1STR,
		    ERR_R_MALLOC_FAILURE);
		return 0;
	}
	STOREerr(STORE_F_STORE_ATTR_INFO_SET_SHA1STR,
	    STORE_R_ALREADY_HAS_A_VALUE);
	return 0;
}
Beispiel #25
0
int
STORE_list_certificate_endp(STORE *s, void *handle)
{
	check_store(s, STORE_F_STORE_LIST_CERTIFICATE_ENDP,
	    list_object_endp, STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION);

	if (!s->meth->list_object_endp(s, handle)) {
		STOREerr(STORE_F_STORE_LIST_CERTIFICATE_ENDP,
		    STORE_R_FAILED_LISTING_CERTIFICATES);
		return 0;
	}
	return 1;
}
Beispiel #26
0
int
STORE_list_public_key_end(STORE *s, void *handle)
{
	check_store(s, STORE_F_STORE_LIST_PUBLIC_KEY_END,
	    list_object_end, STORE_R_NO_LIST_OBJECT_END_FUNCTION);

	if (!s->meth->list_object_end(s, handle)) {
		STOREerr(STORE_F_STORE_LIST_PUBLIC_KEY_END,
		    STORE_R_FAILED_LISTING_KEYS);
		return 0;
	}
	return 1;
}
Beispiel #27
0
int
STORE_list_crl_endp(STORE *s, void *handle)
{
	check_store(s, STORE_F_STORE_LIST_CRL_ENDP,
	    list_object_endp, STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION);

	if (!s->meth->list_object_endp(s, handle)) {
		STOREerr(STORE_F_STORE_LIST_CRL_ENDP,
		    STORE_R_FAILED_LISTING_KEYS);
		return 0;
	}
	return 1;
}
Beispiel #28
0
static int mem_list_end(STORE *s, void *handle)
	{
	struct mem_ctx_st *context = (struct mem_ctx_st *)handle;

	if (!context)
		{
		STOREerr(STORE_F_MEM_LIST_END, ERR_R_PASSED_NULL_PARAMETER);
		return 0;
		}
	if (context && context->search_attributes)
		sk_free(context->search_attributes);
	if (context) OPENSSL_free(context);
	return 1;
	}
Beispiel #29
0
int
STORE_revoke_certificate(STORE *s, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	check_store(s, STORE_F_STORE_REVOKE_CERTIFICATE,
	    revoke_object, STORE_R_NO_REVOKE_OBJECT_FUNCTION);

	if (!s->meth->revoke_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE,
	    attributes, parameters)) {
		STOREerr(STORE_F_STORE_REVOKE_CERTIFICATE,
		    STORE_R_FAILED_REVOKING_CERTIFICATE);
		return 0;
	}
	return 1;
}
Beispiel #30
0
int
STORE_delete_crl(STORE *s, OPENSSL_ITEM attributes[],
    OPENSSL_ITEM parameters[])
{
	check_store(s, STORE_F_STORE_DELETE_CRL,
	    delete_object, STORE_R_NO_DELETE_OBJECT_FUNCTION);

	if (!s->meth->delete_object(s, STORE_OBJECT_TYPE_X509_CRL,
	    attributes, parameters)) {
		STOREerr(STORE_F_STORE_DELETE_CRL,
		    STORE_R_FAILED_DELETING_KEY);
		return 0;
	}
	return 1;
}