commit 8d8e46d04de08c33b0c625eaef022b0020fce314
parent fab645cae7030595ef26a8bbb213d58ce8fc7cf7
Author: Tristan Schwieren <tristan.schwieren@tum.de>
Date: Fri, 27 May 2022 14:58:30 +0200
- working did lib and 1. test for did helper
Diffstat:
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
@@ -6,8 +6,7 @@ TESTBED = testbed-logger testbed
if HAVE_EXPERIMENTAL
EXP_DIR = \
rps \
- abd \
- did
+ abd
if HAVE_ABE
EXP_DIR += \
abe
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am
@@ -203,7 +203,7 @@ test_reclaim_attribute_LDADD = \
$(GN_LIBINTL)
gnunet_did_SOURCES = \
- gnunet-did.c \
+ gnunet-did.c
gnunet_did_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/gns/libgnunetgns.la \
diff --git a/src/reclaim/test_did_helper.c b/src/reclaim/test_did_helper.c
@@ -31,25 +31,25 @@
#include "gnunet_gnsrecord_lib.h"
#include "did_helper.h"
-static char test_privkey[32] = {
+static const char test_privkey[32] = {
0x9b, 0x93, 0x7b, 0x81, 0x32, 0x2d, 0x81, 0x6c,
0xfa, 0xb9, 0xd5, 0xa3, 0xba, 0xac, 0xc9, 0xb2,
0xa5, 0xfe, 0xbe, 0x4b, 0x14, 0x9f, 0x12, 0x6b,
0x36, 0x30, 0xf9, 0x3a, 0x29, 0x52, 0x70, 0x17
};
+static const char *test_did = "did:reclaim:000G0509BYD1MPAXVSTNV0KRD1JAT0YZMPJFQNM869B66S72PSF17K4Y8G";
+
static struct GNUNET_IDENTITY_PrivateKey skey;
static struct GNUNET_IDENTITY_PublicKey pkey;
-int
+// TODO: Create a did manual from private key / independet of implementation
+void
test_GNUNET_DID_pkey_to_did ()
{
char *str_did;
str_did = GNUNET_DID_pkey_to_did(&pkey);
- printf("%s\n", str_did);
-
- // TODO: Give to function, compare to real DID
- return 0;
+ GNUNET_assert(strcmp(test_did, str_did) == 0);
}
int
@@ -69,7 +69,5 @@ main ()
GNUNET_IDENTITY_key_get_public (&skey, &pkey);
test_GNUNET_DID_pkey_to_did();
-
- GNUNET_assert (0 == 0);
return 0;
}
\ No newline at end of file