aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbootstrap5
m---------contrib/gana0
m---------contrib/sphinx0
-rw-r--r--src/gnsrecord/gnsrecord_crypto.c12
-rw-r--r--src/gnsrecord/gnsrecord_misc.c2
-rw-r--r--src/gnsrecord/json_gnsrecord.c4
-rw-r--r--src/include/gnunet_gnsrecord_lib.h42
-rw-r--r--src/namestore/gnunet-namestore.c10
8 files changed, 20 insertions, 55 deletions
diff --git a/bootstrap b/bootstrap
index fbe03c6f7..a17324dd7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -132,10 +132,13 @@ gana_update()
132 cwd=$PWD 132 cwd=$PWD
133 cd contrib/gana || exit 1 133 cd contrib/gana || exit 1
134 # GNS 134 # GNS
135 echo "Updating GNS record types" 135 echo "Updating GNS record types/flags"
136 cd gnu-name-system-record-types && \ 136 cd gnu-name-system-record-types && \
137 make >/dev/null && \ 137 make >/dev/null && \
138 cp gnu_name_system_record_types.h ../../../src/include/ || exit 1 138 cp gnu_name_system_record_types.h ../../../src/include/ || exit 1
139 cd gnu-name-system-record-flags && \
140 make >/dev/null && \
141 cp gnu_name_system_record_flags.h ../../../src/include/ || exit 1
139 echo "Creating default TLDs" 142 echo "Creating default TLDs"
140 cd ../gnu-name-system-default-tlds && \ 143 cd ../gnu-name-system-default-tlds && \
141 make >/dev/null && \ 144 make >/dev/null && \
diff --git a/contrib/gana b/contrib/gana
Subproject 6b9824cb4d4561f1167c7f518998a226a82222d Subproject 092edfe57896d5f0fdf11008a4cba561203dfad
diff --git a/contrib/sphinx b/contrib/sphinx
Subproject 84cb6aaaaebe9b79d5453a8444ee95459c8f502 Subproject 4f40b5deca02c8dc64ff6c73e6602e6abdd1bae
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c
index d794c9cb4..a62304c40 100644
--- a/src/gnsrecord/gnsrecord_crypto.c
+++ b/src/gnsrecord/gnsrecord_crypto.c
@@ -793,7 +793,7 @@ block_decrypt_ecdsa (const struct GNUNET_GNSRECORD_Block *block,
793 continue; 793 continue;
794 } 794 }
795 795
796 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) 796 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW))
797 { 797 {
798 int include_record = GNUNET_YES; 798 int include_record = GNUNET_YES;
799 /* Shadow record, figure out if we have a not expired active record */ 799 /* Shadow record, figure out if we have a not expired active record */
@@ -805,7 +805,7 @@ block_decrypt_ecdsa (const struct GNUNET_GNSRECORD_Block *block,
805 include_record = GNUNET_NO; /* Shadow record is expired */ 805 include_record = GNUNET_NO; /* Shadow record is expired */
806 if ((rd[k].record_type == rd[i].record_type) && 806 if ((rd[k].record_type == rd[i].record_type) &&
807 (rd[k].expiration_time >= now.abs_value_us) && 807 (rd[k].expiration_time >= now.abs_value_us) &&
808 (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) 808 (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW)))
809 { 809 {
810 include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ 810 include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */
811 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 811 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -815,7 +815,7 @@ block_decrypt_ecdsa (const struct GNUNET_GNSRECORD_Block *block,
815 } 815 }
816 if (GNUNET_YES == include_record) 816 if (GNUNET_YES == include_record)
817 { 817 {
818 rd[i].flags ^= GNUNET_GNSRECORD_RF_SHADOW_RECORD; /* Remove Flag */ 818 rd[i].flags ^= GNUNET_GNSRECORD_RF_SHADOW; /* Remove Flag */
819 if (j != i) 819 if (j != i)
820 rd[j] = rd[i]; 820 rd[j] = rd[i];
821 j++; 821 j++;
@@ -919,7 +919,7 @@ block_decrypt_eddsa (const struct GNUNET_GNSRECORD_Block *block,
919 continue; 919 continue;
920 } 920 }
921 921
922 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) 922 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW))
923 { 923 {
924 int include_record = GNUNET_YES; 924 int include_record = GNUNET_YES;
925 /* Shadow record, figure out if we have a not expired active record */ 925 /* Shadow record, figure out if we have a not expired active record */
@@ -931,7 +931,7 @@ block_decrypt_eddsa (const struct GNUNET_GNSRECORD_Block *block,
931 include_record = GNUNET_NO; /* Shadow record is expired */ 931 include_record = GNUNET_NO; /* Shadow record is expired */
932 if ((rd[k].record_type == rd[i].record_type) && 932 if ((rd[k].record_type == rd[i].record_type) &&
933 (rd[k].expiration_time >= now.abs_value_us) && 933 (rd[k].expiration_time >= now.abs_value_us) &&
934 (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) 934 (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW)))
935 { 935 {
936 include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ 936 include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */
937 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 937 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -941,7 +941,7 @@ block_decrypt_eddsa (const struct GNUNET_GNSRECORD_Block *block,
941 } 941 }
942 if (GNUNET_YES == include_record) 942 if (GNUNET_YES == include_record)
943 { 943 {
944 rd[i].flags ^= GNUNET_GNSRECORD_RF_SHADOW_RECORD; /* Remove Flag */ 944 rd[i].flags ^= GNUNET_GNSRECORD_RF_SHADOW; /* Remove Flag */
945 if (j != i) 945 if (j != i)
946 rd[j] = rd[i]; 946 rd[j] = rd[i];
947 j++; 947 j++;
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 97ca7b135..e225bcc7f 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -173,7 +173,7 @@ GNUNET_GNSRECORD_record_get_expiration_time (unsigned int rd_count,
173 /* Check for shadow record */ 173 /* Check for shadow record */
174 if ((c == c2) || 174 if ((c == c2) ||
175 (rd[c].record_type != rd[c2].record_type) || 175 (rd[c].record_type != rd[c2].record_type) ||
176 (0 == (rd[c2].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) 176 (0 == (rd[c2].flags & GNUNET_GNSRECORD_RF_SHADOW)))
177 continue; 177 continue;
178 /* We have a shadow record */ 178 /* We have a shadow record */
179 if (0 != (rd[c2].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) 179 if (0 != (rd[c2].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
diff --git a/src/gnsrecord/json_gnsrecord.c b/src/gnsrecord/json_gnsrecord.c
index 2b840ab30..0725cb1a1 100644
--- a/src/gnsrecord/json_gnsrecord.c
+++ b/src/gnsrecord/json_gnsrecord.c
@@ -168,7 +168,7 @@ parse_record (json_t *data, struct GNUNET_GNSRECORD_Data *rd)
168 if (1 == supplemental) 168 if (1 == supplemental)
169 rd->flags |= GNUNET_GNSRECORD_RF_SUPPLEMENTAL; 169 rd->flags |= GNUNET_GNSRECORD_RF_SUPPLEMENTAL;
170 if (1 == shadow) 170 if (1 == shadow)
171 rd->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 171 rd->flags |= GNUNET_GNSRECORD_RF_SHADOW;
172 return GNUNET_OK; 172 return GNUNET_OK;
173} 173}
174 174
@@ -353,7 +353,7 @@ GNUNET_GNSRECORD_JSON_from_gnsrecord (const char*rname,
353 GNUNET_JSON_GNSRECORD_FLAG_SUPPLEMENTAL, 353 GNUNET_JSON_GNSRECORD_FLAG_SUPPLEMENTAL,
354 rd[i].flags & GNUNET_GNSRECORD_RF_SUPPLEMENTAL, 354 rd[i].flags & GNUNET_GNSRECORD_RF_SUPPLEMENTAL,
355 GNUNET_JSON_GNSRECORD_FLAG_SUPPLEMENTAL, 355 GNUNET_JSON_GNSRECORD_FLAG_SUPPLEMENTAL,
356 rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD); 356 rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW);
357 GNUNET_free (value_str); 357 GNUNET_free (value_str);
358 if (NULL == record) 358 if (NULL == record)
359 { 359 {
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index 85a42d459..0ccf28e7d 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -69,46 +69,9 @@ extern "C" {
69#include "gnu_name_system_record_types.h" 69#include "gnu_name_system_record_types.h"
70 70
71/** 71/**
72 * Flags that can be set for a record. 72 * Include the record flags generated from GANA
73 * MUST fit into 16 bit.
74 */ 73 */
75enum GNUNET_GNSRECORD_Flags 74#include "gnu_name_system_record_flags.h"
76{
77 /**
78 * No special options.
79 */
80 GNUNET_GNSRECORD_RF_NONE = 0,
81
82 /**
83 * This record is critical. If it cannot be processed
84 * (for example because the record type is unknown)
85 * resolution MUST fail
86 */
87 GNUNET_GNSRECORD_RF_CRITICAL = 1,
88
89 /**
90 * This record should not be used unless all (other) records with an absolute
91 * expiration time have expired.
92 */
93 GNUNET_GNSRECORD_RF_SHADOW_RECORD = 2,
94
95 /**
96 * This is a supplemental record.
97 */
98 GNUNET_GNSRECORD_RF_SUPPLEMENTAL = 4,
99
100 /**
101 * This expiration time of the record is a relative
102 * time (not an absolute time).
103 */
104 GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION = 16384, /* 2^14 */
105
106 /**
107 * This is a private record of this peer and it should
108 * thus not be handed out to other peers.
109 */
110 GNUNET_GNSRECORD_RF_PRIVATE = 32768, /* 2^15 */
111
112 75
113/** 76/**
114 * When comparing flags for record equality for removal, 77 * When comparing flags for record equality for removal,
@@ -122,7 +85,6 @@ enum GNUNET_GNSRECORD_Flags
122 * #GNUNET_GNSRECORD_records_cmp. 85 * #GNUNET_GNSRECORD_records_cmp.
123 */ 86 */
124#define GNUNET_GNSRECORD_RF_RCMP_FLAGS (GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION) 87#define GNUNET_GNSRECORD_RF_RCMP_FLAGS (GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)
125};
126 88
127/** 89/**
128 * Filter for GNUNET_GNSRECORD_normalize_record_set(). 90 * Filter for GNUNET_GNSRECORD_normalize_record_set().
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 6444d446d..36a0a9ba3 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -200,7 +200,7 @@ static int del;
200static int is_public; 200static int is_public;
201 201
202/** 202/**
203 * Is record a shadow record (#GNUNET_GNSRECORD_RF_SHADOW_RECORD) 203 * Is record a shadow record (#GNUNET_GNSRECORD_RF_SHADOW)
204 */ 204 */
205static int is_shadow; 205static int is_shadow;
206 206
@@ -688,7 +688,7 @@ display_record (const struct GNUNET_IDENTITY_PrivateKey *zone_key,
688 ets, 688 ets,
689 (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) ? "PRIVATE" 689 (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) ? "PRIVATE"
690 : "PUBLIC", 690 : "PUBLIC",
691 (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ? "SHADOW" 691 (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW)) ? "SHADOW"
692 : ""); 692 : "");
693 GNUNET_free (s); 693 GNUNET_free (s);
694 } 694 }
@@ -917,7 +917,7 @@ get_existing_record (void *cls,
917 rde->data_size = data_size; 917 rde->data_size = data_size;
918 rde->record_type = type; 918 rde->record_type = type;
919 if (1 == is_shadow) 919 if (1 == is_shadow)
920 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 920 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW;
921 if (1 != is_public) 921 if (1 != is_public)
922 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; 922 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
923 rde->expiration_time = etime; 923 rde->expiration_time = etime;
@@ -1531,7 +1531,7 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg)
1531 if (GNUNET_YES == etime_is_rel) 1531 if (GNUNET_YES == etime_is_rel)
1532 rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; 1532 rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
1533 if (1 == is_shadow) 1533 if (1 == is_shadow)
1534 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 1534 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW;
1535 add_qe_uri = GNUNET_NAMESTORE_records_store (ns, 1535 add_qe_uri = GNUNET_NAMESTORE_records_store (ns,
1536 &zone_pkey, 1536 &zone_pkey,
1537 sname, 1537 sname,
@@ -1776,7 +1776,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1776 if (NULL == strchr (tok, (unsigned char) 'p')) /* p = public */ 1776 if (NULL == strchr (tok, (unsigned char) 'p')) /* p = public */
1777 record.flags |= GNUNET_GNSRECORD_RF_PRIVATE; 1777 record.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
1778 if (NULL != strchr (tok, (unsigned char) 's')) 1778 if (NULL != strchr (tok, (unsigned char) 's'))
1779 record.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 1779 record.flags |= GNUNET_GNSRECORD_RF_SHADOW;
1780 /* find beginning of record value */ 1780 /* find beginning of record value */
1781 tok = strchr (&value[tok - cp], (unsigned char) ' '); 1781 tok = strchr (&value[tok - cp], (unsigned char) ' ');
1782 if (NULL == tok) 1782 if (NULL == tok)