diff options
Diffstat (limited to 'src/service/revocation/revocation.h')
-rw-r--r-- | src/service/revocation/revocation.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/src/service/revocation/revocation.h b/src/service/revocation/revocation.h new file mode 100644 index 000000000..cbb36acfb --- /dev/null +++ b/src/service/revocation/revocation.h | |||
@@ -0,0 +1,115 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2013 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @author Christian Grothoff | ||
23 | * @file revocation/revocation.h | ||
24 | * @brief messages for key revocation | ||
25 | */ | ||
26 | #ifndef REVOCATION_H | ||
27 | #define REVOCATION_H | ||
28 | |||
29 | #include "gnunet_util_lib.h" | ||
30 | #include "gnunet_revocation_service.h" | ||
31 | |||
32 | GNUNET_NETWORK_STRUCT_BEGIN | ||
33 | |||
34 | /** | ||
35 | * Query key revocation status. | ||
36 | */ | ||
37 | struct QueryMessage | ||
38 | { | ||
39 | /** | ||
40 | * Type: #GNUNET_MESSAGE_TYPE_REVOCATION_QUERY | ||
41 | */ | ||
42 | struct GNUNET_MessageHeader header; | ||
43 | |||
44 | /** | ||
45 | * Key length. | ||
46 | */ | ||
47 | uint32_t key_len GNUNET_PACKED; | ||
48 | |||
49 | /** | ||
50 | * Followed by the public key to check. | ||
51 | */ | ||
52 | }; | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Key revocation response. | ||
57 | */ | ||
58 | struct QueryResponseMessage | ||
59 | { | ||
60 | /** | ||
61 | * Type: #GNUNET_MESSAGE_TYPE_REVOCATION_QUERY_RESPONSE | ||
62 | */ | ||
63 | struct GNUNET_MessageHeader header; | ||
64 | |||
65 | /** | ||
66 | * #GNUNET_NO if revoked, #GNUNET_YES if valid. | ||
67 | */ | ||
68 | uint32_t is_valid GNUNET_PACKED; | ||
69 | }; | ||
70 | |||
71 | |||
72 | /** | ||
73 | * Revoke key. These messages are exchanged between peers (during | ||
74 | * flooding) but also sent by the client to the service. When the | ||
75 | * client sends it to the service, the message is answered by a | ||
76 | * #GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE_RESPONSE (which is just | ||
77 | * in a `struct GNUNET_MessageHeader`. | ||
78 | */ | ||
79 | struct RevokeMessage | ||
80 | { | ||
81 | /** | ||
82 | * Type: #GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE | ||
83 | */ | ||
84 | struct GNUNET_MessageHeader header; | ||
85 | |||
86 | /** | ||
87 | * Length of PoW with signature. | ||
88 | */ | ||
89 | uint32_t pow_size GNUNET_PACKED; | ||
90 | |||
91 | /** Followed by the PoW **/ | ||
92 | }; | ||
93 | |||
94 | |||
95 | /** | ||
96 | * Key revocation response. | ||
97 | */ | ||
98 | struct RevocationResponseMessage | ||
99 | { | ||
100 | /** | ||
101 | * Type: #GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE_RESPONSE | ||
102 | */ | ||
103 | struct GNUNET_MessageHeader header; | ||
104 | |||
105 | /** | ||
106 | * #GNUNET_NO if revocation failed for internal reasons (e.g. disk full) | ||
107 | * #GNUNET_YES on success | ||
108 | */ | ||
109 | uint32_t is_valid GNUNET_PACKED; | ||
110 | }; | ||
111 | |||
112 | |||
113 | GNUNET_NETWORK_STRUCT_END | ||
114 | |||
115 | #endif | ||