aboutsummaryrefslogtreecommitdiff
path: root/src/identity/test_identity.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/identity/test_identity.c')
-rw-r--r--src/identity/test_identity.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/identity/test_identity.c b/src/identity/test_identity.c
index 2c44f73ba..af17b5bcc 100644
--- a/src/identity/test_identity.c
+++ b/src/identity/test_identity.c
@@ -53,15 +53,15 @@ static struct GNUNET_IDENTITY_Operation *op;
53static struct GNUNET_SCHEDULER_Task *endbadly_task; 53static struct GNUNET_SCHEDULER_Task *endbadly_task;
54 54
55#define CHECK(cond) \ 55#define CHECK(cond) \
56 do \ 56 do \
57 { \ 57 { \
58 if (! (cond)) \ 58 if (! (cond)) \
59 { \ 59 { \
60 GNUNET_break (0); \ 60 GNUNET_break (0); \
61 end (); \ 61 end (); \
62 return; \ 62 return; \
63 } \ 63 } \
64 } while (0) 64 } while (0)
65 65
66 66
67/** 67/**
@@ -258,6 +258,18 @@ create_cb (void *cls,
258{ 258{
259 CHECK (NULL != pk); 259 CHECK (NULL != pk);
260 CHECK (GNUNET_EC_NONE == ec); 260 CHECK (GNUNET_EC_NONE == ec);
261 struct GNUNET_IDENTITY_PublicKey pub;
262 unsigned char ct[1024];
263 char pt[strlen ("test") + 1];
264 ssize_t len;
265
266 GNUNET_IDENTITY_key_get_public (pk, &pub);
267 len = GNUNET_IDENTITY_encrypt2 ("test", strlen ("test") + 1, &pub, ct,
268 sizeof(ct));
269 CHECK (-1 != len);
270 GNUNET_IDENTITY_decrypt2 (ct, len, pk, pt, sizeof (pt));
271 CHECK (-1 != len);
272 CHECK (0 == strcmp (pt, "test"));
261 op = 273 op =
262 GNUNET_IDENTITY_rename (h, "test-id", "test", &success_rename_cont, NULL); 274 GNUNET_IDENTITY_rename (h, "test-id", "test", &success_rename_cont, NULL);
263} 275}