aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-23 18:15:43 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-23 18:15:43 +0000
commit2f152dc3bd8c71adbc74e26e762c89345c8eb3db (patch)
treeadad634555c65bd5b25d70e4391d64cb676d8430 /src
parent5c8de456e32609d834e8ceba0bd55f0eb602ead2 (diff)
downloadgnunet-2f152dc3bd8c71adbc74e26e762c89345c8eb3db.tar.gz
gnunet-2f152dc3bd8c71adbc74e26e762c89345c8eb3db.zip
-fix, will failon werrorr
Diffstat (limited to 'src')
-rw-r--r--src/gns/Makefile.am1
-rw-r--r--src/gns/gnunet-service-gns_resolver.c27
-rw-r--r--src/gns/proxy/proxy.py2
3 files changed, 26 insertions, 4 deletions
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am
index 2b62cec53..2d47353ba 100644
--- a/src/gns/Makefile.am
+++ b/src/gns/Makefile.am
@@ -207,6 +207,7 @@ gnunet_service_gns_LDADD = \
207 $(top_builddir)/src/dns/libgnunetdnsparser.la \ 207 $(top_builddir)/src/dns/libgnunetdnsparser.la \
208 $(top_builddir)/src/dht/libgnunetdht.la \ 208 $(top_builddir)/src/dht/libgnunetdht.la \
209 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 209 $(top_builddir)/src/namestore/libgnunetnamestore.la \
210 -lunistring \
210 $(GN_LIBINTL) 211 $(GN_LIBINTL)
211gnunet_service_gns_DEPENDENCIES = \ 212gnunet_service_gns_DEPENDENCIES = \
212 $(top_builddir)/src/tun/libgnunettun.la \ 213 $(top_builddir)/src/tun/libgnunettun.la \
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 407dc54df..acf876993 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -26,6 +26,7 @@
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include <unicase.h>
29#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
30#include "gnunet_transport_service.h" 31#include "gnunet_transport_service.h"
31#include "gnunet_dns_service.h" 32#include "gnunet_dns_service.h"
@@ -1910,6 +1911,9 @@ gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
1910 struct ResolverHandle *rh; 1911 struct ResolverHandle *rh;
1911 struct RecordLookupHandle* rlh; 1912 struct RecordLookupHandle* rlh;
1912 char string_hash[MAX_DNS_LABEL_LENGTH]; 1913 char string_hash[MAX_DNS_LABEL_LENGTH];
1914 char* normalized_zkey;
1915 char nzkey[MAX_DNS_LABEL_LENGTH];
1916 size_t normal_len;
1913 1917
1914 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1915 "Starting resolution for %s (type=%d)!\n", 1919 "Starting resolution for %s (type=%d)!\n",
@@ -1977,8 +1981,15 @@ gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
1977 1981
1978 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1982 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1979 "ZKEY is %s!\n", string_hash); 1983 "ZKEY is %s!\n", string_hash);
1984
1985 normalized_zkey = u8_toupper ((uint8_t*)string_hash, strlen ((char *) string_hash),
1986 NULL, UNINORM_NFD, NULL, &normal_len);
1980 1987
1981 if (GNUNET_OK != GNUNET_CRYPTO_short_hash_from_string(string_hash, 1988 memcpy(nzkey, normalized_zkey, normal_len);
1989 nzkey[normal_len] = '\0';
1990 free(normalized_zkey);
1991
1992 if (GNUNET_OK != GNUNET_CRYPTO_short_hash_from_string(nzkey,
1982 &rh->authority)) 1993 &rh->authority))
1983 { 1994 {
1984 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1995 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -2275,6 +2286,9 @@ gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
2275 struct NameShortenHandle *nsh; 2286 struct NameShortenHandle *nsh;
2276 char string_hash[MAX_DNS_LABEL_LENGTH]; 2287 char string_hash[MAX_DNS_LABEL_LENGTH];
2277 struct GNUNET_CRYPTO_ShortHashCode zkey; 2288 struct GNUNET_CRYPTO_ShortHashCode zkey;
2289 char* normalized_zkey;
2290 size_t normal_len;
2291 char nzkey[MAX_DNS_LABEL_LENGTH];
2278 2292
2279 2293
2280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2318,11 +2332,18 @@ gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
2318 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2332 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2319 "ZKEY is %s!\n", string_hash); 2333 "ZKEY is %s!\n", string_hash);
2320 2334
2321 if (GNUNET_OK != GNUNET_CRYPTO_short_hash_from_string(string_hash, 2335 normalized_zkey = u8_toupper ((uint8_t*)string_hash, strlen ((char *) string_hash),
2336 NULL, UNINORM_NFD, NULL, &normal_len);
2337
2338 memcpy(nzkey, normalized_zkey, normal_len);
2339 nzkey[normal_len] = '\0';
2340 free(normalized_zkey);
2341
2342 if (GNUNET_OK != GNUNET_CRYPTO_short_hash_from_string(nzkey,
2322 &zkey)) 2343 &zkey))
2323 { 2344 {
2324 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2345 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2325 "Cannot convert ZKEY %s to hash!\n", string_hash); 2346 "Cannot convert ZKEY %s to hash!\n", nzkey);
2326 GNUNET_free(rh); 2347 GNUNET_free(rh);
2327 GNUNET_free(nsh); 2348 GNUNET_free(nsh);
2328 proc(proc_cls, name); 2349 proc(proc_cls, name);
diff --git a/src/gns/proxy/proxy.py b/src/gns/proxy/proxy.py
index 9191c1b4e..e2c0a5baf 100644
--- a/src/gns/proxy/proxy.py
+++ b/src/gns/proxy/proxy.py
@@ -135,7 +135,7 @@ class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
135 out = soc 135 out = soc
136 data = i.recv(8192) 136 data = i.recv(8192)
137 if data: 137 if data:
138 if (re.match("(\w+\.)*gnunet", self.host_port[0])): 138 if (re.match("(\w+\.)*gnunet", self.host_port[0]) or 1):
139 arr = self.host_port[0].split('.') 139 arr = self.host_port[0].split('.')
140 arr.pop(0) 140 arr.pop(0)
141 data = re.sub('(a href="http://(\w+\.)*)(\+)', 141 data = re.sub('(a href="http://(\w+\.)*)(\+)',