diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-11-18 23:39:53 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-11-18 23:39:53 +0100 |
commit | fab0c5c8e3ed517a29e8f9dbf2afb89690ed75c6 (patch) | |
tree | be6b945d78a128e30c202750ae811ead6e97d903 | |
parent | c5a7ce5d22f57e3a248ae3e9bc4541a35495b8a1 (diff) | |
download | gnunet-fab0c5c8e3ed517a29e8f9dbf2afb89690ed75c6.tar.gz gnunet-fab0c5c8e3ed517a29e8f9dbf2afb89690ed75c6.zip |
-writing identity keys to buffer consistently
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/identity/identity_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 22371f91a..08a975e65 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013, 2016 GNUnet e.V. | 3 | Copyright (C) 2013, 2016, 2021 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 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 | 6 | under the terms of the GNU Affero General Public License as published |
@@ -1020,7 +1020,9 @@ GNUNET_IDENTITY_write_key_to_buffer (const struct | |||
1020 | return -1; | 1020 | return -1; |
1021 | if (length < 0) | 1021 | if (length < 0) |
1022 | return -2; | 1022 | return -2; |
1023 | GNUNET_memcpy (buffer, key, length); | 1023 | GNUNET_memcpy (buffer, &(key->type), sizeof (key->type)); |
1024 | GNUNET_memcpy (buffer + sizeof (key->type), &(key->ecdsa_key), length | ||
1025 | - sizeof (key->type)); | ||
1024 | return length; | 1026 | return length; |
1025 | } | 1027 | } |
1026 | 1028 | ||