aboutsummaryrefslogtreecommitdiffstats
path: root/src/conversion.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2009-10-26 17:38:39 +0000
committerMarcus Brinkmann <[email protected]>2009-10-26 17:38:39 +0000
commitca67902311b832f8dfe1cabb5bf358890a1d3821 (patch)
tree5ce3534870d33da1f86048153fc09dca017ce648 /src/conversion.c
parent2009-10-22 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-ca67902311b832f8dfe1cabb5bf358890a1d3821.tar.gz
gpgme-ca67902311b832f8dfe1cabb5bf358890a1d3821.zip
2009-10-26 Marcus Brinkmann <[email protected]>
* debug.h (DEBUG_GLOBAL): New debug level. * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed. * data-user.c (gpgme_data_new_from_cbs): Add debug output. * data-fd.c (gpgme_data_new_from_fd): Likewise. * data-stream.c (gpgme_data_new_from_stream): Likewise. * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start) (gpgme_op_decrypt): Likewise. * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise. * decrypt-verify.c (gpgme_op_decrypt_verify_start) (gpgme_op_decrypt_verify): Likewise. * sign.c (gpgme_op_sign_result): Fix debug message. * data-mem.c (gpgme_data_new): Improve debug output. * verify.c (parse_trust): Use atoi instead of _gpgme_map_gnupg_error. * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
Diffstat (limited to 'src/conversion.c')
-rw-r--r--src/conversion.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/conversion.c b/src/conversion.c
index 8b3b715c..45513f67 100644
--- a/src/conversion.c
+++ b/src/conversion.c
@@ -371,119 +371,3 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp)
else
return (time_t)strtoul (timestamp, endp, 10);
}
-
-
-
-
-static struct
-{
- char *name;
- gpgme_error_t err;
-} gnupg_errors[] =
- {
- { "EOF", GPG_ERR_EOF },
- { "No_Error", GPG_ERR_NO_ERROR },
- { "General_Error", GPG_ERR_GENERAL },
- { "Out_Of_Core", GPG_ERR_ENOMEM },
- { "Invalid_Value", GPG_ERR_INV_VALUE },
- { "IO_Error", GPG_ERR_GENERAL },
- { "Resource_Limit", GPG_ERR_RESOURCE_LIMIT },
- { "Internal_Error", GPG_ERR_INTERNAL },
- { "Bad_Certificate", GPG_ERR_BAD_CERT },
- { "Bad_Certificate_Chain", GPG_ERR_BAD_CERT_CHAIN},
- { "Missing_Certificate", GPG_ERR_MISSING_CERT },
- { "No_Data", GPG_ERR_NO_DATA },
- { "Bad_Signature", GPG_ERR_BAD_SIGNATURE },
- { "Not_Implemented", GPG_ERR_NOT_IMPLEMENTED },
- { "Conflict", GPG_ERR_CONFLICT },
- { "Bug", GPG_ERR_BUG },
- { "Read_Error", GPG_ERR_GENERAL },
- { "Write_Error", GPG_ERR_GENERAL },
- { "Invalid_Line", GPG_ERR_GENERAL },
- { "Incomplete_Line", GPG_ERR_INCOMPLETE_LINE },
- { "Invalid_Response", GPG_ERR_INV_RESPONSE },
- { "Agent_Error", GPG_ERR_AGENT },
- { "No_Public_Key", GPG_ERR_NO_PUBKEY },
- { "No_Secret_Key", GPG_ERR_NO_SECKEY },
- { "File_Open_Error", GPG_ERR_GENERAL },
- { "File_Create_Error", GPG_ERR_GENERAL },
- { "File_Error", GPG_ERR_GENERAL },
- { "Not_Supported", GPG_ERR_NOT_SUPPORTED },
- { "Invalid_Data", GPG_ERR_INV_DATA },
- { "Assuan_Server_Fault", GPG_ERR_ASSUAN_SERVER_FAULT },
- { "Assuan_Error", GPG_ERR_ASSUAN },
- { "Invalid_Session_Key", GPG_ERR_INV_SESSION_KEY },
- { "Invalid_Sexp", GPG_ERR_INV_SEXP },
- { "Unsupported_Algorithm", GPG_ERR_UNSUPPORTED_ALGORITHM },
- { "No_PIN_Entry", GPG_ERR_NO_PIN_ENTRY },
- { "PIN_Entry_Error", GPG_ERR_NO_PIN_ENTRY },
- { "Bad_PIN", GPG_ERR_BAD_PIN },
- { "Bad_Passphrase", GPG_ERR_BAD_PASSPHRASE },
- { "Invalid_Name", GPG_ERR_INV_NAME },
- { "Bad_Public_Key", GPG_ERR_BAD_PUBKEY },
- { "Bad_Secret_Key", GPG_ERR_BAD_SECKEY },
- { "Bad_Data", GPG_ERR_BAD_DATA },
- { "Invalid_Parameter", GPG_ERR_INV_PARAMETER },
- { "Tribute_to_D_A", GPG_ERR_TRIBUTE_TO_D_A },
- { "No_Dirmngr", GPG_ERR_NO_DIRMNGR },
- { "Dirmngr_Error", GPG_ERR_DIRMNGR },
- { "Certificate_Revoked", GPG_ERR_CERT_REVOKED },
- { "No_CRL_Known", GPG_ERR_NO_CRL_KNOWN },
- { "CRL_Too_Old", GPG_ERR_CRL_TOO_OLD },
- { "Line_Too_Long", GPG_ERR_LINE_TOO_LONG },
- { "Not_Trusted", GPG_ERR_NOT_TRUSTED },
- { "Canceled", GPG_ERR_CANCELED },
- { "Bad_CA_Certificate", GPG_ERR_BAD_CA_CERT },
- { "Certificate_Expired", GPG_ERR_CERT_EXPIRED },
- { "Certificate_Too_Young", GPG_ERR_CERT_TOO_YOUNG },
- { "Unsupported_Certificate", GPG_ERR_UNSUPPORTED_CERT },
- { "Unknown_Sexp", GPG_ERR_UNKNOWN_SEXP },
- { "Unsupported_Protection", GPG_ERR_UNSUPPORTED_PROTECTION },
- { "Corrupted_Protection", GPG_ERR_CORRUPTED_PROTECTION },
- { "Ambiguous_Name", GPG_ERR_AMBIGUOUS_NAME },
- { "Card_Error", GPG_ERR_CARD },
- { "Card_Reset", GPG_ERR_CARD_RESET },
- { "Card_Removed", GPG_ERR_CARD_REMOVED },
- { "Invalid_Card", GPG_ERR_INV_CARD },
- { "Card_Not_Present", GPG_ERR_CARD_NOT_PRESENT },
- { "No_PKCS15_App", GPG_ERR_NO_PKCS15_APP },
- { "Not_Confirmed", GPG_ERR_NOT_CONFIRMED },
- { "Configuration_Error", GPG_ERR_CONFIGURATION },
- { "No_Policy_Match", GPG_ERR_NO_POLICY_MATCH },
- { "Invalid_Index", GPG_ERR_INV_INDEX },
- { "Invalid_Id", GPG_ERR_INV_ID },
- { "No_Scdaemon", GPG_ERR_NO_SCDAEMON },
- { "Scdaemon_Error", GPG_ERR_SCDAEMON },
- { "Unsupported_Protocol", GPG_ERR_UNSUPPORTED_PROTOCOL },
- { "Bad_PIN_Method", GPG_ERR_BAD_PIN_METHOD },
- { "Card_Not_Initialized", GPG_ERR_CARD_NOT_INITIALIZED },
- { "Unsupported_Operation", GPG_ERR_UNSUPPORTED_OPERATION },
- { "Wrong_Key_Usage", GPG_ERR_WRONG_KEY_USAGE }
- };
-
-
-gpgme_error_t
-_gpgme_map_gnupg_error (char *errstr)
-{
- unsigned int i;
- gpgme_error_t err = gpg_err_make (GPG_ERR_SOURCE_GPG, GPG_ERR_GENERAL);
-
- /* Future version of GnuPG might return the error code directly, so
- we first test for a a numerical value and use that verbatim.
- Note that this numerical value might be followed by an
- underschore and the textual representation of the error code. */
- if (*errstr >= '0' && *errstr <= '9')
- return strtoul (errstr, NULL, 10);
-
- /* Well, this is a token, use the mapping table to get the error.
- The drawback is that we won't receive an error source and have to
- use GPG as source. */
- for (i = 0; i < DIM (gnupg_errors); i++)
- if (!strcmp (gnupg_errors[i].name, errstr))
- err = gpg_err_make (GPG_ERR_SOURCE_GPG, gnupg_errors[i].err);
-
- TRACE3 (DEBUG_CTX, "_gpgme_map_gnupg_error", 0,
- "mapped %s to %s <%s>", errstr, gpgme_strerror (err),
- gpgme_strsource (err));
- return err;
-}