diff options
Diffstat (limited to 'src/lib/hello/test_hello-ng.c')
-rw-r--r-- | src/lib/hello/test_hello-ng.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/lib/hello/test_hello-ng.c b/src/lib/hello/test_hello-ng.c deleted file mode 100644 index ef84e2425..000000000 --- a/src/lib/hello/test_hello-ng.c +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2022 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | #include "platform.h" | ||
21 | #include "gnunet_util_lib.h" | ||
22 | #include "gnunet_nt_lib.h" | ||
23 | #include "gnunet_hello_lib.h" | ||
24 | |||
25 | int | ||
26 | main (int argc, | ||
27 | char *argv[]) | ||
28 | { | ||
29 | struct GNUNET_CRYPTO_EddsaPublicKey pubKey; | ||
30 | struct GNUNET_CRYPTO_EddsaPrivateKey privKey; | ||
31 | struct GNUNET_PeerIdentity pid; | ||
32 | struct GNUNET_TIME_Absolute t = GNUNET_TIME_absolute_get (); | ||
33 | char *res; | ||
34 | char *address; | ||
35 | size_t res_len; | ||
36 | enum GNUNET_NetworkType nt; | ||
37 | |||
38 | GNUNET_CRYPTO_eddsa_key_create (&privKey); | ||
39 | GNUNET_CRYPTO_eddsa_key_get_public (&privKey, | ||
40 | &pubKey); | ||
41 | pid.public_key = pubKey; | ||
42 | GNUNET_HELLO_sign_address ("127.0.0.1:8080", | ||
43 | GNUNET_NT_LAN, | ||
44 | t, | ||
45 | &privKey, | ||
46 | (void**) &res, | ||
47 | &res_len); | ||
48 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | ||
49 | "%s\n", res); | ||
50 | GNUNET_assert (NULL != | ||
51 | (address = | ||
52 | GNUNET_HELLO_extract_address ((void**) res, | ||
53 | res_len, | ||
54 | &pid, | ||
55 | &nt, | ||
56 | &t))); | ||
57 | GNUNET_free (address); | ||
58 | GNUNET_free (res); | ||
59 | return 0; | ||
60 | } | ||