diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-01-04 15:53:29 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-01-04 15:53:29 +0100 |
commit | a5ca7d5975c65bdfdc02087cf54ea88f1fdf4bd7 (patch) | |
tree | 9b7e2698b29380c6cd5eb3cfc3b0666649dd2b5d /src/transport/gnunet-communicator-tcp.c | |
parent | 7b6e0eb4f6e731a2e22509aa846da58f0553a866 (diff) | |
download | gnunet-a5ca7d5975c65bdfdc02087cf54ea88f1fdf4bd7.tar.gz gnunet-a5ca7d5975c65bdfdc02087cf54ea88f1fdf4bd7.zip |
BUILD: gnunet-signatures from gana
Diffstat (limited to 'src/transport/gnunet-communicator-tcp.c')
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index 2a5e33e2b..3bfdeaa90 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -115,7 +115,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
115 | struct TcpHandshakeSignature | 115 | struct TcpHandshakeSignature |
116 | { | 116 | { |
117 | /** | 117 | /** |
118 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE | 118 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE |
119 | */ | 119 | */ |
120 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 120 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
121 | 121 | ||
@@ -153,7 +153,7 @@ struct TcpHandshakeSignature | |||
153 | struct TcpHandshakeAckSignature | 153 | struct TcpHandshakeAckSignature |
154 | { | 154 | { |
155 | /** | 155 | /** |
156 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK | 156 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK |
157 | */ | 157 | */ |
158 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 158 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
159 | 159 | ||
@@ -190,7 +190,7 @@ struct TCPConfirmation | |||
190 | struct GNUNET_PeerIdentity sender; | 190 | struct GNUNET_PeerIdentity sender; |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE | 193 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE |
194 | */ | 194 | */ |
195 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 195 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
196 | 196 | ||
@@ -225,7 +225,7 @@ struct TCPConfirmationAck | |||
225 | struct GNUNET_PeerIdentity sender; | 225 | struct GNUNET_PeerIdentity sender; |
226 | 226 | ||
227 | /** | 227 | /** |
228 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK | 228 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK |
229 | */ | 229 | */ |
230 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 230 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
231 | 231 | ||
@@ -297,7 +297,7 @@ struct TCPRekey | |||
297 | struct GNUNET_CRYPTO_EcdhePublicKey ephemeral; | 297 | struct GNUNET_CRYPTO_EcdhePublicKey ephemeral; |
298 | 298 | ||
299 | /** | 299 | /** |
300 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY | 300 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY |
301 | */ | 301 | */ |
302 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 302 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
303 | 303 | ||
@@ -315,7 +315,7 @@ struct TCPRekey | |||
315 | struct TcpRekeySignature | 315 | struct TcpRekeySignature |
316 | { | 316 | { |
317 | /** | 317 | /** |
318 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY | 318 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY |
319 | */ | 319 | */ |
320 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 320 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
321 | 321 | ||
@@ -1313,7 +1313,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey) | |||
1313 | { | 1313 | { |
1314 | struct TcpRekeySignature thp; | 1314 | struct TcpRekeySignature thp; |
1315 | 1315 | ||
1316 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY); | 1316 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY); |
1317 | thp.purpose.size = htonl (sizeof(thp)); | 1317 | thp.purpose.size = htonl (sizeof(thp)); |
1318 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1318 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1319 | "do_rekey size %u\n", | 1319 | "do_rekey size %u\n", |
@@ -1340,7 +1340,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey) | |||
1340 | GNUNET_TIME_absolute_ntoh (thp.monotonic_time))); | 1340 | GNUNET_TIME_absolute_ntoh (thp.monotonic_time))); |
1341 | GNUNET_assert (ntohl ((&thp)->purpose.size) == sizeof (*(&thp))); | 1341 | GNUNET_assert (ntohl ((&thp)->purpose.size) == sizeof (*(&thp))); |
1342 | if (GNUNET_OK != | 1342 | if (GNUNET_OK != |
1343 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY, | 1343 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY, |
1344 | &thp, | 1344 | &thp, |
1345 | &rekey->sender_sig, | 1345 | &rekey->sender_sig, |
1346 | &queue->target.public_key)) | 1346 | &queue->target.public_key)) |
@@ -1464,7 +1464,7 @@ send_challenge (struct ChallengeNonceP challenge, struct Queue *queue) | |||
1464 | tca.monotonic_time = | 1464 | tca.monotonic_time = |
1465 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); | 1465 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); |
1466 | thas.purpose.purpose = htonl ( | 1466 | thas.purpose.purpose = htonl ( |
1467 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK); | 1467 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK); |
1468 | thas.purpose.size = htonl (sizeof(thas)); | 1468 | thas.purpose.size = htonl (sizeof(thas)); |
1469 | thas.sender = my_identity; | 1469 | thas.sender = my_identity; |
1470 | thas.receiver = queue->target; | 1470 | thas.receiver = queue->target; |
@@ -1527,7 +1527,7 @@ inject_rekey (struct Queue *queue) | |||
1527 | GNUNET_CRYPTO_ecdhe_key_get_public (&queue->ephemeral, &rekey.ephemeral); | 1527 | GNUNET_CRYPTO_ecdhe_key_get_public (&queue->ephemeral, &rekey.ephemeral); |
1528 | rekey.monotonic_time = | 1528 | rekey.monotonic_time = |
1529 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); | 1529 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); |
1530 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY); | 1530 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY); |
1531 | thp.purpose.size = htonl (sizeof(thp)); | 1531 | thp.purpose.size = htonl (sizeof(thp)); |
1532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1533 | "inject_rekey size %u\n", | 1533 | "inject_rekey size %u\n", |
@@ -1725,7 +1725,7 @@ try_handle_plaintext (struct Queue *queue) | |||
1725 | } | 1725 | } |
1726 | 1726 | ||
1727 | thas.purpose.purpose = htonl ( | 1727 | thas.purpose.purpose = htonl ( |
1728 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK); | 1728 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK); |
1729 | thas.purpose.size = htonl (sizeof(thas)); | 1729 | thas.purpose.size = htonl (sizeof(thas)); |
1730 | thas.sender = tca->sender; | 1730 | thas.sender = tca->sender; |
1731 | thas.receiver = my_identity; | 1731 | thas.receiver = my_identity; |
@@ -1733,7 +1733,7 @@ try_handle_plaintext (struct Queue *queue) | |||
1733 | thas.challenge = tca->challenge; | 1733 | thas.challenge = tca->challenge; |
1734 | 1734 | ||
1735 | if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_verify ( | 1735 | if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_verify ( |
1736 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK, | 1736 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK, |
1737 | &thas, | 1737 | &thas, |
1738 | &tca->sender_sig, | 1738 | &tca->sender_sig, |
1739 | &tca->sender.public_key)) | 1739 | &tca->sender.public_key)) |
@@ -2472,7 +2472,7 @@ transmit_kx (struct Queue *queue, | |||
2472 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, | 2472 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, |
2473 | &tc.challenge, | 2473 | &tc.challenge, |
2474 | sizeof(tc.challenge)); | 2474 | sizeof(tc.challenge)); |
2475 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE); | 2475 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE); |
2476 | ths.purpose.size = htonl (sizeof(ths)); | 2476 | ths.purpose.size = htonl (sizeof(ths)); |
2477 | ths.sender = my_identity; | 2477 | ths.sender = my_identity; |
2478 | ths.receiver = queue->target; | 2478 | ths.receiver = queue->target; |
@@ -2625,7 +2625,7 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2625 | sizeof(*tc), | 2625 | sizeof(*tc), |
2626 | &ibuf[sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)], | 2626 | &ibuf[sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)], |
2627 | sizeof(*tc))); | 2627 | sizeof(*tc))); |
2628 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE); | 2628 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE); |
2629 | ths.purpose.size = htonl (sizeof(ths)); | 2629 | ths.purpose.size = htonl (sizeof(ths)); |
2630 | ths.sender = tc->sender; | 2630 | ths.sender = tc->sender; |
2631 | ths.receiver = my_identity; | 2631 | ths.receiver = my_identity; |
@@ -2633,7 +2633,7 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2633 | ths.monotonic_time = tc->monotonic_time; | 2633 | ths.monotonic_time = tc->monotonic_time; |
2634 | ths.challenge = tc->challenge; | 2634 | ths.challenge = tc->challenge; |
2635 | ret = GNUNET_CRYPTO_eddsa_verify ( | 2635 | ret = GNUNET_CRYPTO_eddsa_verify ( |
2636 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE, | 2636 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE, |
2637 | &ths, | 2637 | &ths, |
2638 | &tc->sender_sig, | 2638 | &tc->sender_sig, |
2639 | &tc->sender.public_key); | 2639 | &tc->sender.public_key); |