From: Klas Lindfors Date: Thu, 9 Jan 2014 07:28:02 +0000 (+0100) Subject: add YKP_ENORANDOM for when there's no random available X-Git-Tag: v1.15.0~15 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08dcc014a522c3c95eb3bf878d466c4b5ad35d5f;p=yubikey-personalization add YKP_ENORANDOM for when there's no random available --- 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 }