Add documentation warnings for weak algorithms
MD2, MD4, MD5, DES and SHA-1 are considered weak and their use
constitutes a security risk. If possible, we recommend avoiding
dependencies on them, and considering stronger message digests and
ciphers instead.
diff --git a/include/polarssl/md4.h b/include/polarssl/md4.h
index 68ac6c1..f690ea6 100644
--- a/include/polarssl/md4.h
+++ b/include/polarssl/md4.h
@@ -20,6 +20,11 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * \warning MD4 is considered a weak message digest and its use constitutes a
+ * security risk. We recommend considering stronger message digests
+ * instead.
+ *
*/
#ifndef POLARSSL_MD4_H
#define POLARSSL_MD4_H
@@ -51,6 +56,11 @@
/**
* \brief MD4 context structure
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
typedef struct
{
@@ -67,6 +77,11 @@
* \brief Initialize MD4 context
*
* \param ctx MD4 context to be initialized
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_init( md4_context *ctx );
@@ -74,6 +89,11 @@
* \brief Clear MD4 context
*
* \param ctx MD4 context to be cleared
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_free( md4_context *ctx );
@@ -81,6 +101,11 @@
* \brief MD4 context setup
*
* \param ctx context to be initialized
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_starts( md4_context *ctx );
@@ -90,6 +115,11 @@
* \param ctx MD4 context
* \param input buffer holding the data
* \param ilen length of the input data
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
@@ -98,6 +128,11 @@
*
* \param ctx MD4 context
* \param output MD4 checksum result
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_finish( md4_context *ctx, unsigned char output[16] );
@@ -119,6 +154,11 @@
* \param input buffer holding the data
* \param ilen length of the input data
* \param output MD4 checksum result
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
@@ -129,6 +169,11 @@
* \param output MD4 checksum result
*
* \return 0 if successful, or POLARSSL_ERR_MD4_FILE_IO_ERROR
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
int md4_file( const char *path, unsigned char output[16] );
@@ -138,6 +183,11 @@
* \param ctx HMAC context to be initialized
* \param key HMAC secret key
* \param keylen length of the HMAC key
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
size_t keylen );
@@ -148,6 +198,11 @@
* \param ctx HMAC context
* \param input buffer holding the data
* \param ilen length of the input data
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_hmac_update( md4_context *ctx, const unsigned char *input,
size_t ilen );
@@ -157,6 +212,11 @@
*
* \param ctx HMAC context
* \param output MD4 HMAC checksum result
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
@@ -164,6 +224,11 @@
* \brief MD4 HMAC context reset
*
* \param ctx HMAC context to be reset
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_hmac_reset( md4_context *ctx );
@@ -175,6 +240,11 @@
* \param input buffer holding the data
* \param ilen length of the input data
* \param output HMAC-MD4 result
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
void md4_hmac( const unsigned char *key, size_t keylen,
const unsigned char *input, size_t ilen,
@@ -184,6 +254,11 @@
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
+ *
+ * \warning MD4 is considered a weak message digest and its use
+ * constitutes a security risk. We recommend considering
+ * stronger message digests instead.
+ *
*/
int md4_self_test( int verbose );