diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-15 13:27:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-15 13:27:11 -0400 |
commit | 80c9e1e58511de04eeffdc47d3801697b4952e6d (patch) | |
tree | fa5b732edc657e96cf25818f6bb82e7efd2b93d1 /src | |
parent | f901ca958a69efab6cbc2b7e7908e6dffbd0b614 (diff) | |
download | tor-80c9e1e58511de04eeffdc47d3801697b4952e6d.tar.gz tor-80c9e1e58511de04eeffdc47d3801697b4952e6d.zip |
Move document_signature_t into its own header.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirauth/dirvote.c | 1 | ||||
-rw-r--r-- | src/or/document_signature_st.h | 29 | ||||
-rw-r--r-- | src/or/include.am | 1 | ||||
-rw-r--r-- | src/or/networkstatus.c | 1 | ||||
-rw-r--r-- | src/or/or.h | 19 | ||||
-rw-r--r-- | src/or/routerlist.c | 1 | ||||
-rw-r--r-- | src/or/routerparse.c | 1 | ||||
-rw-r--r-- | src/test/test_dir.c | 1 |
8 files changed, 36 insertions, 18 deletions
diff --git a/src/or/dirauth/dirvote.c b/src/or/dirauth/dirvote.c index c702ca6974..12ab5f3289 100644 --- a/src/or/dirauth/dirvote.c +++ b/src/or/dirauth/dirvote.c @@ -29,6 +29,7 @@ #include "dirauth/shared_random_state.h" #include "dir_server_st.h" +#include "document_signature_st.h" #include "node_st.h" #include "vote_microdesc_hash_st.h" #include "vote_routerstatus_st.h" diff --git a/src/or/document_signature_st.h b/src/or/document_signature_st.h new file mode 100644 index 0000000000..ec0b1ba1b0 --- /dev/null +++ b/src/or/document_signature_st.h @@ -0,0 +1,29 @@ +/* Copyright (c) 2001 Matej Pfajfar. + * Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2017, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef DOCUMENT_SIGNATURE_ST_H +#define DOCUMENT_SIGNATURE_ST_H + +/** A signature of some document by an authority. */ +struct document_signature_t { + /** Declared SHA-1 digest of this voter's identity key */ + char identity_digest[DIGEST_LEN]; + /** Declared SHA-1 digest of signing key used by this voter. */ + char signing_key_digest[DIGEST_LEN]; + /** Algorithm used to compute the digest of the document. */ + digest_algorithm_t alg; + /** Signature of the signed thing. */ + char *signature; + /** Length of <b>signature</b> */ + int signature_len; + unsigned int bad_signature : 1; /**< Set to true if we've tried to verify + * the sig, and we know it's bad. */ + unsigned int good_signature : 1; /**< Set to true if we've verified the sig + * as good. */ +}; + +#endif + diff --git a/src/or/include.am b/src/or/include.am index d9eeb15f3c..611b1adbce 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -214,6 +214,7 @@ ORHEADERS = \ src/or/dirserv.h \ src/or/dir_connection_st.h \ src/or/dir_server_st.h \ + src/or/document_signature_st.h \ src/or/dns.h \ src/or/dns_structs.h \ src/or/dnsserv.h \ diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 3f90fea4e1..1bea0d774d 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -76,6 +76,7 @@ #include "dir_connection_st.h" #include "dir_server_st.h" +#include "document_signature_st.h" #include "node_st.h" #include "vote_microdesc_hash_st.h" #include "vote_routerstatus_st.h" diff --git a/src/or/or.h b/src/or/or.h index 23f565857b..ab1ae5742b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1860,24 +1860,7 @@ typedef struct microdesc_t { typedef struct node_t node_t; typedef struct vote_microdesc_hash_t vote_microdesc_hash_t; typedef struct vote_routerstatus_t vote_routerstatus_t; - -/** A signature of some document by an authority. */ -typedef struct document_signature_t { - /** Declared SHA-1 digest of this voter's identity key */ - char identity_digest[DIGEST_LEN]; - /** Declared SHA-1 digest of signing key used by this voter. */ - char signing_key_digest[DIGEST_LEN]; - /** Algorithm used to compute the digest of the document. */ - digest_algorithm_t alg; - /** Signature of the signed thing. */ - char *signature; - /** Length of <b>signature</b> */ - int signature_len; - unsigned int bad_signature : 1; /**< Set to true if we've tried to verify - * the sig, and we know it's bad. */ - unsigned int good_signature : 1; /**< Set to true if we've verified the sig - * as good. */ -} document_signature_t; +typedef struct document_signature_t document_signature_t; /** Information about a single voter in a vote or a consensus. */ typedef struct networkstatus_voter_info_t { diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 4d02c42a4a..68def1c85e 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -127,6 +127,7 @@ #include "dir_connection_st.h" #include "dir_server_st.h" +#include "document_signature_st.h" #include "node_st.h" #include "vote_routerstatus_st.h" diff --git a/src/or/routerparse.c b/src/or/routerparse.c index b7d50a1da1..2ae005569c 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -81,6 +81,7 @@ #include "dirauth/dirvote.h" +#include "document_signature_st.h" #include "rend_authorized_client_st.h" #include "rend_intro_point_st.h" #include "rend_service_descriptor_st.h" diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 963d97a325..c3d00a81f9 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -45,6 +45,7 @@ #include "log_test_helpers.h" #include "voting_schedule.h" +#include "document_signature_st.h" #include "port_cfg_st.h" #include "tor_version_st.h" #include "vote_microdesc_hash_st.h" |