aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_kx.c
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-07-14 20:09:36 +0200
committert3sserakt <t3ss@posteo.de>2023-07-14 20:09:36 +0200
commit61bbc04e96076a7cfd65a574be51655be052b733 (patch)
tree95f52bef9d87da6b9fb262caa636d765ea92b635 /src/core/gnunet-service-core_kx.c
parent4ba7b5f6cb1ca15a4049fc0288fdd8182d63ab00 (diff)
downloadgnunet-61bbc04e96076a7cfd65a574be51655be052b733.tar.gz
gnunet-61bbc04e96076a7cfd65a574be51655be052b733.zip
CORE: Fixed bug that core is not calling GNUNET_TRANSPORT_core_receive_continue
Diffstat (limited to 'src/core/gnunet-service-core_kx.c')
-rw-r--r--src/core/gnunet-service-core_kx.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index 774f967e3..ca7bccbd9 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -515,10 +515,10 @@ do_encrypt (struct GSC_KeyExchangeInfo *kx,
515 so we require manual intervention to get this one... */ 515 so we require manual intervention to get this one... */
516#if DEBUG_KX 516#if DEBUG_KX
517 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 517 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
518 "Encrypted %u bytes for `%s' using key %u, IV %u\n", 518 "Encrypted %u bytes for `%s' using key %s, IV %u\n",
519 (unsigned int) size, 519 (unsigned int) size,
520 GNUNET_i2s (kx->peer), 520 GNUNET_i2s (kx->peer),
521 (unsigned int) kx->encrypt_key.crc32, 521 kx->encrypt_key.aes_key,
522 GNUNET_CRYPTO_crc32_n (iv, sizeof(iv))); 522 GNUNET_CRYPTO_crc32_n (iv, sizeof(iv)));
523#endif 523#endif
524 return GNUNET_OK; 524 return GNUNET_OK;
@@ -573,10 +573,10 @@ do_decrypt (struct GSC_KeyExchangeInfo *kx,
573 so we require manual intervention to get this one... */ 573 so we require manual intervention to get this one... */
574#if DEBUG_KX 574#if DEBUG_KX
575 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 575 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
576 "Decrypted %u bytes from `%s' using key %u, IV %u\n", 576 "Decrypted %u bytes from `%s' using key %s, IV %u\n",
577 (unsigned int) size, 577 (unsigned int) size,
578 GNUNET_i2s (kx->peer), 578 GNUNET_i2s (kx->peer),
579 (unsigned int) kx->decrypt_key.crc32, 579 kx->decrypt_key.aes_key,
580 GNUNET_CRYPTO_crc32_n (iv, sizeof(*iv))); 580 GNUNET_CRYPTO_crc32_n (iv, sizeof(*iv)));
581#endif 581#endif
582 return GNUNET_OK; 582 return GNUNET_OK;
@@ -868,6 +868,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
868 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 868 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
869 "Received expired EPHEMERAL_KEY from %s\n", 869 "Received expired EPHEMERAL_KEY from %s\n",
870 GNUNET_i2s (&m->origin_identity)); 870 GNUNET_i2s (&m->origin_identity));
871 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
871 return; 872 return;
872 } 873 }
873 if (0 == memcmp (&m->ephemeral_key, 874 if (0 == memcmp (&m->ephemeral_key,
@@ -882,6 +883,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
882 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 883 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
883 "Ignoring duplicate EPHEMERAL_KEY from %s\n", 884 "Ignoring duplicate EPHEMERAL_KEY from %s\n",
884 GNUNET_i2s (&m->origin_identity)); 885 GNUNET_i2s (&m->origin_identity));
886 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
885 return; 887 return;
886 } 888 }
887 if (0 != memcmp (&m->origin_identity, 889 if (0 != memcmp (&m->origin_identity,
@@ -893,6 +895,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
893 GNUNET_i2s (&m->origin_identity), 895 GNUNET_i2s (&m->origin_identity),
894 GNUNET_i2s_full (kx->peer)); 896 GNUNET_i2s_full (kx->peer));
895 GNUNET_break_op (0); 897 GNUNET_break_op (0);
898 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
896 return; 899 return;
897 } 900 }
898 if ((ntohl (m->purpose.size) != 901 if ((ntohl (m->purpose.size) !=
@@ -917,6 +920,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
917 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 920 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
918 "Received EPHEMERAL_KEY from %s with bad signature\n", 921 "Received EPHEMERAL_KEY from %s with bad signature\n",
919 GNUNET_i2s (&m->origin_identity)); 922 GNUNET_i2s (&m->origin_identity));
923 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
920 return; 924 return;
921 } 925 }
922 now = GNUNET_TIME_absolute_get (); 926 now = GNUNET_TIME_absolute_get ();
@@ -939,6 +943,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
939 "# EPHEMERAL_KEY messages rejected due to time"), 943 "# EPHEMERAL_KEY messages rejected due to time"),
940 1, 944 1,
941 GNUNET_NO); 945 GNUNET_NO);
946 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
942 return; 947 return;
943 } 948 }
944#if DEBUG_KX 949#if DEBUG_KX
@@ -1042,6 +1047,7 @@ handle_ephemeral_key (void *cls, const struct EphemeralKeyMessage *m)
1042 GNUNET_break (0); 1047 GNUNET_break (0);
1043 break; 1048 break;
1044 } 1049 }
1050 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1045} 1051}
1046 1052
1047 1053
@@ -1076,6 +1082,7 @@ handle_ping (void *cls, const struct PingMessage *m)
1076 "# PING messages dropped (out of order)"), 1082 "# PING messages dropped (out of order)"),
1077 1, 1083 1,
1078 GNUNET_NO); 1084 GNUNET_NO);
1085 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1079 return; 1086 return;
1080 } 1087 }
1081 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1088 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1090,6 +1097,7 @@ handle_ping (void *cls, const struct PingMessage *m)
1090 - ((void *) &m->target - (void *) m))) 1097 - ((void *) &m->target - (void *) m)))
1091 { 1098 {
1092 GNUNET_break_op (0); 1099 GNUNET_break_op (0);
1100 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1093 return; 1101 return;
1094 } 1102 }
1095 if (0 != 1103 if (0 !=
@@ -1106,6 +1114,7 @@ handle_ping (void *cls, const struct PingMessage *m)
1106 "Decryption of PING from peer `%s' failed after rekey (harmless)\n", 1114 "Decryption of PING from peer `%s' failed after rekey (harmless)\n",
1107 GNUNET_i2s (kx->peer)); 1115 GNUNET_i2s (kx->peer));
1108 GNUNET_break_op (0); 1116 GNUNET_break_op (0);
1117 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1109 return; 1118 return;
1110 } 1119 }
1111 /* construct PONG */ 1120 /* construct PONG */
@@ -1228,6 +1237,7 @@ handle_pong (void *cls, const struct PongMessage *m)
1228 "# PONG messages dropped (connection down)"), 1237 "# PONG messages dropped (connection down)"),
1229 1, 1238 1,
1230 GNUNET_NO); 1239 GNUNET_NO);
1240 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1231 return; 1241 return;
1232 1242
1233 case GNUNET_CORE_KX_STATE_KEY_SENT: 1243 case GNUNET_CORE_KX_STATE_KEY_SENT:
@@ -1236,6 +1246,7 @@ handle_pong (void *cls, const struct PongMessage *m)
1236 "# PONG messages dropped (out of order)"), 1246 "# PONG messages dropped (out of order)"),
1237 1, 1247 1,
1238 GNUNET_NO); 1248 GNUNET_NO);
1249 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1239 return; 1250 return;
1240 1251
1241 case GNUNET_CORE_KX_STATE_KEY_RECEIVED: 1252 case GNUNET_CORE_KX_STATE_KEY_RECEIVED:
@@ -1249,6 +1260,7 @@ handle_pong (void *cls, const struct PongMessage *m)
1249 1260
1250 default: 1261 default:
1251 GNUNET_break (0); 1262 GNUNET_break (0);
1263 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1252 return; 1264 return;
1253 } 1265 }
1254 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1266 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1269,6 +1281,7 @@ handle_pong (void *cls, const struct PongMessage *m)
1269 - ((void *) &m->challenge - (void *) m))) 1281 - ((void *) &m->challenge - (void *) m)))
1270 { 1282 {
1271 GNUNET_break_op (0); 1283 GNUNET_break_op (0);
1284 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1272 return; 1285 return;
1273 } 1286 }
1274 GNUNET_STATISTICS_update (GSC_stats, 1287 GNUNET_STATISTICS_update (GSC_stats,
@@ -1288,6 +1301,7 @@ handle_pong (void *cls, const struct PongMessage *m)
1288 "Received malformed PONG received from `%s' with challenge %u\n", 1301 "Received malformed PONG received from `%s' with challenge %u\n",
1289 GNUNET_i2s (&t.target), 1302 GNUNET_i2s (&t.target),
1290 (unsigned int) t.challenge); 1303 (unsigned int) t.challenge);
1304 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1291 return; 1305 return;
1292 } 1306 }
1293 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1303,10 +1317,12 @@ handle_pong (void *cls, const struct PongMessage *m)
1303 { 1317 {
1304 case GNUNET_CORE_KX_STATE_DOWN: 1318 case GNUNET_CORE_KX_STATE_DOWN:
1305 GNUNET_assert (0); /* should be impossible */ 1319 GNUNET_assert (0); /* should be impossible */
1320 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1306 return; 1321 return;
1307 1322
1308 case GNUNET_CORE_KX_STATE_KEY_SENT: 1323 case GNUNET_CORE_KX_STATE_KEY_SENT:
1309 GNUNET_assert (0); /* should be impossible */ 1324 GNUNET_assert (0); /* should be impossible */
1325 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1310 return; 1326 return;
1311 1327
1312 case GNUNET_CORE_KX_STATE_KEY_RECEIVED: 1328 case GNUNET_CORE_KX_STATE_KEY_RECEIVED:
@@ -1505,6 +1521,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1505 "# DATA message dropped (out of order)"), 1521 "# DATA message dropped (out of order)"),
1506 1, 1522 1,
1507 GNUNET_NO); 1523 GNUNET_NO);
1524 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1508 return; 1525 return;
1509 } 1526 }
1510 if (0 == 1527 if (0 ==
@@ -1529,6 +1546,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1529 kx->status = GNUNET_CORE_KX_STATE_KEY_SENT; 1546 kx->status = GNUNET_CORE_KX_STATE_KEY_SENT;
1530 monitor_notify_all (kx); 1547 monitor_notify_all (kx);
1531 send_key (kx); 1548 send_key (kx);
1549 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1532 return; 1550 return;
1533 } 1551 }
1534 1552
@@ -1568,6 +1586,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1568 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1586 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1569 "Failed checksum validation for a message from `%s'\n", 1587 "Failed checksum validation for a message from `%s'\n",
1570 GNUNET_i2s (kx->peer)); 1588 GNUNET_i2s (kx->peer));
1589 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1571 return; 1590 return;
1572 } 1591 }
1573 derive_iv (&iv, &kx->decrypt_key, m->iv_seed, &GSC_my_identity); 1592 derive_iv (&iv, &kx->decrypt_key, m->iv_seed, &GSC_my_identity);
@@ -1579,6 +1598,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1579 size - ENCRYPTED_HEADER_SIZE)) 1598 size - ENCRYPTED_HEADER_SIZE))
1580 { 1599 {
1581 GNUNET_break_op (0); 1600 GNUNET_break_op (0);
1601 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1582 return; 1602 return;
1583 } 1603 }
1584 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1604 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1598,6 +1618,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1598 gettext_noop ("# bytes dropped (duplicates)"), 1618 gettext_noop ("# bytes dropped (duplicates)"),
1599 size, 1619 size,
1600 GNUNET_NO); 1620 GNUNET_NO);
1621 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1601 return; 1622 return;
1602 } 1623 }
1603 if ((kx->last_sequence_number_received > snum) && 1624 if ((kx->last_sequence_number_received > snum) &&
@@ -1611,6 +1632,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1611 "# bytes dropped (out of sequence)"), 1632 "# bytes dropped (out of sequence)"),
1612 size, 1633 size,
1613 GNUNET_NO); 1634 GNUNET_NO);
1635 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1614 return; 1636 return;
1615 } 1637 }
1616 if (kx->last_sequence_number_received > snum) 1638 if (kx->last_sequence_number_received > snum)
@@ -1626,6 +1648,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1626 size, 1648 size,
1627 GNUNET_NO); 1649 GNUNET_NO);
1628 /* duplicate, ignore */ 1650 /* duplicate, ignore */
1651 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1629 return; 1652 return;
1630 } 1653 }
1631 kx->last_packets_bitmap |= rotbit; 1654 kx->last_packets_bitmap |= rotbit;
@@ -1656,6 +1679,7 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1656 "# bytes dropped (ancient message)"), 1679 "# bytes dropped (ancient message)"),
1657 size, 1680 size,
1658 GNUNET_NO); 1681 GNUNET_NO);
1682 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1659 return; 1683 return;
1660 } 1684 }
1661 1685
@@ -1672,6 +1696,8 @@ handle_encrypted (void *cls, const struct EncryptedMessage *m)
1672 GNUNET_YES, 1696 GNUNET_YES,
1673 GNUNET_NO)) 1697 GNUNET_NO))
1674 GNUNET_break_op (0); 1698 GNUNET_break_op (0);
1699
1700 GNUNET_TRANSPORT_core_receive_continue (transport, kx->peer);
1675} 1701}
1676 1702
1677 1703