From 3c8092cd937d6f449b1959eab9e7e15549970d85 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 16 Jan 2019 02:52:58 +0000 Subject: Fix result_from_string for empty return values An empty string returned from a libnitrokey function can either indicate an error or be a valid return value. Previously, we assumed that it indicates an error. But instead, we should check the last command status and use it to decide whether to return the empty string or an error code. This breaks the unit tests that assume that empty strings cause errors. These will be fixed in the next patches. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 51d2b1e..bae77e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ `Storage` struct. - Use `rand_os` instead of `rand` for random data creation. - (Re-)add `CommandError::RngError` variant. +- Account for the possibility that an empty string returned by libnitrokey can + not only indicate an error but also be a valid return value. # v0.3.2 (2019-01-12) - Make three additional error codes known: `CommandError::StringTooLong`, -- cgit v1.2.1