I believe that "Required key not available" refers to a cryptographic
key which makes no sense here.
hivex_root() checks if the root offset field points to an invalid
position in the hive file and fails if this is not the case. I think
"Bad address" is a good match.
---
lib/hivex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c
index 7715520..e730547 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -559,7 +559,7 @@ hivex_root (hive_h *h)
{
hive_node_h ret = h->rootoffs;
if (!IS_VALID_BLOCK (h, ret)) {
- errno = ENOKEY;
+ errno = EFAULT;
return 0;
}
return ret;
--
1.7.5.1