Commit 1e6e0dc7 authored by Niels Möller's avatar Niels Möller
Browse files

* src/spki.c (spki_hash_sexp): New function.

Rev: src/spki.c:1.31
Rev: src/spki.h:1.22
parent 73846763
......@@ -227,6 +227,23 @@ spki_hash_data(struct hash_algorithm *algorithm,
sexp_s(NULL, out), -1);
}
/* Create an SPKI hash from an s-expression. */
struct sexp *
spki_hash_sexp(struct hash_algorithm *algorithm,
int name,
struct sexp *expr)
{
struct lsh_string *s = hash_string(algorithm,
sexp_format(expr, SEXP_CANONICAL, 0),
1);
struct sexp *hash = spki_hash_data(algorithm, name,
s->length, s->data);
lsh_string_free(s);
return hash;
}
/* 5-tuples */
......
......@@ -82,6 +82,11 @@ spki_hash_data(struct hash_algorithm *algorithm,
int algorithm_name,
UINT32 length, UINT8 *data);
struct sexp *
spki_hash_sexp(struct hash_algorithm *algorithm,
int name,
struct sexp *expr);
/* At a point in time, not all fields are known; fields may be added
* later, or computed as needed. This information is not automatically
* trusted in any way, except that any non-NULL attributes must be
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment