summaryrefslogtreecommitdiff
path: root/trust/parser.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2017-05-18 14:27:36 +0200
committerDaiki Ueno <ueno@gnu.org>2017-05-18 14:42:15 +0200
commit723dfeb3dd9b8426c4c1d6236f4b22354c122dae (patch)
tree22f37958dbc361709c8d6f3b92fad67dca3cd256 /trust/parser.c
parent66c6a7e912d39d66cd4cc91375ac7be418bf7176 (diff)
trust: Simplify the check for the magic
Instead of reusing the CKA_X_GENERATED attribute, check the file contents directly in the caller side.
Diffstat (limited to 'trust/parser.c')
-rw-r--r--trust/parser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/trust/parser.c b/trust/parser.c
index abe86fc..f92cdc9 100644
--- a/trust/parser.c
+++ b/trust/parser.c
@@ -630,11 +630,10 @@ p11_parser_format_persist (p11_parser *parser,
ret = p11_persist_read (parser->persist, parser->basename, data, length, objects);
if (ret) {
+ if (!p11_persist_is_generated (data, length))
+ modifiablev = CK_FALSE;
for (i = 0; i < objects->num; i++) {
- CK_BBOOL generatedv;
- attrs = objects->elem[i];
- if (p11_attrs_find_bool (attrs, CKA_X_GENERATED, &generatedv) && generatedv)
- attrs = p11_attrs_build (attrs, &modifiable, NULL);
+ attrs = p11_attrs_build (objects->elem[i], &modifiable, NULL);
sink_object (parser, attrs);
}
}