binman: Correct the error message for a bad hash algorithm
This shows an internal type at present, rather than the algorithm name.
Fix it and update the test to catch this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
diff --git a/tools/binman/state.py b/tools/binman/state.py
index 8cd8a48..a302e1f 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -397,7 +397,7 @@
if algo.value == 'sha256':
size = 32
else:
- return "Unknown hash algorithm '%s'" % algo
+ return "Unknown hash algorithm '%s'" % algo.value
for n in GetUpdateNodes(hash_node):
n.AddEmptyProp('value', size)