Moved new invalid data error definitions above the GPGME_ERR_START marker.
authorDamien Stuart <dstuart@dstuart.org>
Mon, 12 Aug 2013 02:02:50 +0000 (22:02 -0400)
committerDamien Stuart <dstuart@dstuart.org>
Mon, 12 Aug 2013 02:02:50 +0000 (22:02 -0400)
lib/fko.h

index 79407ce..9906ab3 100644 (file)
--- a/lib/fko.h
+++ b/lib/fko.h
@@ -130,57 +130,9 @@ typedef enum {
     FKO_ERROR_CTX_NOT_INITIALIZED,
     FKO_ERROR_MEMORY_ALLOCATION,
     FKO_ERROR_FILESYSTEM_OPERATION,
-    FKO_ERROR_INVALID_DATA,
-    FKO_ERROR_DATA_TOO_LARGE,
-    FKO_ERROR_INVALID_KEY_LEN,
-    FKO_ERROR_USERNAME_UNKNOWN,
-    FKO_ERROR_INCOMPLETE_SPA_DATA,
-    FKO_ERROR_MISSING_ENCODED_DATA,
-    FKO_ERROR_INVALID_DIGEST_TYPE,
-    FKO_ERROR_INVALID_ALLOW_IP,
-    FKO_ERROR_INVALID_SPA_COMMAND_MSG,
-    FKO_ERROR_INVALID_SPA_ACCESS_MSG,
-    FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG,
-    FKO_ERROR_INVALID_ENCRYPTION_TYPE,
-    FKO_ERROR_WRONG_ENCRYPTION_TYPE,
-    FKO_ERROR_DECRYPTION_SIZE,
-    FKO_ERROR_DECRYPTION_FAILURE,
-    FKO_ERROR_DIGEST_VERIFICATION_FAILED,
-    FKO_ERROR_INVALID_HMAC_KEY_LEN,
-    FKO_ERROR_UNSUPPORTED_HMAC_MODE,
-    FKO_ERROR_UNSUPPORTED_FEATURE,
-    FKO_ERROR_ZERO_OUT_DATA,
-    FKO_ERROR_UNKNOWN,
 
-    /* Start GPGME-related errors */
-    GPGME_ERR_START,
-    FKO_ERROR_MISSING_GPG_KEY_DATA,
-    FKO_ERROR_GPGME_NO_OPENPGP,
-    FKO_ERROR_GPGME_CONTEXT,
-    FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ,
-    FKO_ERROR_GPGME_SET_PROTOCOL,
-    FKO_ERROR_GPGME_CIPHER_DATA_OBJ,
-    FKO_ERROR_GPGME_BAD_PASSPHRASE,
-    FKO_ERROR_GPGME_ENCRYPT_SIGN,
-    FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY,
-    FKO_ERROR_GPGME_SIGNER_KEYLIST_START,
-    FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND,
-    FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS,
-    FKO_ERROR_GPGME_ADD_SIGNER,
-    FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY,
-    FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START,
-    FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND,
-    FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS,
-    FKO_ERROR_GPGME_DECRYPT_FAILED,
-    FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM,
-    FKO_ERROR_GPGME_BAD_GPG_EXE,
-    FKO_ERROR_GPGME_BAD_HOME_DIR,
-    FKO_ERROR_GPGME_SET_HOME_DIR,
-    FKO_ERROR_GPGME_NO_SIGNATURE,
-    FKO_ERROR_GPGME_BAD_SIGNATURE,
-    FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED,
-
-    /* Start debugging invalid data errors */
+    /* Invalid data errors */
+    FKO_ERROR_INVALID_DATA,
     FKO_ERROR_INVALID_DATA_CLIENT_TIMEOUT_NEGATIVE,
     FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL,
     FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII,
@@ -268,6 +220,57 @@ typedef enum {
     FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN,
     FKO_ERROR_INVALID_DATA_UTIL_STROL_GT_MAX,
 
+    FKO_ERROR_DATA_TOO_LARGE,
+    FKO_ERROR_INVALID_KEY_LEN,
+    FKO_ERROR_USERNAME_UNKNOWN,
+    FKO_ERROR_INCOMPLETE_SPA_DATA,
+    FKO_ERROR_MISSING_ENCODED_DATA,
+    FKO_ERROR_INVALID_DIGEST_TYPE,
+    FKO_ERROR_INVALID_ALLOW_IP,
+    FKO_ERROR_INVALID_SPA_COMMAND_MSG,
+    FKO_ERROR_INVALID_SPA_ACCESS_MSG,
+    FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG,
+    FKO_ERROR_INVALID_ENCRYPTION_TYPE,
+    FKO_ERROR_WRONG_ENCRYPTION_TYPE,
+    FKO_ERROR_DECRYPTION_SIZE,
+    FKO_ERROR_DECRYPTION_FAILURE,
+    FKO_ERROR_DIGEST_VERIFICATION_FAILED,
+    FKO_ERROR_INVALID_HMAC_KEY_LEN,
+    FKO_ERROR_UNSUPPORTED_HMAC_MODE,
+    FKO_ERROR_UNSUPPORTED_FEATURE,
+    FKO_ERROR_ZERO_OUT_DATA,
+    FKO_ERROR_UNKNOWN,
+
+    /* Start GPGME-related errors (NOTE: Do not put non-GPG-related error
+     * below this point).
+    */
+    GPGME_ERR_START,
+    FKO_ERROR_MISSING_GPG_KEY_DATA,
+    FKO_ERROR_GPGME_NO_OPENPGP,
+    FKO_ERROR_GPGME_CONTEXT,
+    FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ,
+    FKO_ERROR_GPGME_SET_PROTOCOL,
+    FKO_ERROR_GPGME_CIPHER_DATA_OBJ,
+    FKO_ERROR_GPGME_BAD_PASSPHRASE,
+    FKO_ERROR_GPGME_ENCRYPT_SIGN,
+    FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY,
+    FKO_ERROR_GPGME_SIGNER_KEYLIST_START,
+    FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND,
+    FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS,
+    FKO_ERROR_GPGME_ADD_SIGNER,
+    FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY,
+    FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START,
+    FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND,
+    FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS,
+    FKO_ERROR_GPGME_DECRYPT_FAILED,
+    FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM,
+    FKO_ERROR_GPGME_BAD_GPG_EXE,
+    FKO_ERROR_GPGME_BAD_HOME_DIR,
+    FKO_ERROR_GPGME_SET_HOME_DIR,
+    FKO_ERROR_GPGME_NO_SIGNATURE,
+    FKO_ERROR_GPGME_BAD_SIGNATURE,
+    FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED,
+
     FKO_LAST_ERROR
 } fko_error_codes_t;