Skip to content

Commit

Permalink
molch_import: initialize libsodium
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Dec 16, 2016
1 parent 4fc876f commit 7e2b47d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/molch.c
Expand Up @@ -1459,6 +1459,12 @@ return_status molch_import(
throw(INCORRECT_BUFFER_SIZE, "New backup key has an incorrect length.");
}

if (users == NULL) {
if (sodium_init() == -1) {
throw(INIT_ERROR, "Failed to init libsodium.");
}
}

//unpack the encrypted backup
encrypted_backup_struct = encrypted_backup__unpack(&protobuf_c_allocators, backup_length, backup);
if (encrypted_backup_struct == NULL) {
Expand Down

0 comments on commit 7e2b47d

Please sign in to comment.