From bd74a5b762d1e0e596a31cfc4c2bc9c8391d3b7f Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 2 Oct 2016 11:01:14 +0200 Subject: [PATCH] More detailed error reporting if key derivation fails --- ChangeLog.txt | 1 + src/cpp-utils/crypto/kdf/Scrypt.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 52be9a69..e3304ad9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,7 @@ Fixed bugs: Improvements: * Allow building with -DCRYFS_UPDATE_CHECKS=off, which will create an executable with disabled update checks (the alternative to disable them in the environment also still works). * Automatically disable update checks when running in noninteractive mode. +* More detailed error reporting if key derivation fails Compatibility: * Compatible with libcurl version >= 7.50.0, and <= 7.21.6 (tested down to 7.19.0) diff --git a/src/cpp-utils/crypto/kdf/Scrypt.cpp b/src/cpp-utils/crypto/kdf/Scrypt.cpp index 5a48ca6a..5d805578 100644 --- a/src/cpp-utils/crypto/kdf/Scrypt.cpp +++ b/src/cpp-utils/crypto/kdf/Scrypt.cpp @@ -28,7 +28,7 @@ namespace cpputils { _config.N(), _config.r(), _config.p(), static_cast(destination), size); if (errorcode != 0) { - throw std::runtime_error("Error running scrypt key derivation."); + throw std::runtime_error("Error running scrypt key derivation. Error code: "+std::to_string(errorcode)); } }