mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
* maperror.c (map_gcry_err): Add some mappings.
This commit is contained in:
parent
5f116e9540
commit
ee1b7e428b
@ -1,3 +1,7 @@
|
|||||||
|
2001-12-20 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* maperror.c (map_gcry_err): Add some mappings.
|
||||||
|
|
||||||
2001-12-18 Werner Koch <wk@gnupg.org>
|
2001-12-18 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* Makefile.am (AM_CPPFLAGS): Include flags for gcrypt and ksba
|
* Makefile.am (AM_CPPFLAGS): Include flags for gcrypt and ksba
|
||||||
|
@ -64,6 +64,9 @@ enum {
|
|||||||
GNUPG_Bad_PIN = 35,
|
GNUPG_Bad_PIN = 35,
|
||||||
GNUPG_Bad_Passphrase = 36,
|
GNUPG_Bad_Passphrase = 36,
|
||||||
GNUPG_Invalid_Name = 37,
|
GNUPG_Invalid_Name = 37,
|
||||||
|
GNUPG_Bad_Public_Key = 38,
|
||||||
|
GNUPG_Bad_Secret_Key = 39,
|
||||||
|
GNUPG_Bad_Data = 40,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Status codes - fixme: should go into another file */
|
/* Status codes - fixme: should go into another file */
|
||||||
|
@ -58,10 +58,50 @@ map_gcry_err (int err)
|
|||||||
{
|
{
|
||||||
switch (err)
|
switch (err)
|
||||||
{
|
{
|
||||||
|
case GCRYERR_EOF:
|
||||||
case -1:
|
case -1:
|
||||||
|
err = -1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GCRYERR_WRONG_PK_ALGO:
|
||||||
|
case GCRYERR_INV_PK_ALGO:
|
||||||
|
case GCRYERR_INV_MD_ALGO:
|
||||||
|
case GCRYERR_INV_CIPHER_ALGO:
|
||||||
|
err = GNUPG_Unsupported_Algorithm;
|
||||||
|
break;
|
||||||
|
case GCRYERR_INV_KEYLEN:
|
||||||
|
case GCRYERR_WEAK_KEY:
|
||||||
|
case GCRYERR_BAD_PUBLIC_KEY: err = GNUPG_Bad_Public_Key; break;
|
||||||
|
case GCRYERR_BAD_SECRET_KEY: err = GNUPG_Bad_Secret_Key; break;
|
||||||
|
case GCRYERR_BAD_SIGNATURE: err = GNUPG_Bad_Signature; break;
|
||||||
|
|
||||||
|
case GCRYERR_BAD_MPI:
|
||||||
|
err = GNUPG_Bad_Data;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GCRYERR_INV_ARG:
|
||||||
|
case GCRYERR_INV_OP:
|
||||||
|
case GCRYERR_INTERNAL:
|
||||||
|
case GCRYERR_INV_CIPHER_MODE:
|
||||||
|
err = GNUPG_Invalid_Value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GCRYERR_SELFTEST:
|
||||||
|
err = GNUPG_Bug;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GCRYERR_NO_MEM: err = GNUPG_Out_Of_Core; break;
|
||||||
|
|
||||||
|
case GCRYERR_NOT_IMPL: err = GNUPG_Not_Implemented; break;
|
||||||
|
case GCRYERR_CONFLICT: err = GNUPG_Conflict; break;
|
||||||
|
|
||||||
|
case GCRYERR_INV_OBJ: /* an object is not valid */
|
||||||
|
case GCRYERR_TOO_SHORT: /* provided buffer too short */
|
||||||
|
case GCRYERR_TOO_LARGE: /* object is too large */
|
||||||
|
case GCRYERR_NO_OBJ: /* Missing item in an object */
|
||||||
default:
|
default:
|
||||||
err = seterr (General_Error);
|
err = seterr (General_Error);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user