diff options
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 30 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord_misc.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord_serialization.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/perf_gnsrecord_crypto.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/plugin_gnsrecord_dns.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/test_gnsrecord_block_expiration.c | 18 | ||||
-rw-r--r-- | src/gnsrecord/test_gnsrecord_crypto.c | 21 | ||||
-rw-r--r-- | src/gnsrecord/test_gnsrecord_serialization.c | 124 |
9 files changed, 142 insertions, 141 deletions
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index ece1665fc..da34846e7 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2013 GNUnet e.V. | 3 | Copyright (C) 2009-2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index 6d3887392..295d31100 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2013, 2018 GNUnet e.V. | 3 | Copyright (C) 2009-2013, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
@@ -379,6 +377,8 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
379 | (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ) | 377 | (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ) |
380 | { | 378 | { |
381 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ | 379 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ |
380 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
381 | "Ignoring shadow record\n"); | ||
382 | break; | 382 | break; |
383 | } | 383 | } |
384 | } | 384 | } |
@@ -397,6 +397,16 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
397 | rd[j] = rd[i]; | 397 | rd[j] = rd[i]; |
398 | j++; | 398 | j++; |
399 | } | 399 | } |
400 | else | ||
401 | { | ||
402 | struct GNUNET_TIME_Absolute at; | ||
403 | |||
404 | at.abs_value_us = rd[i].expiration_time; | ||
405 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
406 | "Excluding record that expired %s (%llu ago)\n", | ||
407 | GNUNET_STRINGS_absolute_time_to_string (at), | ||
408 | (unsigned long long) rd[i].expiration_time - now.abs_value_us); | ||
409 | } | ||
400 | } | 410 | } |
401 | rd_count = j; | 411 | rd_count = j; |
402 | if (NULL != proc) | 412 | if (NULL != proc) |
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index 05f56cf70..5032647ef 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2013 GNUnet e.V. | 3 | Copyright (C) 2009-2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c index 77118ab94..adbf02755 100644 --- a/src/gnsrecord/gnsrecord_serialization.c +++ b/src/gnsrecord/gnsrecord_serialization.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2013 GNUnet e.V. | 3 | Copyright (C) 2009-2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
diff --git a/src/gnsrecord/perf_gnsrecord_crypto.c b/src/gnsrecord/perf_gnsrecord_crypto.c index ff9721006..35547ebc2 100644 --- a/src/gnsrecord/perf_gnsrecord_crypto.c +++ b/src/gnsrecord/perf_gnsrecord_crypto.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2018 GNUnet e.V. | 3 | Copyright (C) 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file gnsrecord/test_gnsrecord_crypto.c | 19 | * @file gnsrecord/test_gnsrecord_crypto.c |
diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c index 691936c16..188afcae7 100644 --- a/src/gnsrecord/plugin_gnsrecord_dns.c +++ b/src/gnsrecord/plugin_gnsrecord_dns.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2013, 2014 GNUnet e.V. | 3 | Copyright (C) 2013, 2014 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
diff --git a/src/gnsrecord/test_gnsrecord_block_expiration.c b/src/gnsrecord/test_gnsrecord_block_expiration.c index 3fab577a5..5bb14cdbc 100644 --- a/src/gnsrecord/test_gnsrecord_block_expiration.c +++ b/src/gnsrecord/test_gnsrecord_block_expiration.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file gnsrecord/test_gnsrecord_crypto.c | 19 | * @file gnsrecord/test_gnsrecord_crypto.c |
diff --git a/src/gnsrecord/test_gnsrecord_crypto.c b/src/gnsrecord/test_gnsrecord_crypto.c index 9ba303e66..5a78f8b25 100644 --- a/src/gnsrecord/test_gnsrecord_crypto.c +++ b/src/gnsrecord/test_gnsrecord_crypto.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file gnsrecord/test_gnsrecord_crypto.c | 19 | * @file gnsrecord/test_gnsrecord_crypto.c |
@@ -23,11 +21,12 @@ | |||
23 | */ | 21 | */ |
24 | #include "platform.h" | 22 | #include "platform.h" |
25 | #include "gnunet_util_lib.h" | 23 | #include "gnunet_util_lib.h" |
24 | #include "gnunet_dnsparser_lib.h" | ||
26 | #include "gnunet_gnsrecord_lib.h" | 25 | #include "gnunet_gnsrecord_lib.h" |
27 | 26 | ||
28 | #define RECORDS 5 | 27 | #define RECORDS 5 |
29 | 28 | ||
30 | #define TEST_RECORD_TYPE 1234 | 29 | #define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT |
31 | 30 | ||
32 | #define TEST_RECORD_DATALEN 123 | 31 | #define TEST_RECORD_DATALEN 123 |
33 | 32 | ||
diff --git a/src/gnsrecord/test_gnsrecord_serialization.c b/src/gnsrecord/test_gnsrecord_serialization.c index 3edd2bc48..03a4d8b03 100644 --- a/src/gnsrecord/test_gnsrecord_serialization.c +++ b/src/gnsrecord/test_gnsrecord_serialization.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file gnsrecord/test_gnsrecord_serialization.c | 19 | * @file gnsrecord/test_gnsrecord_serialization.c |
@@ -24,6 +22,7 @@ | |||
24 | #include "platform.h" | 22 | #include "platform.h" |
25 | #include "gnunet_util_lib.h" | 23 | #include "gnunet_util_lib.h" |
26 | #include "gnunet_gnsrecord_lib.h" | 24 | #include "gnunet_gnsrecord_lib.h" |
25 | #include "gnunet_dnsparser_lib.h" | ||
27 | 26 | ||
28 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) | 27 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) |
29 | 28 | ||
@@ -31,7 +30,9 @@ static int res; | |||
31 | 30 | ||
32 | 31 | ||
33 | static void | 32 | static void |
34 | run (void *cls, char *const *args, const char *cfgfile, | 33 | run (void *cls, |
34 | char *const *args, | ||
35 | const char *cfgfile, | ||
35 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 36 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
36 | { | 37 | { |
37 | size_t len; | 38 | size_t len; |
@@ -46,7 +47,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
46 | data_len = 0; | 47 | data_len = 0; |
47 | for (c = 0; c < rd_count; c++) | 48 | for (c = 0; c < rd_count; c++) |
48 | { | 49 | { |
49 | src[c].record_type = c+1; | 50 | src[c].record_type = GNUNET_DNSPARSER_TYPE_TXT; |
50 | src[c].data_size = data_len; | 51 | src[c].data_size = data_len; |
51 | src[c].data = GNUNET_malloc (data_len); | 52 | src[c].data = GNUNET_malloc (data_len); |
52 | 53 | ||
@@ -69,58 +70,61 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
69 | (unsigned int) len); | 70 | (unsigned int) len); |
70 | 71 | ||
71 | GNUNET_assert (rd_ser != NULL); | 72 | GNUNET_assert (rd_ser != NULL); |
72 | |||
73 | struct GNUNET_GNSRECORD_Data dst[rd_count]; | ||
74 | GNUNET_assert (GNUNET_OK == | ||
75 | GNUNET_GNSRECORD_records_deserialize (len, | ||
76 | rd_ser, | ||
77 | rd_count, | ||
78 | dst)); | ||
79 | |||
80 | GNUNET_assert (dst != NULL); | ||
81 | |||
82 | for (c = 0; c < rd_count; c++) | ||
83 | { | 73 | { |
84 | if (src[c].data_size != dst[c].data_size) | 74 | struct GNUNET_GNSRECORD_Data dst[rd_count]; |
85 | { | 75 | GNUNET_assert (GNUNET_OK == |
86 | GNUNET_break (0); | 76 | GNUNET_GNSRECORD_records_deserialize (len, |
87 | res = 1; | 77 | rd_ser, |
88 | } | 78 | rd_count, |
89 | if (src[c].expiration_time != dst[c].expiration_time) | 79 | dst)); |
90 | { | ||
91 | GNUNET_break (0); | ||
92 | res = 1; | ||
93 | } | ||
94 | if (src[c].flags != dst[c].flags) | ||
95 | { | ||
96 | GNUNET_break (0); | ||
97 | res = 1; | ||
98 | } | ||
99 | if (src[c].record_type != dst[c].record_type) | ||
100 | { | ||
101 | GNUNET_break (0); | ||
102 | res = 1; | ||
103 | } | ||
104 | 80 | ||
105 | size_t data_size = src[c].data_size; | 81 | GNUNET_assert (dst != NULL); |
106 | char data[data_size]; | 82 | |
107 | memset (data, 'a', data_size); | 83 | for (c = 0; c < rd_count; c++) |
108 | if (0 != memcmp (data, dst[c].data, data_size)) | ||
109 | { | ||
110 | GNUNET_break (0); | ||
111 | res = 1; | ||
112 | } | ||
113 | if (0 != memcmp (data, src[c].data, data_size)) | ||
114 | { | ||
115 | GNUNET_break (0); | ||
116 | res = 1; | ||
117 | } | ||
118 | if (0 != memcmp (src[c].data, dst[c].data, src[c].data_size)) | ||
119 | { | 84 | { |
120 | GNUNET_break (0); | 85 | if (src[c].data_size != dst[c].data_size) |
121 | res = 1; | 86 | { |
87 | GNUNET_break (0); | ||
88 | res = 1; | ||
89 | } | ||
90 | if (src[c].expiration_time != dst[c].expiration_time) | ||
91 | { | ||
92 | GNUNET_break (0); | ||
93 | res = 1; | ||
94 | } | ||
95 | if (src[c].flags != dst[c].flags) | ||
96 | { | ||
97 | GNUNET_break (0); | ||
98 | res = 1; | ||
99 | } | ||
100 | if (src[c].record_type != dst[c].record_type) | ||
101 | { | ||
102 | GNUNET_break (0); | ||
103 | res = 1; | ||
104 | } | ||
105 | |||
106 | { | ||
107 | size_t data_size = src[c].data_size; | ||
108 | char data[data_size]; | ||
109 | |||
110 | memset (data, 'a', data_size); | ||
111 | if (0 != memcmp (data, dst[c].data, data_size)) | ||
112 | { | ||
113 | GNUNET_break (0); | ||
114 | res = 1; | ||
115 | } | ||
116 | if (0 != memcmp (data, src[c].data, data_size)) | ||
117 | { | ||
118 | GNUNET_break (0); | ||
119 | res = 1; | ||
120 | } | ||
121 | if (0 != memcmp (src[c].data, dst[c].data, src[c].data_size)) | ||
122 | { | ||
123 | GNUNET_break (0); | ||
124 | res = 1; | ||
125 | } | ||
126 | } | ||
122 | } | 127 | } |
123 | |||
124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Element [%i]: EQUAL\n", c); | 128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Element [%i]: EQUAL\n", c); |
125 | } | 129 | } |
126 | 130 | ||