diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-24 11:25:10 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-08 16:47:58 -0500 |
commit | af3af494083f041c3ce9f722e4989ecd4b4e6304 (patch) | |
tree | d9f96a3ec01f4919635c3b2d044cae4241ddb52b /src/or/routerkeys.c | |
parent | c83778686839c4596504ea392854e9e95884fcfa (diff) | |
download | tor-af3af494083f041c3ce9f722e4989ecd4b4e6304.tar.gz tor-af3af494083f041c3ce9f722e4989ecd4b4e6304.zip |
Add a function to check whether a given ed id key is ours
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r-- | src/or/routerkeys.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 8d9a1328b8..ab78dbe61e 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -1091,6 +1091,14 @@ get_master_identity_key(void) return &master_identity_key->pubkey; } +/** Return true iff <b>id</b> is our Ed25519 master identity key. */ +int +router_ed25519_id_is_me(const ed25519_public_key_t *id) +{ + return id && master_identity_key && + ed25519_pubkey_eq(id, &master_identity_key->pubkey); +} + #ifdef TOR_UNIT_TESTS /* only exists for the unit tests, since otherwise the identity key * should be used to sign nothing but the signing key. */ |