summaryrefslogtreecommitdiff
path: root/trust
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-06-28 17:19:22 +0200
committerStef Walter <stef@thewalter.net>2013-07-03 11:46:28 +0200
commit1c4522e5df79bd197feab8448008fc2bf6b4ea2e (patch)
treeb33284d2501cb32a6cf9fc0e9b0983220c174fb7 /trust
parent17bc43cb82320f2aba4ccb804bd8599232524c6a (diff)
trust: Rename p11_index_batch() to p11_index_load()
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.
Diffstat (limited to 'trust')
-rw-r--r--trust/builder.c4
-rw-r--r--trust/index.c4
-rw-r--r--trust/index.h4
-rw-r--r--trust/tests/test-builder.c16
-rw-r--r--trust/tests/test-index.c12
-rw-r--r--trust/token.c4
6 files changed, 22 insertions, 22 deletions
diff --git a/trust/builder.c b/trust/builder.c
index f325be6..ddca4c6 100644
--- a/trust/builder.c
+++ b/trust/builder.c
@@ -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)) {
diff --git a/trust/index.c b/trust/index.c
index 4de65c9..4743397 100644
--- a/trust/index.c
+++ b/trust/index.c
@@ -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;
diff --git a/trust/index.h b/trust/index.h
index 2f44d0c..0072fee 100644
--- a/trust/index.h
+++ b/trust/index.h
@@ -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,
diff --git a/trust/tests/test-builder.c b/trust/tests/test-builder.c
index 91998fa..09a2590 100644
--- a/trust/tests/test-builder.c
+++ b/trust/tests/test-builder.c
@@ -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);
diff --git a/trust/tests/test-index.c b/trust/tests/test-index.c
index 85c44b7..8932da6 100644
--- a/trust/tests/test-index.c
+++ b/trust/tests/test-index.c
@@ -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);
diff --git a/trust/token.c b/trust/token.c
index ec34f6c..cbb522e 100644
--- a/trust/token.c
+++ b/trust/token.c
@@ -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);