Assigned error codes to the error defines
diff --git a/include/polarssl/error.h b/include/polarssl/error.h
index 889e4be..4c9ef7c 100644
--- a/include/polarssl/error.h
+++ b/include/polarssl/error.h
@@ -73,19 +73,20 @@
  * PBKDF2    1  0x007C-0x007C
  *
  * High-level module nr (3 bits - 0x1...-0x8...)
- * Name     ID  Nr of Errors
- * PEM      1   9
- * PKCS#12  1   4 (Started from top)
- * X509     2   25
- * PK       2   3 (Started from top)
- * DHM      3   6
- * PKCS5    3   4 (Started from top)
- * RSA      4   9
- * ECP      4   4 (Started from top)
- * MD       5   4
- * CIPHER   6   5
- * SSL      6   6 (Started from top)
- * SSL      7   31
+ * Name      ID  Nr of Errors
+ * PEM       1   9
+ * PKCS#12   1   4 (Started from top)
+ * X509      2   25
+ * PK        2   3 (Started from top)
+ * DHM       3   6
+ * PKCS5     3   4 (Started from top)
+ * RSA       4   9
+ * ECP       4   4 (Started from top)
+ * MD        5   4
+ * X509WRITE 5   3 (Started from top)
+ * CIPHER    6   5
+ * SSL       6   6 (Started from top)
+ * SSL       7   31
  *
  * Module dependent error code (5 bits 0x.08.-0x.F8.)
  */
diff --git a/include/polarssl/x509write.h b/include/polarssl/x509write.h
index c95172f..2933b2f 100644
--- a/include/polarssl/x509write.h
+++ b/include/polarssl/x509write.h
@@ -31,9 +31,10 @@
 
 #include "rsa.h"
 
-#define POLARSSL_ERR_X509_WRITE_UNKNOWN_OID             -1
-#define POLARSSL_ERR_X509_WRITE_BAD_INPUT_DATA          -1
-#define POLARSSL_ERR_X509_WRITE_MALLOC_FAILED           -1
+#define POLARSSL_ERR_X509WRITE_UNKNOWN_OID                -0x5F80  /**< Requested OID is unknown. */
+#define POLARSSL_ERR_X509WRITE_BAD_INPUT_DATA             -0x5F00  /**< Failed to allocate memory. */
+#define POLARSSL_ERR_X509WRITE_MALLOC_FAILED              -0x5E80  /**< Failed to allocate memory. */
+
 
 #ifdef __cplusplus
 extern "C" {