]> err.no Git - yubikey-personalization/commitdiff
add YKP_ENORANDOM for when there's no random available
authorKlas Lindfors <klas@yubico.com>
Thu, 9 Jan 2014 07:28:02 +0000 (08:28 +0100)
committerKlas Lindfors <klas@yubico.com>
Thu, 9 Jan 2014 08:48:38 +0000 (09:48 +0100)
ykpers.c
ykpers.h

index e860419905e6165bf1978e215e89427c9dca62ed..57d5bf54bf614f86193234d241dec2cf755b2dec 100644 (file)
--- 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)
 {
index 8b96d6cfc4561a75282e1c0ae5a45baa1ba87abb..94fdf7d06f3445d2829865e26624cb586e4923c7 100644 (file)
--- 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
 }