Previous: Utility Functions, Up: Using libfko [Contents][Index]
Most fko functions return an integer value that corresponds to either success (0), or one of the non-zero values thar corresponds to a number of possible errors. libfko provides a function to get a descriptive string for the given error code.
The function fko_errstr returns a pointer to a statically
allocated string containing the descripton of the error.
The list of the possible error codes and their corresponding descriptions as
returned by fko_errstr follows:
FKO_SUCCESSSuccess
FKO_ERROR_CTX_NOT_INITIALIZEDFKO Context is not initialized
FKO_ERROR_MEMORY_ALLOCATIONUnable to allocate memory
FKO_ERROR_FILESYSTEM_OPERATIONRead/write bytes mismiatch
FKO_ERROR_INVALID_DATAArgs contain invalid data
FKO_ERROR_DATA_TOO_LARGEValue or Size of the data exceeded the max allowed
FKO_ERROR_INVALID_KEY_LENInvalid key length
FKO_ERROR_USERNAME_UNKNOWNUnable to determine username
FKO_ERROR_INCOMPLETE_SPA_DATAMissing or incomplete SPA data
FKO_ERROR_MISSING_ENCODED_DATAThere is no encoded data to process
FKO_ERROR_INVALID_DIGEST_TYPEInvalid digest type
FKO_ERROR_INVALID_ALLOW_IPInvalid allow IP address in the SPA message data
FKO_ERROR_INVALID_SPA_COMMAND_MSGInvalid SPA command message format
FKO_ERROR_INVALID_SPA_ACCESS_MSGInvalid SPA access message format
FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSGInvalid SPA nat_access message format
FKO_ERROR_INVALID_ENCRYPTION_TYPEInvalid encryption type
FKO_ERROR_WRONG_ENCRYPTION_TYPEWrong or inappropriate encryption type for this operation
FKO_ERROR_DECRYPTION_SIZEUnexpected or invalid size for decrypted data
FKO_ERROR_DECRYPTION_FAILUREDecryption failed or decrypted data is invalid
FKO_ERROR_DIGEST_VERIFICATION_FAILEDThe computed digest did not match the digest in the spa data
FKO_ERROR_INVALID_HMAC_KEY_LENInvalid HMAC key length
FKO_ERROR_UNSUPPORTED_HMAC_MODEUnsupported HMAC mode (default: SHA256)
FKO_ERROR_UNSUPPORTED_FEATUREUnsupported or unimplemented feature or function
FKO_ERROR_UNKNOWNUnknown/Unclassified error
If GPG support is available, there are additional possible error conditions and error codes. The GPG support is implemented via GPGME. The libfko error handling code wraps many of the GPGME error codes that may be encountered while using libfko’s GPG related functions. These are:
FKO_ERROR_MISSING_GPG_KEY_DATAMissing GPG key data (signer or recipient not set)
FKO_ERROR_GPGME_NO_OPENPGPThis GPGME implementation does not support OpenPGP
FKO_ERROR_GPGME_CONTEXTUnable to create GPGME context
FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJError creating the plaintext data object
FKO_ERROR_GPGME_SET_PROTOCOLUnable to set GPGME to use OpenPGP protocol
FKO_ERROR_GPGME_CIPHER_DATA_OBJError creating the encrypted data data object
FKO_ERROR_GPGME_BAD_PASSPHRASEThe GPG passphrase was not valid
FKO_ERROR_GPGME_ENCRYPT_SIGNError during the encrypt and sign operation
FKO_ERROR_GPGME_CONTEXT_SIGNER_KEYUnable to create GPGME context for the signer key
FKO_ERROR_GPGME_SIGNER_KEYLIST_STARTError from signer keylist start operation
FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUNDThe key for the given signer was not found
FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUSAmbiguous name/id for the signer key (mulitple matches)
FKO_ERROR_GPGME_ADD_SIGNERError adding the signer key to the gpgme context
FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEYUnable to create GPGME context for the recipient key
FKO_ERROR_GPGME_RECIPIENT_KEYLIST_STARTError from signer keylist start operation
FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUNDThe key for the given recipient was not found
FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUSAmbiguous name/id for the recipient key (mulitple matches)
FKO_ERROR_GPGME_DECRYPT_FAILEDDecryption operation failed
FKO_ERROR_GPGME_BAD_GPG_EXEUnable to stat the given GPG executable
FKO_ERROR_GPGME_BAD_HOME_DIRUnable to stat the given GPG home directory
FKO_ERROR_GPGME_SET_HOME_DIRUnable to set the given GPG home directory
FKO_ERROR_GPGME_NO_SIGNATUREMissing GPG signature
FKO_ERROR_GPGME_BAD_SIGNATUREBad GPG signature
FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLEDTrying to check signature with verification disabled
You can use the IS_GPGME_ERROR(err_code) macro to determine whether
or not an error id GPGME related. If the macro evaluates to a
true value, you may be able to get additional information about the error
using the following function:
The function fko_errstr returns a pointer to a statically
allocated string containing the descripton of the GPGME error.
Note: For some errors, this function may return an empty string.
Previous: Utility Functions, Up: Using libfko [Contents][Index]