summaryrefslogtreecommitdiff
path: root/trust/parser.h
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-14 21:08:01 +0100
committerStef Walter <stefw@gnome.org>2013-03-15 18:00:10 +0100
commit2d75eb32793a569dc3de359bb623713c80393d24 (patch)
treeaa62978bc970d95082769c9725325d31cc413058 /trust/parser.h
parentd7d68de6c9de9190c85da36b731e61ae3421a811 (diff)
trust: Add a builder which builds objects out of parsed data
The builder completes the objects from the parsed data and takes over the responsibilities that the parser and adapter previously shared. This is necessary to prepare for arbitrary data coming from the p11-kit specific input files. https://bugs.freedesktop.org/show_bug.cgi?id=62329
Diffstat (limited to 'trust/parser.h')
-rw-r--r--trust/parser.h45
1 files changed, 12 insertions, 33 deletions
diff --git a/trust/parser.h b/trust/parser.h
index 201c2c3..ca41d26 100644
--- a/trust/parser.h
+++ b/trust/parser.h
@@ -32,63 +32,42 @@
* Author: Stef Walter <stefw@redhat.com>
*/
+#include "asn1.h"
#include "array.h"
#include "dict.h"
+#include "index.h"
#include "pkcs11.h"
#ifndef P11_PARSER_H_
#define P11_PARSER_H_
enum {
- P11_PARSE_FAILURE = -1,
- P11_PARSE_UNRECOGNIZED = 0,
- P11_PARSE_SUCCESS = 1,
-};
-
-enum {
P11_PARSE_FLAG_NONE = 0,
P11_PARSE_FLAG_ANCHOR = 1 << 0,
- P11_PARSE_FLAG_BLACKLIST = 1 << 1
+ P11_PARSE_FLAG_BLACKLIST = 1 << 1,
};
-#define P11_PARSER_FIRST_HANDLE 0xA0000000UL
+enum {
+ P11_PARSE_FAILURE = -1,
+ P11_PARSE_UNRECOGNIZED = 0,
+ P11_PARSE_SUCCESS = 1,
+};
typedef struct _p11_parser p11_parser;
-p11_parser * p11_parser_new (void);
+p11_parser * p11_parser_new (p11_index *index,
+ p11_asn1_cache *asn1_cache);
void p11_parser_free (p11_parser *parser);
-typedef void (* p11_parser_sink) (CK_ATTRIBUTE *attrs,
- void *user_data);
-
int p11_parse_memory (p11_parser *parser,
const char *filename,
int flags,
const unsigned char *data,
- size_t length,
- p11_parser_sink sink,
- void *sink_data);
+ size_t length);
int p11_parse_file (p11_parser *parser,
const char *filename,
- int flags,
- p11_parser_sink sink,
- void *sink_data);
-
-p11_dict * p11_parser_get_asn1_defs (p11_parser *parser);
-
-/* Functions used for retrieving parsing information */
-
-CK_ATTRIBUTE * p11_parsing_get_certificate (p11_parser *parser,
- p11_array *parsing);
-
-unsigned char * p11_parsing_get_extension (p11_parser *parser,
- p11_array *parsing,
- const unsigned char *oid,
- size_t *length);
-
-void p11_parsing_update_certificate (p11_parser *parser,
- p11_array *parsing);
+ int flags);
#endif