diff options
author | t3sserakt <t3ss@posteo.de> | 2023-04-27 17:56:13 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-05-02 12:41:01 +0200 |
commit | eefa14473d35d03670a3fab9e9e190a14f64acd0 (patch) | |
tree | a4415623be1177c76f59a6ad881ca0dfff98db8e | |
parent | 1879ddcfa29e81780d569fa87df5592065a666e1 (diff) | |
download | gnunet-eefa14473d35d03670a3fab9e9e190a14f64acd0.tar.gz gnunet-eefa14473d35d03670a3fab9e9e190a14f64acd0.zip |
TNG: ValidationState now contains the addres prefix of the address being validated, because we have to check which communicator gave us the validation response.
-rw-r--r-- | src/transport/gnunet-service-tng.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index aea44d8ee..b2fa92ecc 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -8745,6 +8745,8 @@ struct CheckKnownChallengeContext | |||
8745 | * Set to a matching validation state, if one was found. | 8745 | * Set to a matching validation state, if one was found. |
8746 | */ | 8746 | */ |
8747 | struct ValidationState *vs; | 8747 | struct ValidationState *vs; |
8748 | |||
8749 | char *address_prefix; | ||
8748 | }; | 8750 | }; |
8749 | 8751 | ||
8750 | 8752 | ||
@@ -8766,7 +8768,8 @@ check_known_challenge (void *cls, | |||
8766 | struct ValidationState *vs = value; | 8768 | struct ValidationState *vs = value; |
8767 | 8769 | ||
8768 | (void) pid; | 8770 | (void) pid; |
8769 | if (0 != GNUNET_memcmp (&vs->challenge, ckac->challenge)) | 8771 | if (0 != GNUNET_memcmp (&vs->challenge, ckac->challenge) || |
8772 | NULL == strstr (vs->address, ckac->address_prefix)) | ||
8770 | return GNUNET_OK; | 8773 | return GNUNET_OK; |
8771 | ckac->vs = vs; | 8774 | ckac->vs = vs; |
8772 | return GNUNET_NO; | 8775 | return GNUNET_NO; |
@@ -8836,7 +8839,10 @@ handle_validation_response ( | |||
8836 | struct CommunicatorMessageContext *cmc = cls; | 8839 | struct CommunicatorMessageContext *cmc = cls; |
8837 | struct ValidationState *vs; | 8840 | struct ValidationState *vs; |
8838 | struct CheckKnownChallengeContext ckac = { .challenge = &tvr->challenge, | 8841 | struct CheckKnownChallengeContext ckac = { .challenge = &tvr->challenge, |
8839 | .vs = NULL }; | 8842 | .vs = NULL, |
8843 | .address_prefix = | ||
8844 | cmc->tc->details.communicator. | ||
8845 | address_prefix}; | ||
8840 | struct GNUNET_TIME_Absolute origin_time; | 8846 | struct GNUNET_TIME_Absolute origin_time; |
8841 | struct Queue *q; | 8847 | struct Queue *q; |
8842 | struct Neighbour *n; | 8848 | struct Neighbour *n; |