PKCS#5 v2 PBES2 support and use in PKCS#8 encrypted certificates

The error code POLARSSL_ERR_X509_PASSWORD_MISMATCH is now properly
returned in case of an encryption failure in the padding. The
POLARSSL_ERR_X509_PASSWORD_REQUIRED error code is only returned for PEM
formatted private keys as for DER formatted ones it is impossible to
distinguish if a DER blob is PKCS#8 encrypted or not.
(cherry picked from commit 1fd4321ba2016dfaff2b48c11f731fc9ccbd7ccf)

Conflicts:
	include/polarssl/error.h
	scripts/generate_errors.pl
diff --git a/include/polarssl/error.h b/include/polarssl/error.h
index 4e5f69e..42d19a3 100644
--- a/include/polarssl/error.h
+++ b/include/polarssl/error.h
@@ -72,14 +72,14 @@
  * SHA4      1  0x007A-0x007A
  * PBKDF2    1  0x007C-0x007C
  * ECP       1  0x007E-0x007E
- * PKCS5     1  0x007C-0x007C
  *
  * High-level module nr (3 bits - 0x1...-0x8...)
  * Name     ID  Nr of Errors
  * PEM      1   9
  * PKCS#12  1   3 (Started from top)
- * X509     2   21
+ * X509     2   23
  * DHM      3   6
+ * PKCS5    3   4 (Started from top)
  * RSA      4   9
  * ECP      4   1 (Started from top)
  * MD       5   4