summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-04-20 20:08:12 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-04-20 20:30:00 +0200
commitce1ceebc782aa6b920ceaef7754e9f87bb0820d0 (patch)
treeba4373058179185e902af6ebcdd32a7cdfcd57ad
parent1a02ec18e9e39f82cee7f9cff74e1f1574bac472 (diff)
downloadgnutls-ce1ceebc782aa6b920ceaef7754e9f87bb0820d0.tar.gz
Added GNUTLS_E_USER_ERROR
-rw-r--r--lib/gnutls_alert.c4
-rw-r--r--lib/gnutls_errors.c2
-rw-r--r--lib/includes/gnutls/gnutls.h.in21
3 files changed, 26 insertions, 1 deletions
diff --git a/lib/gnutls_alert.c b/lib/gnutls_alert.c
index 0663669d59..abd0265afc 100644
--- a/lib/gnutls_alert.c
+++ b/lib/gnutls_alert.c
@@ -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;
diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c
index c87f1cfec6..8096c2e424 100644
--- a/lib/gnutls_errors.c
+++ b/lib/gnutls_errors.c
@@ -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}
};
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index 3e7a715372..06f6f40505 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -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