More error codes
authorWerner Koch <wk@gnupg.org>
Mon, 18 Feb 2002 20:46:09 +0000 (20:46 +0000)
committerWerner Koch <wk@gnupg.org>
Mon, 18 Feb 2002 20:46:09 +0000 (20:46 +0000)
common/ChangeLog
common/errors.h
common/maperror.c

index 9ea09bd..8e5563f 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-14  Werner Koch  <wk@gnupg.org>
+
+       * maperror.c: Add more assuan<->gnupg mappings.
+
 2002-02-12  Werner Koch  <wk@gnupg.org>
 
        * fopencookie.c: Dummy function.
index 26cdb86..d968d70 100644 (file)
@@ -91,6 +91,7 @@ enum {
   GNUPG_Invalid_Card = 62,
   GNUPG_Card_Not_Present = 63,
   GNUPG_No_PKCS15_App = 64,
+  GNUPG_Not_Confirmed = 65,
 };
 
 /* Status codes - fixme: should go into another file */
index 0e9f92f..91c97f9 100644 (file)
@@ -148,6 +148,11 @@ map_assuan_err (int err)
 
     case ASSUAN_Not_Trusted:     err = GNUPG_Not_Trusted; break;
 
+    case ASSUAN_Card_Error:      err = GNUPG_Card_Error; break;
+    case ASSUAN_Invalid_Card:    err = GNUPG_Invalid_Card; break;
+    case ASSUAN_No_PKCS15_App:   err = GNUPG_No_PKCS15_App; break;
+    case ASSUAN_Card_Not_Present: err= GNUPG_Card_Not_Present; break;
+    case ASSUAN_Not_Confirmed:   err = GNUPG_Not_Confirmed; break;
 
     default:
       err = err < 100? GNUPG_Assuan_Server_Fault : GNUPG_Assuan_Error;
@@ -178,6 +183,19 @@ map_to_assuan_status (int rc)
     case GNUPG_Not_Trusted:       rc = ASSUAN_Not_Trusted; break;
     case GNUPG_Canceled:          rc = ASSUAN_Canceled; break;
 
+    case GNUPG_Card_Error:      
+    case GNUPG_Card_Reset:      
+      rc = ASSUAN_Card_Error; 
+      break;
+    case GNUPG_Card_Removed:  
+    case GNUPG_Card_Not_Present:
+      rc = ASSUAN_Card_Not_Present;
+      break;
+    case GNUPG_Invalid_Card:      rc = ASSUAN_Invalid_Card; break;
+    case GNUPG_No_PKCS15_App:     rc = ASSUAN_No_PKCS15_App; break;
+    case GNUPG_Not_Confirmed:     rc = ASSUAN_Not_Confirmed; break;
+
+
     case GNUPG_Bad_PIN:
     case GNUPG_Bad_Passphrase:
       rc = ASSUAN_No_Secret_Key;