]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
introduced GNUTLS_E_NO_PRIORITIES_WERE_SET.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 17 Jan 2012 18:47:12 +0000 (19:47 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 18 Jan 2012 18:47:45 +0000 (19:47 +0100)
lib/gnutls_errors.c
lib/gnutls_handshake.c
lib/includes/gnutls/gnutls.h.in

index 72209ab98c93da3e7be44d2a0c7cd7bacf807d27..e1def739cb82c9931d3d2350ca9e4d2924c8b302 100644 (file)
@@ -51,6 +51,8 @@ static const gnutls_error_entry error_algorithms[] = {
   ERROR_ENTRY (N_("Success."), GNUTLS_E_SUCCESS, 0),
   ERROR_ENTRY (N_("Could not negotiate a supported cipher suite."),
                GNUTLS_E_UNKNOWN_CIPHER_SUITE, 1),
+  ERROR_ENTRY (N_("No priorities were setup."),
+               GNUTLS_E_NO_PRIORITIES_WERE_SET, 1),
   ERROR_ENTRY (N_("The cipher type is unsupported."),
                GNUTLS_E_UNKNOWN_CIPHER_TYPE, 1),
   ERROR_ENTRY (N_("The certificate and the given key do not match."),
index a3045512a5a483cb9cba4c2c116a57ea61a1847e..b00212211bee9b519960dce9bac13c104df10324 100644 (file)
@@ -2344,6 +2344,11 @@ gnutls_handshake (gnutls_session_t session)
 {
   int ret;
   record_parameters_st *params;
+  
+  /* sanity check. Verify that there are priorities setup.
+   */
+  if (session->internals.priorities.protocol.algorithms == 0)
+    return gnutls_assert_val(GNUTLS_E_NO_PRIORITIES_WERE_SET);
 
   ret = _gnutls_epoch_get (session, session->security_parameters.epoch_next,
                            &params);
index 0f4aa044c503027b666b474f54893dda06e446a2..2af7ae58848bf6040f237eac02ea114016ac83e2 100644 (file)
@@ -1811,6 +1811,7 @@ gnutls_ecc_curve_t gnutls_ecc_curve_get(gnutls_session_t session);
 #define GNUTLS_E_PKCS11_REQUESTED_OBJECT_NOT_AVAILBLE -323
 #define GNUTLS_E_CERTIFICATE_LIST_UNSORTED -324
 #define GNUTLS_E_ILLEGAL_PARAMETER -325
+#define GNUTLS_E_NO_PRIORITIES_WERE_SET -326
 
 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250