]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Re-use GNUTLS_E_DECRYPTION_FAILED for encrypted structures.
authorNikos Mavrogiannopoulos <nikos@esat.kuleuven.be>
Tue, 5 Jun 2012 13:02:01 +0000 (15:02 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 5 Jun 2012 15:30:18 +0000 (17:30 +0200)
NEWS
lib/gnutls_errors.c
lib/includes/gnutls/gnutls.h.in
lib/x509/pkcs12.c
lib/x509/privkey_pkcs8.c

diff --git a/NEWS b/NEWS
index 959a5ec70c5b27771dfaf94e558595c78cd5f41d..fbcee70d1ff44d97c1e598897eeaacbf536ccb3b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,15 +28,15 @@ the whole certificate chain (if any) to the credentials structure, instead
 of only the end-user certificate.
 
 ** libgnutls: Key import functions such as gnutls_pkcs12_simple_parse()
-and gnutls_x509_privkey_import_pkcs8(), return GNUTLS_E_ENCRYPTED_STRUCTURE
-if the input structure is encrypted but no password was provided.
+and gnutls_x509_privkey_import_pkcs8(), return consistently 
+GNUTLS_E_DECRYPTION_FAILED if the input structure is encrypted but no 
+password was provided.
 
 ** libgnutlsxx: Added session::set_transport_vec_push_function. Patch
 by Alexandre Bique.
 
 ** API and ABI modifications:
 GNUTLS_CERT_SIGNATURE_FAILURE: Added
-GNUTLS_E_ENCRYPTED_STRUCTURE: Added
 gnutls_pubkey_verify_hash2: Added
 gnutls_pkcs12_simple_parse: Added
 gnutls_certificate_set_x509_system_trust: Added
index 6ac73a3490fdde8115369772dae56bf9cc308671..c70b3bfdbee29c9cfc211e1e3af015cc9d536251 100644 (file)
@@ -111,7 +111,6 @@ static const gnutls_error_entry error_algorithms[] = {
                GNUTLS_E_MPI_PRINT_FAILED, 1),
   ERROR_ENTRY (N_("Decryption has failed."), GNUTLS_E_DECRYPTION_FAILED, 1),
   ERROR_ENTRY (N_("Encryption has failed."), GNUTLS_E_ENCRYPTION_FAILED, 1),
-  ERROR_ENTRY (N_("The provided structure is encrypted."), GNUTLS_E_ENCRYPTED_STRUCTURE, 1),
   ERROR_ENTRY (N_("Public key decryption has failed."),
                GNUTLS_E_PK_DECRYPTION_FAILED, 1),
   ERROR_ENTRY (N_("Public key encryption has failed."),
index 39e767c8abdd862bdbc3e6398e8b0ded219ca8cb..1a58a53ad305face239ec151c5eb62f38762aae9 100644 (file)
@@ -1898,7 +1898,6 @@ gnutls_ecc_curve_t gnutls_ecc_curve_get(gnutls_session_t session);
 #define GNUTLS_E_NO_PRIORITIES_WERE_SET -326
 #define GNUTLS_E_X509_UNSUPPORTED_EXTENSION -327
 #define GNUTLS_E_SESSION_EOF -328
-#define GNUTLS_E_ENCRYPTED_STRUCTURE -329
 
 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250
 
index 452d6a5cb7be52a7fafeb6a47fa1e35f569b42e3..78e4075097900ba199b6a438da64368b012cc71b 100644 (file)
@@ -1367,7 +1367,7 @@ cleanup:
  * all.
  *
  * If the provided structure has encrypted fields but no password
- * is provided then this function returns %GNUTLS_E_ENCRYPTED_STRUCTURE.
+ * is provided then this function returns %GNUTLS_E_DECRYPTION_FAILED.
  *
  * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
  *   negative error value.
@@ -1432,7 +1432,7 @@ gnutls_pkcs12_simple_parse (gnutls_pkcs12_t p12,
         {
           if (password == NULL)
             {
-              ret = gnutls_assert_val(GNUTLS_E_ENCRYPTED_STRUCTURE);
+              ret = gnutls_assert_val(GNUTLS_E_DECRYPTION_FAILED);
               goto done;
             }
 
@@ -1475,7 +1475,7 @@ gnutls_pkcs12_simple_parse (gnutls_pkcs12_t p12,
             case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY:
               if (password == NULL)
                 {
-                  ret = gnutls_assert_val(GNUTLS_E_ENCRYPTED_STRUCTURE);
+                  ret = gnutls_assert_val(GNUTLS_E_DECRYPTION_FAILED);
                   goto done;
                 }
 
index e921c70e638c29ac0ffdbf9ea607ad7522a8fb0e..f83582af116656af43da0222f8fa84a49f36381f 100644 (file)
@@ -1186,7 +1186,7 @@ error:
  * the encryption status cannot be auto-detected.
  *
  * If the %GNUTLS_PKCS_PLAIN flag is specified and the supplied data
- * are encrypted then %GNUTLS_E_ENCRYPTED_STRUCTURE is returned.
+ * are encrypted then %GNUTLS_E_DECRYPTION_FAILED is returned.
  *
  * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
  *   negative error value.
@@ -1252,7 +1252,7 @@ gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
       if (result < 0)
         { /* check if it is encrypted */
           if (decode_pkcs8_key(&_data, "", key, 0) == 0)
-            result = GNUTLS_E_ENCRYPTED_STRUCTURE;
+            result = GNUTLS_E_DECRYPTION_FAILED;
         }
     }
   else