[libfko] per-SPA message type field count validation
authorMichael Rash <mbr@cipherdyne.org>
Mon, 17 Mar 2014 01:47:19 +0000 (21:47 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Mon, 17 Mar 2014 01:47:19 +0000 (21:47 -0400)
This commit implements more rigorous SPA packet field count validation
that takes into account expected field counts for each SPA message type.
Two new libfko error codes have been added in support of this, and the
corresponding changes made in the perl and python modules.

lib/fko.h
lib/fko_decode.c
lib/fko_error.c
lib/fko_limits.h
perl/FKO/lib/FKO_Constants.pl
python/fko.py
test/test-fwknop.pl

index 438610a..4c301b0 100644 (file)
--- a/lib/fko.h
+++ b/lib/fko.h
@@ -137,6 +137,8 @@ typedef enum {
     FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL,
     FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII,
     FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS,
+    FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS,
+    FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS,
     FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE,
     FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING,
     FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING,
index 788d36d..03d8596 100644 (file)
 #define FIELD_PARSERS 9
 
 static int
+num_fields(char *str)
+{
+    int    i=0;
+    char   *tmp = NULL;
+
+    /* Count the number of remaining SPA packet fields
+    */
+    for (i=0; i <= MAX_SPA_FIELDS+1; i++)
+    {
+        if ((tmp = strchr(str, ':')) == NULL)
+            break;
+        str = tmp + 1;
+    }
+    return i;
+}
+
+static int
+last_field(char *str)
+{
+    int    i=0, pos_last=0;
+    char   *tmp = NULL;
+
+    /* Count the number of bytes to the last ':' char
+    */
+    for (i=0; i <= MAX_SPA_FIELDS+1; i++)
+    {
+        if ((tmp = strchr(str, ':')) == NULL)
+            break;
+
+        pos_last += (tmp - str) + 1;
+        str = tmp + 1;
+    }
+    return pos_last;
+}
+
+static int
 verify_digest(char *tbuf, int t_size, fko_ctx_t ctx)
 {
     switch(ctx->digest_type)
@@ -60,6 +96,9 @@ verify_digest(char *tbuf, int t_size, fko_ctx_t ctx)
         case FKO_DIGEST_SHA512:
             sha512_base64(tbuf, (unsigned char*)ctx->encoded_msg, ctx->encoded_msg_len);
             break;
+
+        default: /* Invalid or unsupported digest */
+            return(FKO_ERROR_INVALID_DIGEST_TYPE);
     }
 
     /* We give up here if the computed digest does not match the
@@ -285,7 +324,7 @@ parse_client_timeout(char *tbuf, char **ndx, int *t_size, fko_ctx_t ctx)
 static int
 parse_msg_type(char *tbuf, char **ndx, int *t_size, fko_ctx_t ctx)
 {
-    int         is_err;
+    int    is_err, remaining_fields;
 
     if((*t_size = strcspn(*ndx, ":")) < 1)
         return(FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING);
@@ -296,11 +335,44 @@ parse_msg_type(char *tbuf, char **ndx, int *t_size, fko_ctx_t ctx)
     strlcpy(tbuf, *ndx, *t_size+1);
 
     ctx->message_type = strtol_wrapper(tbuf, 0,
-            FKO_LAST_MSG_TYPE, NO_EXIT_UPON_ERR, &is_err);
+            FKO_LAST_MSG_TYPE-1, NO_EXIT_UPON_ERR, &is_err);
 
     if(is_err != FKO_SUCCESS)
         return(FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL);
 
+    /* Now that we have a valid type, ensure that the total
+     * number of SPA fields is also valid for the type
+    */
+    remaining_fields = num_fields(*ndx);
+
+    switch(ctx->message_type)
+    {
+        /* optional server_auth + digest */
+        case FKO_COMMAND_MSG:
+        case FKO_ACCESS_MSG:
+            if(remaining_fields > 2)
+                return FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS;
+            break;
+
+        /* nat or client timeout + optional server_auth + digest */
+        case FKO_NAT_ACCESS_MSG:
+        case FKO_LOCAL_NAT_ACCESS_MSG:
+        case FKO_CLIENT_TIMEOUT_ACCESS_MSG:
+            if(remaining_fields > 3)
+                return FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS;
+            break;
+
+        /* client timeout + nat + optional server_auth + digest */
+        case FKO_CLIENT_TIMEOUT_NAT_ACCESS_MSG:
+        case FKO_CLIENT_TIMEOUT_LOCAL_NAT_ACCESS_MSG:
+            if(remaining_fields > 4)
+                return FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS;
+            break;
+
+        default: /* Should not reach here */
+            return(FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL);
+    }
+
     *ndx += *t_size + 1;
     return FKO_SUCCESS;
 }
@@ -409,7 +481,7 @@ parse_rand_val(char *tbuf, char **ndx, int *t_size, fko_ctx_t ctx)
 int
 fko_decode_spa_data(fko_ctx_t ctx)
 {
-    char       *tbuf, *ndx, *tmp;
+    char       *tbuf, *ndx;
     int         t_size, i, res;
 
     /* Array of function pointers to SPA field parsing functions
@@ -439,18 +511,12 @@ fko_decode_spa_data(fko_ctx_t ctx)
      * delimited with ':' chars
     */
     ndx = ctx->encoded_msg;
-    for (i=0; i < MAX_SPA_FIELDS; i++)
-    {
-        if ((tmp = strchr(ndx, ':')) == NULL)
-            break;
-
-        ndx = tmp;
-        ndx++;
-    }
 
-    if (i < MIN_SPA_FIELDS)
+    if (num_fields(ndx) < MIN_SPA_FIELDS)
         return(FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS);
 
+    ndx += last_field(ndx);
+
     t_size = strnlen(ndx, SHA512_B64_LEN+1);
 
     /* Validate digest length
@@ -470,7 +536,7 @@ fko_decode_spa_data(fko_ctx_t ctx)
     if(ctx->digest == NULL)
         return(FKO_ERROR_MEMORY_ALLOCATION);
 
-    /* Zero out the rest of the encoded_msg bucket...
+    /* Chop the digest off of the encoded_msg bucket...
     */
     bzero((ndx-1), t_size);
 
index a819515..0032960 100644 (file)
@@ -69,6 +69,12 @@ fko_errstr(const int err_code)
         case FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS:
             return("Args contain invalid data: FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS");
 
+        case FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS:
+            return("Args contain invalid data: FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS");
+
+        case FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS:
+            return("Args contain invalid data: FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS");
+
         case FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE:
             return("Args contain invalid data: FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE");
 
index 04584f3..040c71d 100644 (file)
@@ -53,7 +53,7 @@
 
 #define MIN_GNUPG_MSG_SIZE          400
 #define MIN_SPA_FIELDS                6
-#define MAX_SPA_FIELDS               10
+#define MAX_SPA_FIELDS                9
 
 #define MAX_IPV4_STR_LEN             16
 #define MIN_IPV4_STR_LEN              7
index 0530c3e..00914d9 100644 (file)
@@ -80,6 +80,8 @@ our @ERROR_CODES = qw(
     FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL
     FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII
     FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS
+    FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS
+    FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS
     FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE
     FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING
     FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING
@@ -268,136 +270,138 @@ use constant {
     FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL              => 6,
     FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII                     => 7,
     FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS                 => 8,
-    FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE         => 9,
-    FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING                  => 10,
-    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING              => 11,
-    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_TOOBIG               => 12,
-    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_DECODEFAIL           => 13,
-    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_VALIDFAIL            => 14,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_MISSING             => 15,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_TOOBIG              => 16,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_DECODEFAIL          => 17,
-    FKO_ERROR_INVALID_DATA_DECODE_VERSION_MISSING               => 18,
-    FKO_ERROR_INVALID_DATA_DECODE_VERSION_TOOBIG                => 19,
-    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING               => 20,
-    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_TOOBIG                => 21,
-    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL            => 22,
-    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_MISSING               => 23,
-    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_TOOBIG                => 24,
-    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_DECODEFAIL            => 25,
-    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_VALIDFAIL             => 26,
-    FKO_ERROR_INVALID_DATA_DECODE_ACCESS_VALIDFAIL              => 27,
-    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_MISSING             => 28,
-    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_TOOBIG              => 29,
-    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_DECODEFAIL          => 30,
-    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_VALIDFAIL           => 31,
-    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_MISSING               => 32,
-    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_DECODEFAIL            => 33,
-    FKO_ERROR_INVALID_DATA_DECODE_SPA_EXTRA_TOOBIG              => 34,
-    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG                  => 35,
-    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_DECODEFAIL              => 36,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_MISSING               => 37,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_TOOBIG                => 38,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_VALIDFAIL             => 39,
-    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_DECODEFAIL            => 40,
-    FKO_ERROR_INVALID_DATA_ENCODE_MESSAGE_TOOBIG                => 41,
-    FKO_ERROR_INVALID_DATA_ENCODE_MSGLEN_VALIDFAIL              => 42,
-    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_VALIDFAIL              => 43,
-    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_TOOBIG                 => 44,
-    FKO_ERROR_INVALID_DATA_ENCODE_NOTBASE64                     => 45,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_MSGLEN_VALIDFAIL             => 46,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_DIGESTLEN_VALIDFAIL          => 47,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_PTLEN_VALIDFAIL              => 48,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_RESULT_MSGLEN_VALIDFAIL      => 49,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_DECODEFAIL         => 50,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_VALIDFAIL          => 51,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MESSAGE_MISSING    => 52,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MSGLEN_VALIDFAIL   => 53,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MESSAGE_VALIDFAIL        => 54,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_DIGEST_VALIDFAIL         => 55,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MSGLEN_VALIDFAIL         => 56,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_RESULT_MSGLEN_VALIDFAIL  => 57,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_CIPHER_DECODEFAIL        => 58,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSG_NULL          => 59,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSGLEN_VALIDFAIL  => 60,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_VALIDFAIL               => 61,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_MODE_VALIDFAIL               => 62,
-    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_UNKNOWN                 => 63,
-    FKO_ERROR_INVALID_DATA_FUNCS_NEW_ENCMSG_MISSING             => 64,
-    FKO_ERROR_INVALID_DATA_FUNCS_NEW_MSGLEN_VALIDFAIL           => 65,
-    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEYLEN_VALIDFAIL           => 66,
-    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMACLEN_VALIDFAIL          => 67,
-    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEY_ENCODEFAIL             => 68,
-    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMAC_ENCODEFAIL            => 69,
-    FKO_ERROR_INVALID_DATA_FUNCS_SET_MSGLEN_VALIDFAIL           => 70,
-    FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL                => 71,
-    FKO_ERROR_INVALID_DATA_HMAC_ENCMSGLEN_VALIDFAIL             => 72,
-    FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL                     => 73,
-    FKO_ERROR_INVALID_DATA_HMAC_TYPE_VALIDFAIL                  => 74,
-    FKO_ERROR_INVALID_DATA_HMAC_LEN_VALIDFAIL                   => 75,
-    FKO_ERROR_INVALID_DATA_MESSAGE_PORT_MISSING                 => 76,
-    FKO_ERROR_INVALID_DATA_MESSAGE_TYPE_VALIDFAIL               => 77,
-    FKO_ERROR_INVALID_DATA_MESSAGE_EMPTY                        => 78,
-    FKO_ERROR_INVALID_DATA_MESSAGE_CMD_MISSING                  => 79,
-    FKO_ERROR_INVALID_DATA_MESSAGE_ACCESS_MISSING               => 80,
-    FKO_ERROR_INVALID_DATA_MESSAGE_NAT_MISSING                  => 81,
-    FKO_ERROR_INVALID_DATA_MESSAGE_PORTPROTO_MISSING            => 82,
-    FKO_ERROR_INVALID_DATA_NAT_EMPTY                            => 83,
-    FKO_ERROR_INVALID_DATA_RAND_LEN_VALIDFAIL                   => 84,
-    FKO_ERROR_INVALID_DATA_SRVAUTH_MISSING                      => 85,
-    FKO_ERROR_INVALID_DATA_TIMESTAMP_VALIDFAIL                  => 86,
-    FKO_ERROR_INVALID_DATA_USER_MISSING                         => 87,
-    FKO_ERROR_INVALID_DATA_USER_FIRSTCHAR_VALIDFAIL             => 88,
-    FKO_ERROR_INVALID_DATA_USER_REMCHAR_VALIDFAIL               => 89,
-    FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN                   => 90,
-    FKO_ERROR_INVALID_DATA_UTIL_STRTOL_GT_MAX                   => 91,
-    FKO_ERROR_DATA_TOO_LARGE                                    => 92,
-    FKO_ERROR_INVALID_KEY_LEN                                   => 93,
-    FKO_ERROR_USERNAME_UNKNOWN                                  => 94,
-    FKO_ERROR_INCOMPLETE_SPA_DATA                               => 95,
-    FKO_ERROR_MISSING_ENCODED_DATA                              => 96,
-    FKO_ERROR_INVALID_DIGEST_TYPE                               => 97,
-    FKO_ERROR_INVALID_ALLOW_IP                                  => 98,
-    FKO_ERROR_INVALID_SPA_COMMAND_MSG                           => 99,
-    FKO_ERROR_INVALID_SPA_ACCESS_MSG                            => 100,
-    FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG                        => 101,
-    FKO_ERROR_INVALID_ENCRYPTION_TYPE                           => 102,
-    FKO_ERROR_WRONG_ENCRYPTION_TYPE                             => 103,
-    FKO_ERROR_DECRYPTION_SIZE                                   => 104,
-    FKO_ERROR_DECRYPTION_FAILURE                                => 105,
-    FKO_ERROR_DIGEST_VERIFICATION_FAILED                        => 106,
-    FKO_ERROR_INVALID_HMAC_KEY_LEN                              => 107,
-    FKO_ERROR_UNSUPPORTED_HMAC_MODE                             => 108,
-    FKO_ERROR_UNSUPPORTED_FEATURE                               => 109,
-    FKO_ERROR_ZERO_OUT_DATA                                     => 110,
-    FKO_ERROR_UNKNOWN                                           => 111,
+    FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS                 => 9,
+    FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS              => 10,
+    FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE         => 11,
+    FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING                  => 12,
+    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING              => 13,
+    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_TOOBIG               => 14,
+    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_DECODEFAIL           => 15,
+    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_VALIDFAIL            => 16,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_MISSING             => 17,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_TOOBIG              => 18,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_DECODEFAIL          => 19,
+    FKO_ERROR_INVALID_DATA_DECODE_VERSION_MISSING               => 20,
+    FKO_ERROR_INVALID_DATA_DECODE_VERSION_TOOBIG                => 21,
+    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING               => 22,
+    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_TOOBIG                => 23,
+    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL            => 24,
+    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_MISSING               => 25,
+    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_TOOBIG                => 26,
+    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_DECODEFAIL            => 27,
+    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_VALIDFAIL             => 28,
+    FKO_ERROR_INVALID_DATA_DECODE_ACCESS_VALIDFAIL              => 29,
+    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_MISSING             => 30,
+    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_TOOBIG              => 31,
+    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_DECODEFAIL          => 32,
+    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_VALIDFAIL           => 33,
+    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_MISSING               => 34,
+    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_DECODEFAIL            => 35,
+    FKO_ERROR_INVALID_DATA_DECODE_SPA_EXTRA_TOOBIG              => 36,
+    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG                  => 37,
+    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_DECODEFAIL              => 38,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_MISSING               => 39,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_TOOBIG                => 40,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_VALIDFAIL             => 41,
+    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_DECODEFAIL            => 42,
+    FKO_ERROR_INVALID_DATA_ENCODE_MESSAGE_TOOBIG                => 43,
+    FKO_ERROR_INVALID_DATA_ENCODE_MSGLEN_VALIDFAIL              => 44,
+    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_VALIDFAIL              => 45,
+    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_TOOBIG                 => 46,
+    FKO_ERROR_INVALID_DATA_ENCODE_NOTBASE64                     => 47,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_MSGLEN_VALIDFAIL             => 48,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_DIGESTLEN_VALIDFAIL          => 49,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_PTLEN_VALIDFAIL              => 50,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_RESULT_MSGLEN_VALIDFAIL      => 51,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_DECODEFAIL         => 52,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_VALIDFAIL          => 53,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MESSAGE_MISSING    => 54,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MSGLEN_VALIDFAIL   => 55,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MESSAGE_VALIDFAIL        => 56,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_DIGEST_VALIDFAIL         => 57,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MSGLEN_VALIDFAIL         => 58,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_RESULT_MSGLEN_VALIDFAIL  => 59,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_CIPHER_DECODEFAIL        => 60,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSG_NULL          => 61,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSGLEN_VALIDFAIL  => 62,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_VALIDFAIL               => 63,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_MODE_VALIDFAIL               => 64,
+    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_UNKNOWN                 => 65,
+    FKO_ERROR_INVALID_DATA_FUNCS_NEW_ENCMSG_MISSING             => 66,
+    FKO_ERROR_INVALID_DATA_FUNCS_NEW_MSGLEN_VALIDFAIL           => 67,
+    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEYLEN_VALIDFAIL           => 68,
+    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMACLEN_VALIDFAIL          => 69,
+    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEY_ENCODEFAIL             => 70,
+    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMAC_ENCODEFAIL            => 71,
+    FKO_ERROR_INVALID_DATA_FUNCS_SET_MSGLEN_VALIDFAIL           => 72,
+    FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL                => 73,
+    FKO_ERROR_INVALID_DATA_HMAC_ENCMSGLEN_VALIDFAIL             => 74,
+    FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL                     => 75,
+    FKO_ERROR_INVALID_DATA_HMAC_TYPE_VALIDFAIL                  => 76,
+    FKO_ERROR_INVALID_DATA_HMAC_LEN_VALIDFAIL                   => 77,
+    FKO_ERROR_INVALID_DATA_MESSAGE_PORT_MISSING                 => 78,
+    FKO_ERROR_INVALID_DATA_MESSAGE_TYPE_VALIDFAIL               => 79,
+    FKO_ERROR_INVALID_DATA_MESSAGE_EMPTY                        => 80,
+    FKO_ERROR_INVALID_DATA_MESSAGE_CMD_MISSING                  => 81,
+    FKO_ERROR_INVALID_DATA_MESSAGE_ACCESS_MISSING               => 82,
+    FKO_ERROR_INVALID_DATA_MESSAGE_NAT_MISSING                  => 83,
+    FKO_ERROR_INVALID_DATA_MESSAGE_PORTPROTO_MISSING            => 84,
+    FKO_ERROR_INVALID_DATA_NAT_EMPTY                            => 85,
+    FKO_ERROR_INVALID_DATA_RAND_LEN_VALIDFAIL                   => 86,
+    FKO_ERROR_INVALID_DATA_SRVAUTH_MISSING                      => 87,
+    FKO_ERROR_INVALID_DATA_TIMESTAMP_VALIDFAIL                  => 88,
+    FKO_ERROR_INVALID_DATA_USER_MISSING                         => 89,
+    FKO_ERROR_INVALID_DATA_USER_FIRSTCHAR_VALIDFAIL             => 90,
+    FKO_ERROR_INVALID_DATA_USER_REMCHAR_VALIDFAIL               => 91,
+    FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN                   => 92,
+    FKO_ERROR_INVALID_DATA_UTIL_STRTOL_GT_MAX                   => 93,
+    FKO_ERROR_DATA_TOO_LARGE                                    => 94,
+    FKO_ERROR_INVALID_KEY_LEN                                   => 95,
+    FKO_ERROR_USERNAME_UNKNOWN                                  => 96,
+    FKO_ERROR_INCOMPLETE_SPA_DATA                               => 97,
+    FKO_ERROR_MISSING_ENCODED_DATA                              => 98,
+    FKO_ERROR_INVALID_DIGEST_TYPE                               => 99,
+    FKO_ERROR_INVALID_ALLOW_IP                                  => 100,
+    FKO_ERROR_INVALID_SPA_COMMAND_MSG                           => 101,
+    FKO_ERROR_INVALID_SPA_ACCESS_MSG                            => 102,
+    FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG                        => 103,
+    FKO_ERROR_INVALID_ENCRYPTION_TYPE                           => 104,
+    FKO_ERROR_WRONG_ENCRYPTION_TYPE                             => 105,
+    FKO_ERROR_DECRYPTION_SIZE                                   => 106,
+    FKO_ERROR_DECRYPTION_FAILURE                                => 107,
+    FKO_ERROR_DIGEST_VERIFICATION_FAILED                        => 108,
+    FKO_ERROR_INVALID_HMAC_KEY_LEN                              => 109,
+    FKO_ERROR_UNSUPPORTED_HMAC_MODE                             => 110,
+    FKO_ERROR_UNSUPPORTED_FEATURE                               => 111,
+    FKO_ERROR_ZERO_OUT_DATA                                     => 112,
+    FKO_ERROR_UNKNOWN                                           => 113,
     # Start GPGME-related errors
-    GPGME_ERR_START                                             => 112,
-    FKO_ERROR_MISSING_GPG_KEY_DATA                              => 113,
-    FKO_ERROR_GPGME_NO_OPENPGP                                  => 114,
-    FKO_ERROR_GPGME_CONTEXT                                     => 115,
-    FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ                          => 116,
-    FKO_ERROR_GPGME_SET_PROTOCOL                                => 117,
-    FKO_ERROR_GPGME_CIPHER_DATA_OBJ                             => 118,
-    FKO_ERROR_GPGME_BAD_PASSPHRASE                              => 119,
-    FKO_ERROR_GPGME_ENCRYPT_SIGN                                => 120,
-    FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY                          => 121,
-    FKO_ERROR_GPGME_SIGNER_KEYLIST_START                        => 122,
-    FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND                        => 123,
-    FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS                        => 124,
-    FKO_ERROR_GPGME_ADD_SIGNER                                  => 125,
-    FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY                       => 126,
-    FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START                     => 127,
-    FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND                     => 128,
-    FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS                     => 129,
-    FKO_ERROR_GPGME_DECRYPT_FAILED                              => 130,
-    FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM               => 131,
-    FKO_ERROR_GPGME_BAD_GPG_EXE                                 => 132,
-    FKO_ERROR_GPGME_BAD_HOME_DIR                                => 133,
-    FKO_ERROR_GPGME_SET_HOME_DIR                                => 134,
-    FKO_ERROR_GPGME_NO_SIGNATURE                                => 135,
-    FKO_ERROR_GPGME_BAD_SIGNATURE                               => 136,
-    FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED                   => 137,
+    GPGME_ERR_START                                             => 114,
+    FKO_ERROR_MISSING_GPG_KEY_DATA                              => 115,
+    FKO_ERROR_GPGME_NO_OPENPGP                                  => 116,
+    FKO_ERROR_GPGME_CONTEXT                                     => 117,
+    FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ                          => 118,
+    FKO_ERROR_GPGME_SET_PROTOCOL                                => 119,
+    FKO_ERROR_GPGME_CIPHER_DATA_OBJ                             => 120,
+    FKO_ERROR_GPGME_BAD_PASSPHRASE                              => 121,
+    FKO_ERROR_GPGME_ENCRYPT_SIGN                                => 122,
+    FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY                          => 123,
+    FKO_ERROR_GPGME_SIGNER_KEYLIST_START                        => 124,
+    FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND                        => 125,
+    FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS                        => 126,
+    FKO_ERROR_GPGME_ADD_SIGNER                                  => 127,
+    FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY                       => 128,
+    FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START                     => 129,
+    FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND                     => 130,
+    FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS                     => 131,
+    FKO_ERROR_GPGME_DECRYPT_FAILED                              => 132,
+    FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM               => 133,
+    FKO_ERROR_GPGME_BAD_GPG_EXE                                 => 134,
+    FKO_ERROR_GPGME_BAD_HOME_DIR                                => 135,
+    FKO_ERROR_GPGME_SET_HOME_DIR                                => 136,
+    FKO_ERROR_GPGME_NO_SIGNATURE                                => 137,
+    FKO_ERROR_GPGME_BAD_SIGNATURE                               => 138,
+    FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED                   => 139,
 };
 
 1;
index aa3a952..e26250c 100644 (file)
@@ -109,136 +109,138 @@ FKO_ERROR_INVALID_DATA_CLIENT_TIMEOUT_NEGATIVE = 5
 FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL = 6
 FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII = 7
 FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS = 8
-FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE = 9
-FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING = 10
-FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING = 11
-FKO_ERROR_INVALID_DATA_DECODE_USERNAME_TOOBIG = 12
-FKO_ERROR_INVALID_DATA_DECODE_USERNAME_DECODEFAIL = 13
-FKO_ERROR_INVALID_DATA_DECODE_USERNAME_VALIDFAIL = 14
-FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_MISSING = 15
-FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_TOOBIG = 16
-FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_DECODEFAIL = 17
-FKO_ERROR_INVALID_DATA_DECODE_VERSION_MISSING = 18
-FKO_ERROR_INVALID_DATA_DECODE_VERSION_TOOBIG = 19
-FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING = 20
-FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_TOOBIG = 21
-FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL = 22
-FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_MISSING = 23
-FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_TOOBIG = 24
-FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_DECODEFAIL = 25
-FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_VALIDFAIL = 26
-FKO_ERROR_INVALID_DATA_DECODE_ACCESS_VALIDFAIL = 27
-FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_MISSING = 28
-FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_TOOBIG = 29
-FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_DECODEFAIL = 30
-FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_VALIDFAIL = 31
-FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_MISSING = 32
-FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_DECODEFAIL = 33
-FKO_ERROR_INVALID_DATA_DECODE_SPA_EXTRA_TOOBIG = 34
-FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG = 35
-FKO_ERROR_INVALID_DATA_DECODE_EXTRA_DECODEFAIL = 36
-FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_MISSING = 37
-FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_TOOBIG = 38
-FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_VALIDFAIL = 39
-FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_DECODEFAIL = 40
-FKO_ERROR_INVALID_DATA_ENCODE_MESSAGE_TOOBIG = 41
-FKO_ERROR_INVALID_DATA_ENCODE_MSGLEN_VALIDFAIL = 42
-FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_VALIDFAIL = 43
-FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_TOOBIG = 44
-FKO_ERROR_INVALID_DATA_ENCODE_NOTBASE64 = 45
-FKO_ERROR_INVALID_DATA_ENCRYPT_MSGLEN_VALIDFAIL = 46
-FKO_ERROR_INVALID_DATA_ENCRYPT_DIGESTLEN_VALIDFAIL = 47
-FKO_ERROR_INVALID_DATA_ENCRYPT_PTLEN_VALIDFAIL = 48
-FKO_ERROR_INVALID_DATA_ENCRYPT_RESULT_MSGLEN_VALIDFAIL = 49
-FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_DECODEFAIL = 50
-FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_VALIDFAIL = 51
-FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MESSAGE_MISSING = 52
-FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MSGLEN_VALIDFAIL = 53
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MESSAGE_VALIDFAIL = 54
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_DIGEST_VALIDFAIL = 55
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MSGLEN_VALIDFAIL = 56
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_RESULT_MSGLEN_VALIDFAIL = 57
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_CIPHER_DECODEFAIL = 58
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSG_NULL = 59
-FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSGLEN_VALIDFAIL = 60
-FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_VALIDFAIL = 61
-FKO_ERROR_INVALID_DATA_ENCRYPT_MODE_VALIDFAIL = 62
-FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_UNKNOWN = 63
-FKO_ERROR_INVALID_DATA_FUNCS_NEW_ENCMSG_MISSING = 64
-FKO_ERROR_INVALID_DATA_FUNCS_NEW_MSGLEN_VALIDFAIL = 65
-FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEYLEN_VALIDFAIL = 66
-FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMACLEN_VALIDFAIL = 67
-FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEY_ENCODEFAIL = 68
-FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMAC_ENCODEFAIL = 69
-FKO_ERROR_INVALID_DATA_FUNCS_SET_MSGLEN_VALIDFAIL = 70
-FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL = 71
-FKO_ERROR_INVALID_DATA_HMAC_ENCMSGLEN_VALIDFAIL = 72
-FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL = 73
-FKO_ERROR_INVALID_DATA_HMAC_TYPE_VALIDFAIL = 74
-FKO_ERROR_INVALID_DATA_HMAC_LEN_VALIDFAIL = 75
-FKO_ERROR_INVALID_DATA_MESSAGE_PORT_MISSING = 76
-FKO_ERROR_INVALID_DATA_MESSAGE_TYPE_VALIDFAIL = 77
-FKO_ERROR_INVALID_DATA_MESSAGE_EMPTY = 78
-FKO_ERROR_INVALID_DATA_MESSAGE_CMD_MISSING = 79
-FKO_ERROR_INVALID_DATA_MESSAGE_ACCESS_MISSING = 80
-FKO_ERROR_INVALID_DATA_MESSAGE_NAT_MISSING = 81
-FKO_ERROR_INVALID_DATA_MESSAGE_PORTPROTO_MISSING = 82
-FKO_ERROR_INVALID_DATA_NAT_EMPTY = 83
-FKO_ERROR_INVALID_DATA_RAND_LEN_VALIDFAIL = 84
-FKO_ERROR_INVALID_DATA_SRVAUTH_MISSING = 85
-FKO_ERROR_INVALID_DATA_TIMESTAMP_VALIDFAIL = 86
-FKO_ERROR_INVALID_DATA_USER_MISSING = 87
-FKO_ERROR_INVALID_DATA_USER_FIRSTCHAR_VALIDFAIL = 88
-FKO_ERROR_INVALID_DATA_USER_REMCHAR_VALIDFAIL = 89
-FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN = 90
-FKO_ERROR_INVALID_DATA_UTIL_STRTOL_GT_MAX = 91
-FKO_ERROR_DATA_TOO_LARGE = 92
-FKO_ERROR_INVALID_KEY_LEN = 93
-FKO_ERROR_USERNAME_UNKNOWN = 94
-FKO_ERROR_INCOMPLETE_SPA_DATA = 95
-FKO_ERROR_MISSING_ENCODED_DATA = 96
-FKO_ERROR_INVALID_DIGEST_TYPE = 97
-FKO_ERROR_INVALID_ALLOW_IP = 98
-FKO_ERROR_INVALID_SPA_COMMAND_MSG = 99
-FKO_ERROR_INVALID_SPA_ACCESS_MSG = 100
-FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG = 101
-FKO_ERROR_INVALID_ENCRYPTION_TYPE = 102
-FKO_ERROR_WRONG_ENCRYPTION_TYPE = 103
-FKO_ERROR_DECRYPTION_SIZE = 104
-FKO_ERROR_DECRYPTION_FAILURE = 105
-FKO_ERROR_DIGEST_VERIFICATION_FAILED = 106
-FKO_ERROR_INVALID_HMAC_KEY_LEN = 107
-FKO_ERROR_UNSUPPORTED_HMAC_MODE = 108
-FKO_ERROR_UNSUPPORTED_FEATURE = 109
-FKO_ERROR_ZERO_OUT_DATA = 110
-FKO_ERROR_UNKNOWN = 111
+FKO_ERROR_INVALID_DATA_DECODE_GT_MAX_FIELDS = 9
+FKO_ERROR_INVALID_DATA_DECODE_WRONG_NUM_FIELDS = 10
+FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE = 11
+FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING = 12
+FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING = 13
+FKO_ERROR_INVALID_DATA_DECODE_USERNAME_TOOBIG = 14
+FKO_ERROR_INVALID_DATA_DECODE_USERNAME_DECODEFAIL = 15
+FKO_ERROR_INVALID_DATA_DECODE_USERNAME_VALIDFAIL = 16
+FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_MISSING = 17
+FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_TOOBIG = 18
+FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_DECODEFAIL = 19
+FKO_ERROR_INVALID_DATA_DECODE_VERSION_MISSING = 20
+FKO_ERROR_INVALID_DATA_DECODE_VERSION_TOOBIG = 21
+FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING = 22
+FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_TOOBIG = 23
+FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL = 24
+FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_MISSING = 25
+FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_TOOBIG = 26
+FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_DECODEFAIL = 27
+FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_VALIDFAIL = 28
+FKO_ERROR_INVALID_DATA_DECODE_ACCESS_VALIDFAIL = 29
+FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_MISSING = 30
+FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_TOOBIG = 31
+FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_DECODEFAIL = 32
+FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_VALIDFAIL = 33
+FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_MISSING = 34
+FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_DECODEFAIL = 35
+FKO_ERROR_INVALID_DATA_DECODE_SPA_EXTRA_TOOBIG = 36
+FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG = 37
+FKO_ERROR_INVALID_DATA_DECODE_EXTRA_DECODEFAIL = 38
+FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_MISSING = 39
+FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_TOOBIG = 40
+FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_VALIDFAIL = 41
+FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_DECODEFAIL = 42
+FKO_ERROR_INVALID_DATA_ENCODE_MESSAGE_TOOBIG = 43
+FKO_ERROR_INVALID_DATA_ENCODE_MSGLEN_VALIDFAIL = 44
+FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_VALIDFAIL = 45
+FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_TOOBIG = 46
+FKO_ERROR_INVALID_DATA_ENCODE_NOTBASE64 = 47
+FKO_ERROR_INVALID_DATA_ENCRYPT_MSGLEN_VALIDFAIL = 48
+FKO_ERROR_INVALID_DATA_ENCRYPT_DIGESTLEN_VALIDFAIL = 49
+FKO_ERROR_INVALID_DATA_ENCRYPT_PTLEN_VALIDFAIL = 50
+FKO_ERROR_INVALID_DATA_ENCRYPT_RESULT_MSGLEN_VALIDFAIL = 51
+FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_DECODEFAIL = 52
+FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_VALIDFAIL = 53
+FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MESSAGE_MISSING = 54
+FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MSGLEN_VALIDFAIL = 55
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MESSAGE_VALIDFAIL = 56
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_DIGEST_VALIDFAIL = 57
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MSGLEN_VALIDFAIL = 58
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_RESULT_MSGLEN_VALIDFAIL = 59
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_CIPHER_DECODEFAIL = 60
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSG_NULL = 61
+FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSGLEN_VALIDFAIL = 62
+FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_VALIDFAIL = 63
+FKO_ERROR_INVALID_DATA_ENCRYPT_MODE_VALIDFAIL = 64
+FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_UNKNOWN = 65
+FKO_ERROR_INVALID_DATA_FUNCS_NEW_ENCMSG_MISSING = 66
+FKO_ERROR_INVALID_DATA_FUNCS_NEW_MSGLEN_VALIDFAIL = 67
+FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEYLEN_VALIDFAIL = 68
+FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMACLEN_VALIDFAIL = 69
+FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEY_ENCODEFAIL = 70
+FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMAC_ENCODEFAIL = 71
+FKO_ERROR_INVALID_DATA_FUNCS_SET_MSGLEN_VALIDFAIL = 72
+FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL = 73
+FKO_ERROR_INVALID_DATA_HMAC_ENCMSGLEN_VALIDFAIL = 74
+FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL = 75
+FKO_ERROR_INVALID_DATA_HMAC_TYPE_VALIDFAIL = 76
+FKO_ERROR_INVALID_DATA_HMAC_LEN_VALIDFAIL = 77
+FKO_ERROR_INVALID_DATA_MESSAGE_PORT_MISSING = 78
+FKO_ERROR_INVALID_DATA_MESSAGE_TYPE_VALIDFAIL = 79
+FKO_ERROR_INVALID_DATA_MESSAGE_EMPTY = 80
+FKO_ERROR_INVALID_DATA_MESSAGE_CMD_MISSING = 81
+FKO_ERROR_INVALID_DATA_MESSAGE_ACCESS_MISSING = 82
+FKO_ERROR_INVALID_DATA_MESSAGE_NAT_MISSING = 83
+FKO_ERROR_INVALID_DATA_MESSAGE_PORTPROTO_MISSING = 84
+FKO_ERROR_INVALID_DATA_NAT_EMPTY = 85
+FKO_ERROR_INVALID_DATA_RAND_LEN_VALIDFAIL = 86
+FKO_ERROR_INVALID_DATA_SRVAUTH_MISSING = 87
+FKO_ERROR_INVALID_DATA_TIMESTAMP_VALIDFAIL = 88
+FKO_ERROR_INVALID_DATA_USER_MISSING = 89
+FKO_ERROR_INVALID_DATA_USER_FIRSTCHAR_VALIDFAIL = 90
+FKO_ERROR_INVALID_DATA_USER_REMCHAR_VALIDFAIL = 91
+FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN = 92
+FKO_ERROR_INVALID_DATA_UTIL_STRTOL_GT_MAX = 93
+FKO_ERROR_DATA_TOO_LARGE = 94
+FKO_ERROR_INVALID_KEY_LEN = 95
+FKO_ERROR_USERNAME_UNKNOWN = 96
+FKO_ERROR_INCOMPLETE_SPA_DATA = 97
+FKO_ERROR_MISSING_ENCODED_DATA = 98
+FKO_ERROR_INVALID_DIGEST_TYPE = 99
+FKO_ERROR_INVALID_ALLOW_IP = 100
+FKO_ERROR_INVALID_SPA_COMMAND_MSG = 101
+FKO_ERROR_INVALID_SPA_ACCESS_MSG = 102
+FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG = 103
+FKO_ERROR_INVALID_ENCRYPTION_TYPE = 104
+FKO_ERROR_WRONG_ENCRYPTION_TYPE = 105
+FKO_ERROR_DECRYPTION_SIZE = 106
+FKO_ERROR_DECRYPTION_FAILURE = 107
+FKO_ERROR_DIGEST_VERIFICATION_FAILED = 108
+FKO_ERROR_INVALID_HMAC_KEY_LEN = 109
+FKO_ERROR_UNSUPPORTED_HMAC_MODE = 110
+FKO_ERROR_UNSUPPORTED_FEATURE = 111
+FKO_ERROR_ZERO_OUT_DATA = 112
+FKO_ERROR_UNKNOWN = 113
 # Start GPGME-related errors
-GPGME_ERR_START = 112
-FKO_ERROR_MISSING_GPG_KEY_DATA = 113
-FKO_ERROR_GPGME_NO_OPENPGP = 114
-FKO_ERROR_GPGME_CONTEXT = 115
-FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ = 116
-FKO_ERROR_GPGME_SET_PROTOCOL = 117
-FKO_ERROR_GPGME_CIPHER_DATA_OBJ = 118
-FKO_ERROR_GPGME_BAD_PASSPHRASE = 119
-FKO_ERROR_GPGME_ENCRYPT_SIGN = 120
-FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY = 121
-FKO_ERROR_GPGME_SIGNER_KEYLIST_START = 122
-FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND = 123
-FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS = 124
-FKO_ERROR_GPGME_ADD_SIGNER = 125
-FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY = 126
-FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START = 127
-FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND = 128
-FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS = 129
-FKO_ERROR_GPGME_DECRYPT_FAILED = 130
-FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM = 131
-FKO_ERROR_GPGME_BAD_GPG_EXE = 132
-FKO_ERROR_GPGME_BAD_HOME_DIR = 133
-FKO_ERROR_GPGME_SET_HOME_DIR = 134
-FKO_ERROR_GPGME_NO_SIGNATURE = 135
-FKO_ERROR_GPGME_BAD_SIGNATURE = 136
-FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED = 137
+GPGME_ERR_START = 114
+FKO_ERROR_MISSING_GPG_KEY_DATA = 115
+FKO_ERROR_GPGME_NO_OPENPGP = 116
+FKO_ERROR_GPGME_CONTEXT = 117
+FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ = 118
+FKO_ERROR_GPGME_SET_PROTOCOL = 119
+FKO_ERROR_GPGME_CIPHER_DATA_OBJ = 120
+FKO_ERROR_GPGME_BAD_PASSPHRASE = 121
+FKO_ERROR_GPGME_ENCRYPT_SIGN = 122
+FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY = 123
+FKO_ERROR_GPGME_SIGNER_KEYLIST_START = 124
+FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND = 125
+FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS = 126
+FKO_ERROR_GPGME_ADD_SIGNER = 127
+FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY = 128
+FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START = 129
+FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND = 130
+FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS = 131
+FKO_ERROR_GPGME_DECRYPT_FAILED = 132
+FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM = 133
+FKO_ERROR_GPGME_BAD_GPG_EXE = 134
+FKO_ERROR_GPGME_BAD_HOME_DIR = 135
+FKO_ERROR_GPGME_SET_HOME_DIR = 136
+FKO_ERROR_GPGME_NO_SIGNATURE = 137
+FKO_ERROR_GPGME_BAD_SIGNATURE = 138
+FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED = 139
 
 
 ### End FKO Constants ###
index bdf7c60..9641d40 100755 (executable)
@@ -1279,7 +1279,7 @@ sub code_structure_fko_error_strings() {
                 $expected_var_index++;
                 $prev_var = $var_str;
             } else {
-                &write_test_file("[-] expected var $fko_error_codes[$expected_var_index] " .
+                &write_test_file("[-] $libfko_errstr_file: expected var $fko_error_codes[$expected_var_index] " .
                     "in position: $expected_var_index in fko_errstr(), previous var: $prev_var\n",
                     $curr_test_file);
                 $rv = 0;
@@ -1308,8 +1308,9 @@ sub code_structure_fko_error_strings() {
                 $expected_var_index++;
                 $prev_var = $var_str;
             } else {
-                &write_test_file("[-] perl FKO module - expected var $fko_error_codes[$expected_var_index] " .
-                    "in position: $expected_var_index in ERROR_CODES array, previous var: $prev_var\n",
+                &write_test_file("[-] $perl_libfko_constants_file: perl FKO module - " .
+                    "expected var $fko_error_codes[$expected_var_index] " .
+                    "at position: $expected_var_index in ERROR_CODES array, previous var: $prev_var\n",
                     $curr_test_file);
                 $rv = 0;
                 last;
@@ -1334,7 +1335,8 @@ sub code_structure_fko_error_strings() {
         if (/^\s{4}$starting_code\s+=\>\s(\d+),/) {
             my $val = $1;
             unless ($fko_error_codes[$val] eq $starting_code) {
-                &write_test_file("[-] perl FKO module - expected var $starting_code " .
+                &write_test_file("[-] $perl_libfko_constants_file: perl FKO module " .
+                    "- expected var $starting_code " .
                     "value of zero, got $val\n", $curr_test_file);
                 $rv = 0;
                 last;
@@ -1349,7 +1351,8 @@ sub code_structure_fko_error_strings() {
                 $expected_var_index++;
                 $prev_var = $var_str;
             } else {
-                &write_test_file("[-] perl FKO module - expected var $fko_error_codes[$expected_var_index] " .
+                &write_test_file("[-] $perl_libfko_constants_file: perl FKO module " .
+                    "- expected var $fko_error_codes[$expected_var_index] " .
                     "in position: $expected_var_index in 'use constants' definition, previous var: $prev_var\n",
                     $curr_test_file);
                 $rv = 0;