From a36d23e290db16e50b8fffea62a8e782118e6798 Mon Sep 17 00:00:00 2001
From: Paul Bakker <p.j.bakker@offspark.com>
Date: Mon, 30 Dec 2013 17:57:27 +0100
Subject: [PATCH] Fixed documentation issues found by clang

---
 include/polarssl/ecdh.h             |  2 +-
 include/polarssl/ecp.h              |  2 +-
 include/polarssl/entropy.h          |  3 ++-
 include/polarssl/gcm.h              |  2 +-
 include/polarssl/padlock.h          |  2 +-
 include/polarssl/pk.h               | 16 ++++++++--------
 include/polarssl/pkcs12.h           |  6 +++---
 include/polarssl/rsa.h              |  1 -
 include/polarssl/ssl_ciphersuites.h |  2 +-
 include/polarssl/x509_crt.h         |  6 +++---
 10 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/include/polarssl/ecdh.h b/include/polarssl/ecdh.h
index d20f9bf273..3c4800bf0d 100644
--- a/include/polarssl/ecdh.h
+++ b/include/polarssl/ecdh.h
@@ -148,7 +148,7 @@ int ecdh_read_params( ecdh_context *ctx,
  *
  * \param ctx       ECDH constext to set
  * \param key       EC key to use
- * \param ours      Is it our key (1) or the peer's key (0) ?
+ * \param side      Is it our key (1) or the peer's key (0) ?
  *
  * \return          0 if successful, or an POLARSSL_ERR_ECP_XXX error code
  */
diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h
index ff1072e0c8..eea4c6dc3f 100644
--- a/include/polarssl/ecp.h
+++ b/include/polarssl/ecp.h
@@ -215,7 +215,7 @@ const ecp_curve_info *ecp_curve_info_from_grp_id( ecp_group_id grp_id );
 /**
  * \brief           Get curve information from a TLS NamedCurve value
  *
- * \param grp_id    A POLARSSL_ECP_DP_XXX value
+ * \param tls_id    A POLARSSL_ECP_DP_XXX value
  *
  * \return          The associated curve information or NULL
  */
diff --git a/include/polarssl/entropy.h b/include/polarssl/entropy.h
index 235b7733c9..7e65b780a0 100644
--- a/include/polarssl/entropy.h
+++ b/include/polarssl/entropy.h
@@ -81,7 +81,8 @@ extern "C" {
  * \return          0 if no critical failures occurred,
  *                  POLARSSL_ERR_ENTROPY_SOURCE_FAILED otherwise
  */
-typedef int (*f_source_ptr)(void *, unsigned char *, size_t, size_t *);
+typedef int (*f_source_ptr)(void *data, unsigned char *output, size_t len,
+                            size_t *olen);
 
 /**
  * \brief           Entropy source state
diff --git a/include/polarssl/gcm.h b/include/polarssl/gcm.h
index e4267c645f..c2829a0092 100644
--- a/include/polarssl/gcm.h
+++ b/include/polarssl/gcm.h
@@ -201,7 +201,7 @@ int gcm_finish( gcm_context *ctx,
 /**
  * \brief           Free a GCM context and underlying cipher sub-context
  *
- * \param ctx
+ * \param ctx       GCM context to free
  */
 void gcm_free( gcm_context *ctx );
 
diff --git a/include/polarssl/padlock.h b/include/polarssl/padlock.h
index 8df93c034c..545120fe39 100644
--- a/include/polarssl/padlock.h
+++ b/include/polarssl/padlock.h
@@ -59,7 +59,7 @@ extern "C" {
 /**
  * \brief          PadLock detection routine
  *
- * \param          The feature to detect
+ * \param feature  The feature to detect
  *
  * \return         1 if CPU has support for the feature, 0 otherwise
  */
diff --git a/include/polarssl/pk.h b/include/polarssl/pk.h
index 958672b0c8..013d9736ac 100644
--- a/include/polarssl/pk.h
+++ b/include/polarssl/pk.h
@@ -453,14 +453,14 @@ int pk_parse_public_keyfile( pk_context *ctx, const char *path );
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param key       private to write away
+ * \param ctx       private to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          length of data written if successful, or a specific
  *                  error code
  */
-int pk_write_key_der( pk_context *pk, unsigned char *buf, size_t size );
+int pk_write_key_der( pk_context *ctx, unsigned char *buf, size_t size );
 
 /**
  * \brief           Write a public key to a SubjectPublicKeyInfo DER structure
@@ -468,37 +468,37 @@ int pk_write_key_der( pk_context *pk, unsigned char *buf, size_t size );
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param key       public key to write away
+ * \param ctx       public key to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          length of data written if successful, or a specific
  *                  error code
  */
-int pk_write_pubkey_der( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_pubkey_der( pk_context *ctx, unsigned char *buf, size_t size );
 
 #if defined(POLARSSL_PEM_WRITE_C)
 /**
  * \brief           Write a public key to a PEM string
  *
- * \param key       public key to write away
+ * \param ctx       public key to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          0 successful, or a specific error code
  */
-int pk_write_pubkey_pem( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_pubkey_pem( pk_context *ctx, unsigned char *buf, size_t size );
 
 /**
  * \brief           Write a private key to a PKCS#1 or SEC1 PEM string
  *
- * \param key       private to write away
+ * \param ctx       private to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          0 successful, or a specific error code
  */
-int pk_write_key_pem( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_key_pem( pk_context *ctx, unsigned char *buf, size_t size );
 #endif /* POLARSSL_PEM_WRITE_C */
 #endif /* POLARSSL_PK_WRITE_C */
 
diff --git a/include/polarssl/pkcs12.h b/include/polarssl/pkcs12.h
index 51bea3da1e..4bd5018af5 100644
--- a/include/polarssl/pkcs12.h
+++ b/include/polarssl/pkcs12.h
@@ -38,9 +38,9 @@
 #define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT             -0x1E80  /**< PBE ASN.1 data not as expected. */
 #define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH              -0x1E00  /**< Given private key password does not allow for correct decryption. */
 
-#define PKCS12_DERIVE_KEY       1   /*< encryption/decryption key */
-#define PKCS12_DERIVE_IV        2   /*< initialization vector     */
-#define PKCS12_DERIVE_MAC_KEY   3   /*< integrity / MAC key       */
+#define PKCS12_DERIVE_KEY       1   /**< encryption/decryption key */
+#define PKCS12_DERIVE_IV        2   /**< initialization vector     */
+#define PKCS12_DERIVE_MAC_KEY   3   /**< integrity / MAC key       */
 
 #define PKCS12_PBE_DECRYPT      0
 #define PKCS12_PBE_ENCRYPT      1
diff --git a/include/polarssl/rsa.h b/include/polarssl/rsa.h
index e7b6191598..504dde24df 100644
--- a/include/polarssl/rsa.h
+++ b/include/polarssl/rsa.h
@@ -526,7 +526,6 @@ int rsa_rsassa_pkcs1_v15_verify( rsa_context *ctx,
 
 /**
  * \brief          Perform a PKCS#1 v2.1 PSS verification (RSASSA-PSS-VERIFY)
- * \brief          Do a public RSA and check the message digest
  *
  * \param ctx      points to an RSA public key
  * \param f_rng    RNG function (Only needed for RSA_PRIVATE)
diff --git a/include/polarssl/ssl_ciphersuites.h b/include/polarssl/ssl_ciphersuites.h
index 3b13ef3517..28a5855b62 100644
--- a/include/polarssl/ssl_ciphersuites.h
+++ b/include/polarssl/ssl_ciphersuites.h
@@ -226,7 +226,7 @@ typedef enum {
 
 typedef struct _ssl_ciphersuite_t ssl_ciphersuite_t;
 
-#define POLARSSL_CIPHERSUITE_WEAK   0x01    /*<! Weak ciphersuite flag      */
+#define POLARSSL_CIPHERSUITE_WEAK   0x01    /**< Weak ciphersuite flag      */
 
 /**
  * \brief   This structure is used for storing ciphersuite information
diff --git a/include/polarssl/x509_crt.h b/include/polarssl/x509_crt.h
index 4e7bbb7b3b..ee8f9e6cde 100644
--- a/include/polarssl/x509_crt.h
+++ b/include/polarssl/x509_crt.h
@@ -371,7 +371,7 @@ void x509write_crt_set_issuer_key( x509write_cert *ctx, pk_context *key );
  *                  (e.g. POLARSSL_MD_SHA1)
  *
  * \param ctx       CRT context to use
- * \param md_ald    MD algorithm to use
+ * \param md_alg    MD algorithm to use
  */
 void x509write_crt_set_md_alg( x509write_cert *ctx, md_type_t md_alg );
 
@@ -467,7 +467,7 @@ void x509write_crt_free( x509write_cert *ctx );
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param crt       certificate to write away
+ * \param ctx       certificate to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  * \param f_rng     RNG function (for signature, see note)
@@ -489,7 +489,7 @@ int x509write_crt_der( x509write_cert *ctx, unsigned char *buf, size_t size,
 /**
  * \brief           Write a built up certificate to a X509 PEM string
  *
- * \param crt       certificate to write away
+ * \param ctx       certificate to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  * \param f_rng     RNG function (for signature, see note)