Initialise return values to an error
Initialising the return values to and error is best practice and makes
the library more robust.
diff --git a/library/pkcs5.c b/library/pkcs5.c
index 3d29fd7..8832322 100644
--- a/library/pkcs5.c
+++ b/library/pkcs5.c
@@ -38,6 +38,7 @@
#if defined(MBEDTLS_PKCS5_C)
#include "mbedtls/pkcs5.h"
+#include "mbedtls/error.h"
#if defined(MBEDTLS_ASN1_PARSE_C)
#include "mbedtls/asn1.h"
@@ -59,7 +60,7 @@
mbedtls_asn1_buf *salt, int *iterations,
int *keylen, mbedtls_md_type_t *md_type )
{
- int ret;
+ int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
mbedtls_asn1_buf prf_alg_oid;
unsigned char *p = params->p;
const unsigned char *end = params->p + params->len;