Changes x509_csr to x509write_csr
diff --git a/include/polarssl/x509write.h b/include/polarssl/x509write.h
index 2e6fa0c..ece2319 100644
--- a/include/polarssl/x509write.h
+++ b/include/polarssl/x509write.h
@@ -63,14 +63,14 @@
 /**
  * Container for a CSR
  */
-typedef struct _x509_csr
+typedef struct _x509write_csr
 {
     rsa_context *rsa;
     asn1_named_data *subject;
     md_type_t md_alg;
     asn1_named_data *extensions;
 }
-x509_csr;
+x509write_csr;
 
 #define X509_CRT_VERSION_1              0
 #define X509_CRT_VERSION_2              1
@@ -104,7 +104,7 @@
  *
  * \param ctx       CSR context to initialize
  */
-void x509write_csr_init( x509_csr *ctx );
+void x509write_csr_init( x509write_csr *ctx );
 
 /**
  * \brief           Set the subject name for a CSR
@@ -118,7 +118,7 @@
  * \return          0 if subject name was parsed successfully, or
  *                  a specific error code
  */
-int x509write_csr_set_subject_name( x509_csr *ctx, char *subject_name );
+int x509write_csr_set_subject_name( x509write_csr *ctx, char *subject_name );
 
 /**
  * \brief           Set the RSA key for a CSR (public key will be included,
@@ -127,7 +127,7 @@
  * \param ctx       CSR context to use
  * \param rsa       RSA key to include
  */
-void x509write_csr_set_rsa_key( x509_csr *ctx, rsa_context *rsa );
+void x509write_csr_set_rsa_key( x509write_csr *ctx, rsa_context *rsa );
 
 /**
  * \brief           Set the MD algorithm to use for the signature
@@ -136,7 +136,7 @@
  * \param ctx       CSR context to use
  * \param md_ald    MD algorithm to use
  */
-void x509write_csr_set_md_alg( x509_csr *ctx, md_type_t md_alg );
+void x509write_csr_set_md_alg( x509write_csr *ctx, md_type_t md_alg );
 
 /**
  * \brief           Set the Key Usage Extension flags
@@ -147,7 +147,7 @@
  *
  * \return          0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED
  */
-int x509write_csr_set_key_usage( x509_csr *ctx, unsigned char key_usage );
+int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage );
 
 /**
  * \brief           Set the Netscape Cert Type flags
@@ -158,7 +158,8 @@
  *
  * \return          0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED
  */
-int x509write_csr_set_ns_cert_type( x509_csr *ctx, unsigned char ns_cert_type );
+int x509write_csr_set_ns_cert_type( x509write_csr *ctx,
+                                    unsigned char ns_cert_type );
 
 /**
  * \brief           Generic function to add to or replace an extension in the CSR
@@ -171,7 +172,7 @@
  *
  * \return          0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED
  */
-int x509write_csr_set_extension( x509_csr *ctx,
+int x509write_csr_set_extension( x509write_csr *ctx,
                                  const char *oid, size_t oid_len,
                                  const unsigned char *val, size_t val_len );
 
@@ -180,7 +181,7 @@
  *
  * \param ctx       CSR context to free
  */
-void x509write_csr_free( x509_csr *ctx );
+void x509write_csr_free( x509write_csr *ctx );
 
 /**
  * \brief           Initialize a CRT writing context
@@ -399,7 +400,7 @@
  * \return          length of data written if successful, or a specific
  *                  error code
  */
-int x509write_csr_der( x509_csr *ctx, unsigned char *buf, size_t size );
+int x509write_csr_der( x509write_csr *ctx, unsigned char *buf, size_t size );
 
 #if defined(POLARSSL_BASE64_C)
 /**
@@ -445,7 +446,7 @@
  *
  * \return          0 successful, or a specific error code
  */
-int x509write_csr_pem( x509_csr *ctx, unsigned char *buf, size_t size );
+int x509write_csr_pem( x509write_csr *ctx, unsigned char *buf, size_t size );
 #endif /* POLARSSL_BASE64_C */
 
 #ifdef __cplusplus
diff --git a/library/x509write.c b/library/x509write.c
index 5d5d3de..818a83a 100644
--- a/library/x509write.c
+++ b/library/x509write.c
@@ -134,30 +134,30 @@
     return( len );
 }
 
-void x509write_csr_init( x509_csr *ctx )
+void x509write_csr_init( x509write_csr *ctx )
 {
-    memset( ctx, 0, sizeof(x509_csr) );
+    memset( ctx, 0, sizeof(x509write_csr) );
 }
 
-void x509write_csr_free( x509_csr *ctx )
+void x509write_csr_free( x509write_csr *ctx )
 {
     asn1_free_named_data_list( &ctx->subject );
     asn1_free_named_data_list( &ctx->extensions );
 
-    memset( ctx, 0, sizeof(x509_csr) );
+    memset( ctx, 0, sizeof(x509write_csr) );
 }
 
-void x509write_csr_set_md_alg( x509_csr *ctx, md_type_t md_alg )
+void x509write_csr_set_md_alg( x509write_csr *ctx, md_type_t md_alg )
 {
     ctx->md_alg = md_alg;
 }
 
-void x509write_csr_set_rsa_key( x509_csr *ctx, rsa_context *rsa )
+void x509write_csr_set_rsa_key( x509write_csr *ctx, rsa_context *rsa )
 {
     ctx->rsa = rsa;
 }
 
-int x509write_csr_set_subject_name( x509_csr *ctx, char *subject_name )
+int x509write_csr_set_subject_name( x509write_csr *ctx, char *subject_name )
 {
     return x509write_string_to_names( &ctx->subject, subject_name );
 }
@@ -184,7 +184,7 @@
     return( 0 );
 }
 
-int x509write_csr_set_extension( x509_csr *ctx,
+int x509write_csr_set_extension( x509write_csr *ctx,
                                  const char *oid, size_t oid_len,
                                  const unsigned char *val, size_t val_len )
 {
@@ -192,7 +192,7 @@
                                0, val, val_len );
 }
 
-int x509write_csr_set_key_usage( x509_csr *ctx, unsigned char key_usage )
+int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage )
 {
     unsigned char buf[4];
     unsigned char *c;
@@ -212,7 +212,8 @@
     return( 0 );
 }
 
-int x509write_csr_set_ns_cert_type( x509_csr *ctx, unsigned char ns_cert_type )
+int x509write_csr_set_ns_cert_type( x509write_csr *ctx,
+                                    unsigned char ns_cert_type )
 {
     unsigned char buf[4];
     unsigned char *c;
@@ -248,7 +249,7 @@
     asn1_free_named_data_list( &ctx->issuer );
     asn1_free_named_data_list( &ctx->extensions );
 
-    memset( ctx, 0, sizeof(x509_csr) );
+    memset( ctx, 0, sizeof(x509write_csr) );
 }
 
 void x509write_crt_set_md_alg( x509write_cert *ctx, md_type_t md_alg )
@@ -644,7 +645,7 @@
     return( len );
 }
 
-int x509write_csr_der( x509_csr *ctx, unsigned char *buf, size_t size )
+int x509write_csr_der( x509write_csr *ctx, unsigned char *buf, size_t size )
 {
     int ret;
     const char *sig_oid;
@@ -975,7 +976,7 @@
     return( 0 );
 }
 
-int x509write_csr_pem( x509_csr *ctx, unsigned char *buf, size_t size )
+int x509write_csr_pem( x509write_csr *ctx, unsigned char *buf, size_t size )
 {
     int ret;
     unsigned char output_buf[4096];
diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c
index 384ef08..17a969a 100644
--- a/programs/x509/cert_req.c
+++ b/programs/x509/cert_req.c
@@ -60,7 +60,7 @@
     unsigned char ns_cert_type; /* NS cert type                         */
 } opt;
 
-int write_certificate_request( x509_csr *req, char *output_file )
+int write_certificate_request( x509write_csr *req, char *output_file )
 {
     int ret;
     FILE *f;
@@ -130,7 +130,7 @@
     char buf[1024];
     int i, j, n;
     char *p, *q, *r;
-    x509_csr req;
+    x509write_csr req;
 
     /*
      * Set to sane values
diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function
index 10338aa..53fb3ed 100644
--- a/tests/suites/test_suite_x509write.function
+++ b/tests/suites/test_suite_x509write.function
@@ -16,7 +16,7 @@
 {
     rsa_context rsa;
     pem_context pem;
-    x509_csr req;
+    x509write_csr req;
     unsigned char *c;
     unsigned char buf[4000];
     unsigned char check_buf[4000];