From 68fd01f42ad8d56c491c755db914cb8894965e9a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 22 Dec 2015 17:14:04 +0100 Subject: [PATCH] Don't ignore sodium_init() return value --- src/nix-store/nix-store.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 14354f86e..b49ebd094 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -1013,7 +1013,8 @@ static void opGenerateBinaryCacheKey(Strings opFlags, Strings opArgs) string publicKeyFile = *i++; #if HAVE_SODIUM - sodium_init(); + if (sodium_init() == -1) + throw Error("could not initialise libsodium"); unsigned char pk[crypto_sign_PUBLICKEYBYTES]; unsigned char sk[crypto_sign_SECRETKEYBYTES];