aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-25 13:56:11 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-25 13:56:11 +0200
commit567469d45952ec5df4c9dea18207bde3768de52d (patch)
tree019d1f624fbdc72f35d1c0516aa411fc7d02fef1
parent209277b433f079991373f8e58a0c6708b14f56c1 (diff)
downloadgnunet-567469d45952ec5df4c9dea18207bde3768de52d.tar.gz
gnunet-567469d45952ec5df4c9dea18207bde3768de52d.zip
double-check GP/PP are finenlnet-r5n-audit
-rwxr-xr-xsrc/dht/dhtu_testbed_deploy.sh2
-rw-r--r--src/dht/gnunet-dht-get.c17
-rw-r--r--src/dht/gnunet-service-dht_clients.c58
-rw-r--r--src/include/gnunet_crypto_lib.h2
4 files changed, 56 insertions, 23 deletions
diff --git a/src/dht/dhtu_testbed_deploy.sh b/src/dht/dhtu_testbed_deploy.sh
index 3a2ffeff0..648da7313 100755
--- a/src/dht/dhtu_testbed_deploy.sh
+++ b/src/dht/dhtu_testbed_deploy.sh
@@ -60,7 +60,7 @@ do
60 PORT=`expr $MINPORT + $n` 60 PORT=`expr $MINPORT + $n`
61 CFG="/tmp/deployment/${n}.conf" 61 CFG="/tmp/deployment/${n}.conf"
62 cat dhtu_testbed_deploy.conf | sed -e "s/%N%/$PORT/" > $CFG 62 cat dhtu_testbed_deploy.conf | sed -e "s/%N%/$PORT/" > $CFG
63 gnunet-service-dht -c $CFG &> /tmp/deployment/$n.log & 63 gnunet-service-dht -c $CFG -L DEBUG &> /tmp/deployment/$n.log &
64 echo -n "." 64 echo -n "."
65done 65done
66 66
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 7e3cd3e44..1ae9235f8 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -171,6 +171,23 @@ get_result_iterator (void *cls,
171 (char *) data); 171 (char *) data);
172 if (record_route && verbose) 172 if (record_route && verbose)
173 { 173 {
174 {
175 struct GNUNET_PeerIdentity my_identity;
176
177 GNUNET_break (GNUNET_OK ==
178 GNUNET_CRYPTO_get_peer_identity (cfg,
179 &my_identity));
180 GNUNET_break (0 ==
181 GNUNET_DHT_verify_path (data,
182 size,
183 exp,
184 trunc_peer,
185 put_path,
186 put_path_length,
187 get_path,
188 get_path_length,
189 &my_identity));
190 }
174 fprintf (stdout, 191 fprintf (stdout,
175 " GET path: "); 192 " GET path: ");
176 for (unsigned int i = 0; i < get_path_length; i++) 193 for (unsigned int i = 0; i < get_path_length; i++)
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index fdcc31f13..c0c0b9a33 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -917,13 +917,13 @@ forward_reply (void *cls,
917 917
918 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, 918 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
919 "CLIENT-RESULT %s\n", 919 "CLIENT-RESULT %s\n",
920 GNUNET_h2s_full (&frc->bd->key)); 920 GNUNET_h2s_full (&bd->key));
921 if ( (record->type != GNUNET_BLOCK_TYPE_ANY) && 921 if ( (record->type != GNUNET_BLOCK_TYPE_ANY) &&
922 (record->type != frc->bd->type) ) 922 (record->type != bd->type) )
923 { 923 {
924 LOG (GNUNET_ERROR_TYPE_DEBUG, 924 LOG (GNUNET_ERROR_TYPE_DEBUG,
925 "Record type mismatch, not passing request for key %s to local client\n", 925 "Record type mismatch, not passing request for key %s to local client\n",
926 GNUNET_h2s (&frc->bd->key)); 926 GNUNET_h2s (&bd->key));
927 GNUNET_STATISTICS_update (GDS_stats, 927 GNUNET_STATISTICS_update (GDS_stats,
928 "# Key match, type mismatches in REPLY to CLIENT", 928 "# Key match, type mismatches in REPLY to CLIENT",
929 1, 929 1,
@@ -931,7 +931,7 @@ forward_reply (void *cls,
931 return GNUNET_YES; /* type mismatch */ 931 return GNUNET_YES; /* type mismatch */
932 } 932 }
933 if ( (0 == (record->msg_options & GNUNET_DHT_RO_FIND_APPROXIMATE)) && 933 if ( (0 == (record->msg_options & GNUNET_DHT_RO_FIND_APPROXIMATE)) &&
934 (0 != GNUNET_memcmp (&frc->bd->key, 934 (0 != GNUNET_memcmp (&bd->key,
935 query_hash)) ) 935 query_hash)) )
936 { 936 {
937 GNUNET_STATISTICS_update (GDS_stats, 937 GNUNET_STATISTICS_update (GDS_stats,
@@ -940,8 +940,8 @@ forward_reply (void *cls,
940 GNUNET_NO); 940 GNUNET_NO);
941 return GNUNET_YES; /* type mismatch */ 941 return GNUNET_YES; /* type mismatch */
942 } 942 }
943 GNUNET_CRYPTO_hash (frc->bd->data, 943 GNUNET_CRYPTO_hash (bd->data,
944 frc->bd->data_size, 944 bd->data_size,
945 &ch); 945 &ch);
946 for (unsigned int i = 0; i < record->seen_replies_count; i++) 946 for (unsigned int i = 0; i < record->seen_replies_count; i++)
947 if (0 == 947 if (0 ==
@@ -950,7 +950,7 @@ forward_reply (void *cls,
950 { 950 {
951 LOG (GNUNET_ERROR_TYPE_DEBUG, 951 LOG (GNUNET_ERROR_TYPE_DEBUG,
952 "Duplicate reply, not passing request for key %s to local client\n", 952 "Duplicate reply, not passing request for key %s to local client\n",
953 GNUNET_h2s (&frc->bd->key)); 953 GNUNET_h2s (&bd->key));
954 GNUNET_STATISTICS_update (GDS_stats, 954 GNUNET_STATISTICS_update (GDS_stats,
955 "# Duplicate REPLIES to CLIENT request dropped", 955 "# Duplicate REPLIES to CLIENT request dropped",
956 1, 956 1,
@@ -961,15 +961,15 @@ forward_reply (void *cls,
961 = GNUNET_BLOCK_check_reply (GDS_block_context, 961 = GNUNET_BLOCK_check_reply (GDS_block_context,
962 record->type, 962 record->type,
963 NULL, 963 NULL,
964 &frc->bd->key, 964 &bd->key,
965 record->xquery, 965 record->xquery,
966 record->xquery_size, 966 record->xquery_size,
967 frc->bd->data, 967 bd->data,
968 frc->bd->data_size); 968 bd->data_size);
969 LOG (GNUNET_ERROR_TYPE_DEBUG, 969 LOG (GNUNET_ERROR_TYPE_DEBUG,
970 "Evaluation result is %d for key %s for local client's query\n", 970 "Evaluation result is %d for key %s for local client's query\n",
971 (int) eval, 971 (int) eval,
972 GNUNET_h2s (&frc->bd->key)); 972 GNUNET_h2s (&bd->key));
973 switch (eval) 973 switch (eval)
974 { 974 {
975 case GNUNET_BLOCK_REPLY_OK_LAST: 975 case GNUNET_BLOCK_REPLY_OK_LAST:
@@ -996,19 +996,35 @@ forward_reply (void *cls,
996 "# RESULTS queued for clients", 996 "# RESULTS queued for clients",
997 1, 997 1,
998 GNUNET_NO); 998 GNUNET_NO);
999 xsize += (frc->get_path_length + frc->bd->put_path_length) 999 xsize += (frc->get_path_length + bd->put_path_length)
1000 * sizeof(struct GNUNET_DHT_PathElement); 1000 * sizeof(struct GNUNET_DHT_PathElement);
1001 if (truncated) 1001 if (truncated)
1002 xsize += sizeof (struct GNUNET_PeerIdentity); 1002 xsize += sizeof (struct GNUNET_PeerIdentity);
1003
1004#if SUPER_REDUNDANT_CHECK
1005 GNUNET_break (0 ==
1006 GNUNET_DHT_verify_path (bd->data,
1007 bd->data_size,
1008 bd->expiration_time,
1009 truncated
1010 ? &bd->trunc_peer
1011 : NULL,
1012 bd->put_path,
1013 bd->put_path_length,
1014 frc->get_path,
1015 frc->get_path_length,
1016 &GDS_my_identity));
1017#endif
1018
1003 env = GNUNET_MQ_msg_extra (reply, 1019 env = GNUNET_MQ_msg_extra (reply,
1004 xsize, 1020 xsize,
1005 GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT); 1021 GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT);
1006 reply->type = htonl (frc->bd->type); 1022 reply->type = htonl (bd->type);
1007 reply->options = htonl (bd->ro); 1023 reply->options = htonl (bd->ro);
1008 reply->get_path_length = htonl (frc->get_path_length); 1024 reply->get_path_length = htonl (frc->get_path_length);
1009 reply->put_path_length = htonl (frc->bd->put_path_length); 1025 reply->put_path_length = htonl (bd->put_path_length);
1010 reply->unique_id = record->unique_id; 1026 reply->unique_id = record->unique_id;
1011 reply->expiration = GNUNET_TIME_absolute_hton (frc->bd->expiration_time); 1027 reply->expiration = GNUNET_TIME_absolute_hton (bd->expiration_time);
1012 reply->key = *query_hash; 1028 reply->key = *query_hash;
1013 if (truncated) 1029 if (truncated)
1014 { 1030 {
@@ -1025,16 +1041,16 @@ forward_reply (void *cls,
1025 paths = (struct GNUNET_DHT_PathElement *) &reply[1]; 1041 paths = (struct GNUNET_DHT_PathElement *) &reply[1];
1026 } 1042 }
1027 GNUNET_memcpy (paths, 1043 GNUNET_memcpy (paths,
1028 frc->bd->put_path, 1044 bd->put_path,
1029 sizeof(struct GNUNET_DHT_PathElement) 1045 sizeof(struct GNUNET_DHT_PathElement)
1030 * frc->bd->put_path_length); 1046 * bd->put_path_length);
1031 GNUNET_memcpy (&paths[frc->bd->put_path_length], 1047 GNUNET_memcpy (&paths[bd->put_path_length],
1032 frc->get_path, 1048 frc->get_path,
1033 sizeof(struct GNUNET_DHT_PathElement) 1049 sizeof(struct GNUNET_DHT_PathElement)
1034 * frc->get_path_length); 1050 * frc->get_path_length);
1035 GNUNET_memcpy (&paths[frc->get_path_length + frc->bd->put_path_length], 1051 GNUNET_memcpy (&paths[frc->get_path_length + bd->put_path_length],
1036 frc->bd->data, 1052 bd->data,
1037 frc->bd->data_size); 1053 bd->data_size);
1038 LOG (GNUNET_ERROR_TYPE_DEBUG, 1054 LOG (GNUNET_ERROR_TYPE_DEBUG,
1039 "Sending reply to query %s for client %p\n", 1055 "Sending reply to query %s for client %p\n",
1040 GNUNET_h2s (query_hash), 1056 GNUNET_h2s (query_hash),
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index ff14b09ca..cfb8e5fa5 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -1635,7 +1635,7 @@ GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name);
1635 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the identity 1635 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the identity
1636 * could not be retrieved 1636 * could not be retrieved
1637 */ 1637 */
1638int 1638enum GNUNET_GenericReturnValue
1639GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, 1639GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
1640 struct GNUNET_PeerIdentity *dst); 1640 struct GNUNET_PeerIdentity *dst);
1641 1641