From 08dcc014a522c3c95eb3bf878d466c4b5ad35d5f Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 9 Jan 2014 08:28:02 +0100 Subject: [PATCH] add YKP_ENORANDOM for when there's no random available --- ykpers.c | 3 ++- ykpers.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ykpers.c b/ykpers.c index e860419..57d5bf5 100644 --- a/ykpers.c +++ b/ykpers.c @@ -355,7 +355,7 @@ int ykp_AES_key_from_passphrase(YKP_CONFIG *cfg, const char *passphrase, if (_salt_len == 0) { /* There was no randomness files, so don't do * anything */ - ykp_errno = YKP_EINVAL; + ykp_errno = YKP_ENORANDOM; return 0; } @@ -1154,6 +1154,7 @@ static const char *errtext[] = { "too old yubikey for this operation", "invalid configuration number (this is a programming error)", "invalid option/argument value", + "no randomness source available", }; const char *ykp_strerror(int errnum) { diff --git a/ykpers.h b/ykpers.h index 8b96d6c..94fdf7d 100644 --- a/ykpers.h +++ b/ykpers.h @@ -200,6 +200,7 @@ const char *ykp_strerror(int errnum); #define YKP_EOLDYUBIKEY 0x04 #define YKP_EINVCONFNUM 0x05 #define YKP_EINVAL 0x06 +#define YKP_ENORANDOM 0x07 # ifdef __cplusplus } -- 2.39.5