Typo.
[oweals/openssl.git] / crypto / store / str_mem.c
index 595f40397db86ff7bc9d9667675363769ea489c8..527757ae09904d48784153c63d94a057051402db 100644 (file)
@@ -105,24 +105,28 @@ struct mem_ctx_st
 static int mem_init(STORE *s);
 static void mem_clean(STORE *s);
 static STORE_OBJECT *mem_generate(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM parameters[], OPENSSL_ITEM attributes[]);
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
 static STORE_OBJECT *mem_get(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM attributes[]);
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
 static int mem_store(STORE *s, STORE_OBJECT_TYPES type,
-       STORE_OBJECT *data, OPENSSL_ITEM attributes[]);
+       STORE_OBJECT *data, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[]);
 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 modify_attributes[], OPENSSL_ITEM delete_attributes[],
+       OPENSSL_ITEM parameters[]);
 static int mem_delete(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM attributes[]);
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
 static void *mem_list_start(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM attributes[]);
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
 static STORE_OBJECT *mem_list_next(STORE *s, void *handle);
 static int mem_list_end(STORE *s, void *handle);
 static int mem_list_endp(STORE *s, void *handle);
-static int mem_lock(STORE *s, OPENSSL_ITEM attributes[]);
-static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[]);
-static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)());
+static int mem_lock(STORE *s, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[]);
+static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[]);
+static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void));
 
 static STORE_METHOD store_memory =
        {
@@ -161,15 +165,15 @@ static void mem_clean(STORE *s)
        }
 
 static STORE_OBJECT *mem_generate(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM parameters[], OPENSSL_ITEM attributes[])
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[])
        {
        STOREerr(STORE_F_MEM_GENERATE, STORE_R_NOT_IMPLEMENTED);
        return 0;
        }
 static STORE_OBJECT *mem_get(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM attributes[])
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[])
        {
-       void *context = mem_list_start(s, type, attributes);
+       void *context = mem_list_start(s, type, attributes, parameters);
        
        if (context)
                {
@@ -181,26 +185,28 @@ static STORE_OBJECT *mem_get(STORE *s, STORE_OBJECT_TYPES type,
        return NULL;
        }
 static int mem_store(STORE *s, STORE_OBJECT_TYPES type,
-       STORE_OBJECT *data, OPENSSL_ITEM attributes[])
+       STORE_OBJECT *data, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[])
        {
        STOREerr(STORE_F_MEM_STORE, STORE_R_NOT_IMPLEMENTED);
        return 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 modify_attributes[], OPENSSL_ITEM delete_attributes[],
+       OPENSSL_ITEM parameters[])
        {
-       STOREerr(STORE_F_MEM_STORE, STORE_R_NOT_IMPLEMENTED);
+       STOREerr(STORE_F_MEM_MODIFY, STORE_R_NOT_IMPLEMENTED);
        return 0;
        }
 static int mem_delete(STORE *s, STORE_OBJECT_TYPES type,
-       OPENSSL_ITEM attributes[])
+       OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[])
        {
        STOREerr(STORE_F_MEM_DELETE, STORE_R_NOT_IMPLEMENTED);
        return 0;
        }
 
-/* The list functions may be the hardest to nuderstand.  Basically,
+/* 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
@@ -208,7 +214,7 @@ static int mem_delete(STORE *s, STORE_OBJECT_TYPES type,
    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 attributes[], OPENSSL_ITEM parameters[])
        {
        struct mem_ctx_st *context =
                (struct mem_ctx_st *)OPENSSL_malloc(sizeof(struct mem_ctx_st));
@@ -299,6 +305,8 @@ static STORE_OBJECT *mem_list_next(STORE *s, void *handle)
                        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++)
@@ -316,7 +324,7 @@ static int mem_list_end(STORE *s, void *handle)
 
        if (!context)
                {
-               STOREerr(STORE_F_MEM_LIST_NEXT, ERR_R_PASSED_NULL_PARAMETER);
+               STOREerr(STORE_F_MEM_LIST_END, ERR_R_PASSED_NULL_PARAMETER);
                return 0;
                }
        if (context && context->search_attributes)
@@ -333,15 +341,17 @@ static int mem_list_endp(STORE *s, void *handle)
                return 1;
        return 0;
        }
-static int mem_lock(STORE *s, OPENSSL_ITEM attributes[])
+static int mem_lock(STORE *s, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[])
        {
        return 1;
        }
-static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[])
+static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[],
+       OPENSSL_ITEM parameters[])
        {
        return 1;
        }
-static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)())
+static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void))
        {
        return 1;
        }