diff options
Diffstat (limited to 'src/gnsrecord/gnsrecord_misc.c')
-rw-r--r-- | src/gnsrecord/gnsrecord_misc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index ba8803850..2e00141a3 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c | |||
@@ -282,9 +282,9 @@ GNUNET_GNSRECORD_identity_from_data (const char *data, | |||
282 | return GNUNET_SYSERR; | 282 | return GNUNET_SYSERR; |
283 | if (data_size > sizeof (struct GNUNET_IDENTITY_PublicKey)) | 283 | if (data_size > sizeof (struct GNUNET_IDENTITY_PublicKey)) |
284 | return GNUNET_SYSERR; | 284 | return GNUNET_SYSERR; |
285 | key->type = type; | 285 | return (GNUNET_IDENTITY_read_key_from_buffer(key, data, data_size) == data_size? |
286 | memcpy (key, data, data_size); | 286 | GNUNET_OK : |
287 | return GNUNET_OK; | 287 | GNUNET_SYSERR); |
288 | } | 288 | } |
289 | 289 | ||
290 | enum GNUNET_GenericReturnValue | 290 | enum GNUNET_GenericReturnValue |
@@ -299,8 +299,9 @@ GNUNET_GNSRECORD_data_from_identity (const struct | |||
299 | if (0 == *data_size) | 299 | if (0 == *data_size) |
300 | return GNUNET_SYSERR; | 300 | return GNUNET_SYSERR; |
301 | *data = GNUNET_malloc (*data_size); | 301 | *data = GNUNET_malloc (*data_size); |
302 | memcpy (*data, key, *data_size); | 302 | return (GNUNET_IDENTITY_write_key_to_buffer(key, data, *data_size) == *data_size? |
303 | return GNUNET_OK; | 303 | GNUNET_OK : |
304 | GNUNET_SYSERR); | ||
304 | } | 305 | } |
305 | 306 | ||
306 | 307 | ||