diff options
Diffstat (limited to 'src/include/gnunet_core_service.h')
-rw-r--r-- | src/include/gnunet_core_service.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 66b292c3c..60bc3c2a6 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -48,6 +48,122 @@ extern "C" { | |||
48 | */ | 48 | */ |
49 | #define GNUNET_CORE_VERSION 0x00000001 | 49 | #define GNUNET_CORE_VERSION 0x00000001 |
50 | 50 | ||
51 | GNUNET_NETWORK_STRUCT_BEGIN | ||
52 | |||
53 | /** | ||
54 | * Message transmitted with the signed ephemeral key of a peer. The | ||
55 | * session key is then derived from the two ephemeral keys (ECDHE). | ||
56 | */ | ||
57 | struct EphemeralKeyMessage | ||
58 | { | ||
59 | /** | ||
60 | * Message type is #GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY. | ||
61 | */ | ||
62 | struct GNUNET_MessageHeader header; | ||
63 | |||
64 | /** | ||
65 | * Status of the sender (should be in `enum PeerStateMachine`), nbo. | ||
66 | */ | ||
67 | int32_t sender_status GNUNET_PACKED; | ||
68 | |||
69 | /** | ||
70 | * An ECC signature of the @e origin_identity asserting the validity | ||
71 | * of the given ephemeral key. | ||
72 | */ | ||
73 | struct GNUNET_CRYPTO_EddsaSignature signature; | ||
74 | |||
75 | /** | ||
76 | * Information about what is being signed. | ||
77 | */ | ||
78 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
79 | |||
80 | /** | ||
81 | * At what time was this key created (beginning of validity). | ||
82 | */ | ||
83 | struct GNUNET_TIME_AbsoluteNBO creation_time; | ||
84 | |||
85 | /** | ||
86 | * When does the given ephemeral key expire (end of validity). | ||
87 | */ | ||
88 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | ||
89 | |||
90 | /** | ||
91 | * Ephemeral public ECC key. | ||
92 | */ | ||
93 | struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key; | ||
94 | |||
95 | /** | ||
96 | * Public key of the signing peer (persistent version, not the | ||
97 | * ephemeral public key). | ||
98 | */ | ||
99 | struct GNUNET_PeerIdentity origin_identity; | ||
100 | }; | ||
101 | |||
102 | |||
103 | /** | ||
104 | * We're sending an (encrypted) PING to the other peer to check if it | ||
105 | * can decrypt. The other peer should respond with a PONG with the | ||
106 | * same content, except this time encrypted with the receiver's key. | ||
107 | */ | ||
108 | struct PingMessage | ||
109 | { | ||
110 | /** | ||
111 | * Message type is #GNUNET_MESSAGE_TYPE_CORE_PING. | ||
112 | */ | ||
113 | struct GNUNET_MessageHeader header; | ||
114 | |||
115 | /** | ||
116 | * Seed for the IV | ||
117 | */ | ||
118 | uint32_t iv_seed GNUNET_PACKED; | ||
119 | |||
120 | /** | ||
121 | * Intended target of the PING, used primarily to check | ||
122 | * that decryption actually worked. | ||
123 | */ | ||
124 | struct GNUNET_PeerIdentity target; | ||
125 | |||
126 | /** | ||
127 | * Random number chosen to make replay harder. | ||
128 | */ | ||
129 | uint32_t challenge GNUNET_PACKED; | ||
130 | }; | ||
131 | |||
132 | |||
133 | /** | ||
134 | * Response to a PING. Includes data from the original PING. | ||
135 | */ | ||
136 | struct PongMessage | ||
137 | { | ||
138 | /** | ||
139 | * Message type is #GNUNET_MESSAGE_TYPE_CORE_PONG. | ||
140 | */ | ||
141 | struct GNUNET_MessageHeader header; | ||
142 | |||
143 | /** | ||
144 | * Seed for the IV | ||
145 | */ | ||
146 | uint32_t iv_seed GNUNET_PACKED; | ||
147 | |||
148 | /** | ||
149 | * Random number to make replay attacks harder. | ||
150 | */ | ||
151 | uint32_t challenge GNUNET_PACKED; | ||
152 | |||
153 | /** | ||
154 | * Reserved, always zero. | ||
155 | */ | ||
156 | uint32_t reserved; | ||
157 | |||
158 | /** | ||
159 | * Intended target of the PING, used primarily to check | ||
160 | * that decryption actually worked. | ||
161 | */ | ||
162 | struct GNUNET_PeerIdentity target; | ||
163 | }; | ||
164 | |||
165 | |||
166 | GNUNET_NETWORK_STRUCT_END | ||
51 | 167 | ||
52 | /** | 168 | /** |
53 | * Opaque handle to the service. | 169 | * Opaque handle to the service. |