aboutsummaryrefslogtreecommitdiff
path: root/src/hello
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-13 20:26:33 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-19 12:39:55 +0100
commit3a71153405e8fc26712807b4bdb5987fb3bf2b9e (patch)
treef8c219400453f72fd73bebcdb1dd01f349f0a12a /src/hello
parentac77d5f4341e25eda4f12ef050a97c7794e034ca (diff)
downloadgnunet-3a71153405e8fc26712807b4bdb5987fb3bf2b9e.tar.gz
gnunet-3a71153405e8fc26712807b4bdb5987fb3bf2b9e.zip
-implement TVG
Diffstat (limited to 'src/hello')
-rw-r--r--src/hello/Makefile.am3
-rw-r--r--src/hello/test_hello-uri.c40
2 files changed, 40 insertions, 3 deletions
diff --git a/src/hello/Makefile.am b/src/hello/Makefile.am
index 08d976260..c04b85106 100644
--- a/src/hello/Makefile.am
+++ b/src/hello/Makefile.am
@@ -50,7 +50,8 @@ test_hello_uri_SOURCES = \
50 test_hello-uri.c 50 test_hello-uri.c
51test_hello_uri_LDADD = \ 51test_hello_uri_LDADD = \
52 libgnunethello.la \ 52 libgnunethello.la \
53 $(top_builddir)/src/util/libgnunetutil.la 53 $(top_builddir)/src/util/libgnunetutil.la \
54 -lgcrypt
54 55
55 56
56test_friend_hello_SOURCES = \ 57test_friend_hello_SOURCES = \
diff --git a/src/hello/test_hello-uri.c b/src/hello/test_hello-uri.c
index 295c08ea3..7e70d6763 100644
--- a/src/hello/test_hello-uri.c
+++ b/src/hello/test_hello-uri.c
@@ -44,7 +44,7 @@ check_uris (void *cls,
44 "test://address")) 44 "test://address"))
45 *found |= 1; 45 *found |= 1;
46 else if (0 == strcmp (uri, 46 else if (0 == strcmp (uri,
47 "test://more")) 47 "test://more"))
48 *found |= 2; 48 *found |= 2;
49 else 49 else
50 *found = (unsigned int) -1; 50 *found = (unsigned int) -1;
@@ -170,7 +170,43 @@ main (int argc,
170 GNUNET_HELLO_builder_free (b2); 170 GNUNET_HELLO_builder_free (b2);
171 } 171 }
172 172
173
174 GNUNET_HELLO_builder_free (b); 173 GNUNET_HELLO_builder_free (b);
174
175 GNUNET_CRYPTO_mpi_print_unsigned (priv.d,
176 sizeof (priv.d),
177 GCRYMPI_CONST_ONE);
178 priv.d[0] &= 248;
179 priv.d[31] &= 127;
180 priv.d[31] |= 64;
181 {
182 char *buf;
183
184 buf = GNUNET_STRINGS_data_to_string_alloc (&priv,
185 sizeof (priv));
186 fprintf (stderr,
187 "PK: %s\n",
188 buf);
189 GNUNET_free (buf);
190 }
191 GNUNET_CRYPTO_eddsa_key_get_public (&priv,
192 &pid.public_key);
193 b = GNUNET_HELLO_builder_new (&pid);
194 GNUNET_assert (GNUNET_OK ==
195 GNUNET_HELLO_builder_add_address (b,
196 "a://first"));
197 GNUNET_assert (GNUNET_OK ==
198 GNUNET_HELLO_builder_add_address (b,
199 "b://second"));
200 {
201 char *url;
202
203 url = GNUNET_HELLO_builder_to_url (b,
204 &priv);
205 fprintf (stderr,
206 "TV: %s\n",
207 url);
208 GNUNET_free (url);
209 }
210
175 return 0; 211 return 0;
176} 212}