Skip to content

Commit

Permalink
[#163] - The shared prekey pair is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
olabini committed Oct 4, 2018
1 parent fed5ec7 commit 7e439d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/prekey_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ INTERNAL void otrng_prekey_profile_copy(otrng_prekey_profile_s *destination,
otrng_ec_point_copy(destination->shared_prekey, source->shared_prekey);
if (destination->keys != NULL) {
otrng_shared_prekey_pair_free(destination->keys);
destination->keys = NULL;
}
destination->keys = otrng_secure_alloc(sizeof(otrng_shared_prekey_pair_s));
memcpy(destination->keys, source->keys, sizeof(otrng_shared_prekey_pair_s));

if (source->keys != NULL) {
destination->keys = otrng_secure_alloc(sizeof(otrng_shared_prekey_pair_s));
memcpy(destination->keys, source->keys, sizeof(otrng_shared_prekey_pair_s));
}

memcpy(destination->signature, source->signature, ED448_SIGNATURE_BYTES);

destination->should_publish = source->should_publish;
Expand Down

0 comments on commit 7e439d0

Please sign in to comment.