]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added GNUTLS_E_USER_ERROR
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 20 Apr 2011 18:08:12 +0000 (20:08 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 20 Apr 2011 18:30:00 +0000 (20:30 +0200)
lib/gnutls_alert.c
lib/gnutls_errors.c
lib/includes/gnutls/gnutls.h.in

index 0663669d59a6d82abbdf28dd52b0c7ec45a8db9e..abd0265afcc595dc7b9e7da08df8e4d97b69b3cf 100644 (file)
@@ -214,6 +214,10 @@ gnutls_error_to_alert (int err, int *level)
       ret = GNUTLS_A_UNSUPPORTED_EXTENSION;
       _level = GNUTLS_AL_FATAL;
       break;
+    case GNUTLS_E_USER_ERROR:
+      ret = GNUTLS_A_USER_CANCELED;
+      _level = GNUTLS_AL_FATAL;
+      break;
     case GNUTLS_E_UNEXPECTED_PACKET:
     case GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET:
       ret = GNUTLS_A_UNEXPECTED_MESSAGE;
index c87f1cfec669707c4e4f86a0529d110ac52f658b..8096c2e424ff0c4bb600af6d8b4e85026290ddec 100644 (file)
@@ -326,6 +326,8 @@ static const gnutls_error_entry error_algorithms[] = {
                GNUTLS_E_PKCS11_USER_ERROR, 1),
   ERROR_ENTRY (N_("The operation timed out"),
                GNUTLS_E_TIMEDOUT, 1),
+  ERROR_ENTRY (N_("The operation was cancelled due to user error"),
+               GNUTLS_E_USER_ERROR, 1),
   {NULL, NULL, 0, 0}
 };
 
index 3e7a7153729377bc08cdd3f7cf0c3b73c59e2cac..06f6f40505d62b13dacc6047d1731926743ba157 100644 (file)
@@ -1479,6 +1479,25 @@ extern "C"
 
   /* These are set on the credentials structure.
    */
+  
+  /* This is the same as gnutls_certificate_retrieve_function()
+   * but retrieves a gnutls_pcert_st which requires much less processing
+   * within the library.
+   */
+  typedef int gnutls_certificate_retrieve_function2 (gnutls_session_t,
+                                                    const gnutls_datum_t *
+                                                    req_ca_rdn,
+                                                    int nreqs,
+                                                    const
+                                                    gnutls_pk_algorithm_t
+                                                    * pk_algos,
+                                                    int pk_algos_length,
+                                                    gnutls_pcert_st *);
+
+
+  void gnutls_certificate_set_retrieve_function2
+    (gnutls_certificate_credentials_t cred,
+     gnutls_certificate_retrieve_function2 * func);
 
   typedef int gnutls_certificate_retrieve_function (gnutls_session_t,
                                                     const
@@ -1734,8 +1753,8 @@ extern "C"
 #define GNUTLS_E_PKCS11_USER_ERROR -317
 
 #define GNUTLS_E_CRYPTO_INIT_FAILED -318
-
 #define GNUTLS_E_TIMEDOUT -319
+#define GNUTLS_E_USER_ERROR -320
 
 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250