aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnsrecord/gnsrecord_misc.c')
-rw-r--r--src/gnsrecord/gnsrecord_misc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 5061f8493..8b590e35f 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -62,14 +62,14 @@ GNUNET_GNSRECORD_string_to_lowercase (const char *src)
62 * @return string form; will be overwritten by next call to #GNUNET_GNSRECORD_z2s 62 * @return string form; will be overwritten by next call to #GNUNET_GNSRECORD_z2s
63 */ 63 */
64const char * 64const char *
65GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z) 65GNUNET_GNSRECORD_z2s (const struct GNUNET_IDENTITY_PublicKey *z)
66{ 66{
67 static char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) * 8]; 67 static char buf[sizeof(struct GNUNET_IDENTITY_PublicKey) * 8];
68 char *end; 68 char *end;
69 69
70 end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z, 70 end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z,
71 sizeof(struct 71 sizeof(struct
72 GNUNET_CRYPTO_EcdsaPublicKey), 72 GNUNET_IDENTITY_PublicKey),
73 buf, sizeof(buf)); 73 buf, sizeof(buf));
74 if (NULL == end) 74 if (NULL == end)
75 { 75 {
@@ -99,7 +99,7 @@ GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
99 if (a->record_type != b->record_type) 99 if (a->record_type != b->record_type)
100 { 100 {
101 LOG (GNUNET_ERROR_TYPE_DEBUG, 101 LOG (GNUNET_ERROR_TYPE_DEBUG,
102 "Record type %lu != %lu\n", a->record_type, b->record_type); 102 "Record type %u != %u\n", a->record_type, b->record_type);
103 return GNUNET_NO; 103 return GNUNET_NO;
104 } 104 }
105 if ((a->expiration_time != b->expiration_time) && 105 if ((a->expiration_time != b->expiration_time) &&
@@ -115,7 +115,7 @@ GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
115 != (b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS)) 115 != (b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS))
116 { 116 {
117 LOG (GNUNET_ERROR_TYPE_DEBUG, 117 LOG (GNUNET_ERROR_TYPE_DEBUG,
118 "Flags %lu (%lu) != %lu (%lu)\n", a->flags, 118 "Flags %u (%u) != %u (%u)\n", a->flags,
119 a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS, b->flags, 119 a->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS, b->flags,
120 b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS); 120 b->flags & GNUNET_GNSRECORD_RF_RCMP_FLAGS);
121 return GNUNET_NO; 121 return GNUNET_NO;
@@ -236,12 +236,12 @@ GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd)
236 * key in an encoding suitable for DNS labels. 236 * key in an encoding suitable for DNS labels.
237 */ 237 */
238const char * 238const char *
239GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 239GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_IDENTITY_PublicKey *pkey)
240{ 240{
241 static char ret[128]; 241 static char ret[128];
242 char *pkeys; 242 char *pkeys;
243 243
244 pkeys = GNUNET_CRYPTO_ecdsa_public_key_to_string (pkey); 244 pkeys = GNUNET_IDENTITY_public_key_to_string (pkey);
245 GNUNET_snprintf (ret, 245 GNUNET_snprintf (ret,
246 sizeof(ret), 246 sizeof(ret),
247 "%s", 247 "%s",
@@ -262,12 +262,11 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
262 */ 262 */
263int 263int
264GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, 264GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
265 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 265 struct GNUNET_IDENTITY_PublicKey *pkey)
266{ 266{
267 if (GNUNET_OK != 267 if (GNUNET_OK !=
268 GNUNET_CRYPTO_ecdsa_public_key_from_string (zkey, 268 GNUNET_IDENTITY_public_key_from_string (zkey,
269 strlen (zkey), 269 pkey))
270 pkey))
271 return GNUNET_SYSERR; 270 return GNUNET_SYSERR;
272 return GNUNET_OK; 271 return GNUNET_OK;
273} 272}