Commit 620770f5 authored by Niels Möller's avatar Niels Möller

(enum spki_principal_flags): Renamed to...

(enum spki_hash_flags): ...new enum. Renamed flags, and added
SPKI_HASH_SHA256.
(struct spki_hashes): Moved flags field here, and added sha256
hash.
(struct spki_principal): Deleted flags field.

Rev: spki/certificate.h:1.2
parent 73ea3d91
......@@ -55,20 +55,24 @@ struct spki_tag;
/* Forward declaration */
struct spki_acl_db;
enum spki_hash_flags
{
SPKI_HASH_MD5 = 1,
SPKI_HASH_SHA1 = 2,
SPKI_HASH_SHA256 = 4,
};
struct spki_hashes
{
/* Include the flags in this struct? */
/* A flag is set iff the corresponding hash value is known. */
enum spki_hash_flags flags;
uint8_t md5[MD5_DIGEST_SIZE];
uint8_t sha1[SHA1_DIGEST_SIZE];
uint8_t sha256[SHA256_DIGEST_SIZE];
};
enum spki_principal_flags
{
SPKI_PRINCIPAL_MD5 = 1,
SPKI_PRINCIPAL_SHA1 = 2
};
struct spki_principal
{
/* Principals linked into a list. */
......@@ -79,8 +83,6 @@ struct spki_principal
/* NULL if only hash is known */
uint8_t *key;
/* A flag is set iff the corresponding hash value is known. */
enum spki_principal_flags flags;
struct spki_hashes hashes;
/* If the lookup code sees hashes and keys in an unfortunate order,
......@@ -226,6 +228,9 @@ spki_principal_by_md5(struct spki_acl_db *db, const uint8_t *digest);
struct spki_principal *
spki_principal_by_sha1(struct spki_acl_db *db, const uint8_t *digest);
struct spki_principal *
spki_principal_by_sha256(struct spki_acl_db *db, const uint8_t *digest);
void
spki_principal_free_chain(struct spki_acl_db *db,
struct spki_principal *chain);
......
Markdown is supported
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