]> granicus.if.org Git - p11-kit/commitdiff
trust: Rename p11_index_batch() to p11_index_load()
authorStef Walter <stef@thewalter.net>
Fri, 28 Jun 2013 15:19:22 +0000 (17:19 +0200)
committerStef Walter <stef@thewalter.net>
Wed, 3 Jul 2013 09:46:28 +0000 (11:46 +0200)
The name makes it clearer what's going on. This is only used
during loading, so we can track whether a change has resulted
from the trust module or from the file storage.

trust/builder.c
trust/index.c
trust/index.h
trust/tests/test-builder.c
trust/tests/test-index.c
trust/token.c

index f325be621557121c2058aa4af9d5018f756b6834..ddca4c69ebc3077067b7d019dd717e052f4aa333 100644 (file)
@@ -954,7 +954,7 @@ build_for_schema (p11_builder *builder,
        populate = false;
 
        /* Signifies that data is being loaded */
-       loading = p11_index_in_batch (index);
+       loading = p11_index_loading (index);
 
        /* Signifies that this is being created by a caller, instead of loaded */
        creating = (attrs == NULL && !loading);
@@ -1835,7 +1835,7 @@ p11_builder_changed (void *bilder,
         * Treat these operations as loading, not modifying/creating, so we get
         * around many of the rules that govern object creation
         */
-       p11_index_batch (index);
+       p11_index_load (index);
 
        /* A certificate */
        if (p11_attrs_match (attrs, match_cert)) {
index 4de65c94012dd4e457286341d0c02f9cf1689954..47433971d93e52679e0a48cb28560bcec54e6520 100644 (file)
@@ -313,7 +313,7 @@ index_notify (p11_index *index,
 }
 
 void
-p11_index_batch (p11_index *index)
+p11_index_load (p11_index *index)
 {
        return_if_fail (index != NULL);
 
@@ -351,7 +351,7 @@ p11_index_finish (p11_index *index)
 }
 
 bool
-p11_index_in_batch (p11_index *index)
+p11_index_loading (p11_index *index)
 {
        return_val_if_fail (index != NULL, false);
        return index->changes ? true : false;
index 2f44d0c532b3b2e0ec352e59f8b23cbe0333d0f8..0072fee3571bac6826771de946d1f5e1a1f7c46b 100644 (file)
@@ -74,11 +74,11 @@ void               p11_index_free        (p11_index *index);
 
 int                p11_index_size        (p11_index *index);
 
-void               p11_index_batch       (p11_index *index);
+void               p11_index_load        (p11_index *index);
 
 void               p11_index_finish      (p11_index *index);
 
-bool               p11_index_in_batch    (p11_index *index);
+bool               p11_index_loading     (p11_index *index);
 
 CK_RV              p11_index_take        (p11_index *index,
                                           CK_ATTRIBUTE *attrs,
index 91998fa389b57733183345f1d912e9fb1c7024c2..09a25900be52b261ab87992af4bf14a47fb5d3bc 100644 (file)
@@ -988,7 +988,7 @@ test_create_but_loadable (void)
        CK_ATTRIBUTE *attrs;
        CK_RV rv;
 
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
 
        attrs = NULL;
        rv = p11_builder_build (test.builder, test.index, &attrs, p11_attrs_dup (input));
@@ -1494,7 +1494,7 @@ test_changed_trusted_certificate (void)
         * A trusted cetrificate, trusted for server and client purposes,
         * and explicitly rejects the email and timestamping purposes.
         */
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (cacert3_trusted_certificate), NULL);
        assert_num_eq (CKR_OK, rv);
        rv = p11_index_take (test.index, p11_attrs_dup (eku_extension_server_and_client), NULL);
@@ -1604,7 +1604,7 @@ test_changed_distrust_value (void)
         * A distrusted certificate with a value, plus some extra
         * extensions (which should be ignored).
         */
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), NULL);
        assert_num_eq (CKR_OK, rv);
        rv = p11_index_take (test.index, p11_attrs_dup (eku_extension), NULL);
@@ -1689,7 +1689,7 @@ test_changed_distrust_serial (void)
        /*
         * A distrusted certificate without a value.
         */
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), NULL);
        assert_num_eq (CKR_OK, rv);
        p11_index_finish (test.index);
@@ -1790,7 +1790,7 @@ test_changed_dup_certificates (void)
         * A trusted certificate, should create trutsed nss trust
         * and anchor assertions
         */
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (trusted_cert), &handle1);
        assert_num_eq (CKR_OK, rv);
        p11_index_finish (test.index);
@@ -1805,7 +1805,7 @@ test_changed_dup_certificates (void)
        assert (handle != 0);
 
        /* Now we add a distrusted certificate, should update the objects */
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), &handle2);
        assert_num_eq (CKR_OK, rv);
        p11_index_finish (test.index);
@@ -1869,7 +1869,7 @@ test_changed_without_id (void)
        CK_OBJECT_HANDLE handle;
        CK_RV rv;
 
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (trusted_without_id), NULL);
        assert_num_eq (CKR_OK, rv);
        p11_index_finish (test.index);
@@ -1977,7 +1977,7 @@ test_changed_staple_ku (void)
        CK_ATTRIBUTE *attrs;
        CK_RV rv;
 
-       p11_index_batch (test.index);
+       p11_index_load (test.index);
        rv = p11_index_take (test.index, p11_attrs_dup (input), NULL);
        assert_num_eq (CKR_OK, rv);
        rv = p11_index_take (test.index, p11_attrs_dup (stapled_ds_and_np), NULL);
index 85c44b72b3bc9817557cf4fde70afcb4bcb2c5ba..8932da649008332451a93f895e1ed0bad2b0bdc8 100644 (file)
@@ -876,9 +876,9 @@ test_change_batch (void)
        on_change_batching = true;
        on_change_called = 0;
 
-       p11_index_batch (index);
+       p11_index_load (index);
 
-       assert (p11_index_in_batch (index));
+       assert (p11_index_loading (index));
 
        rv = p11_index_add (index, original, 2, NULL);
        assert (rv == CKR_OK);
@@ -896,7 +896,7 @@ test_change_batch (void)
        assert_num_eq (0, on_change_called);
 
        /* Nested batch is a noop */
-       p11_index_batch (index);
+       p11_index_load (index);
 
        rv = p11_index_remove (index, handle);
        assert (rv == CKR_OK);
@@ -909,7 +909,7 @@ test_change_batch (void)
         */
        p11_index_finish (index);
 
-       assert (!p11_index_in_batch (index));
+       assert (!p11_index_loading (index));
 
        /*
         * Only three calls, because later operations on the
@@ -920,7 +920,7 @@ test_change_batch (void)
        /* This is a noop */
        p11_index_finish (index);
 
-       assert (!p11_index_in_batch (index));
+       assert (!p11_index_loading (index));
 
        p11_index_free (index);
 }
@@ -971,7 +971,7 @@ test_change_nested (void)
 
 
        on_change_called = 0;
-       p11_index_batch (index);
+       p11_index_load (index);
        rv = p11_index_add (index, original, 2, NULL);
        assert (rv == CKR_OK);
        p11_index_finish (index);
index ec34f6cb0a2d5d1acb63b214b00c559ba2829c40..cbb522ef69f13e6bc78457a7027b9521baead92a 100644 (file)
@@ -208,7 +208,7 @@ loader_load_file (p11_token *token,
                return_val_if_fail (parsed->elem[i] != NULL, 0);
        }
 
-       p11_index_batch (token->index);
+       p11_index_load (token->index);
 
        /* Now place all of these in the index */
        rv = p11_index_replace_all (token->index, origin, CKA_CLASS, parsed);
@@ -366,7 +366,7 @@ load_builtin_objects (p11_token *token)
                { CKA_INVALID },
        };
 
-       p11_index_batch (token->index);
+       p11_index_load (token->index);
        rv = p11_index_take (token->index, p11_attrs_dup (builtin_root_list), NULL);
        return_val_if_fail (rv == CKR_OK, 0);
        p11_index_finish (token->index);