Add special return code for ecdsa length mismatch
diff --git a/include/polarssl/ecdsa.h b/include/polarssl/ecdsa.h
index b5e363e..4f06328 100644
--- a/include/polarssl/ecdsa.h
+++ b/include/polarssl/ecdsa.h
@@ -175,7 +175,9 @@
* \param slen Size of sig
*
* \return 0 if successful,
- * POLARSSL_ERR_ECP_BAD_INPUT_DATA if signature is invalid
+ * POLARSSL_ERR_ECP_BAD_INPUT_DATA if signature is invalid,
+ * POLARSSL_ERR_ECP_SIG_LEN_MISTMATCH if the signature is
+ * valid but its actual length is less than siglen,
* or a POLARSSL_ERR_ECP or POLARSSL_ERR_MPI error code
*/
int ecdsa_read_signature( ecdsa_context *ctx,
diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h
index 8886048..93fbe3d 100644
--- a/include/polarssl/ecp.h
+++ b/include/polarssl/ecp.h
@@ -39,6 +39,7 @@
#define POLARSSL_ERR_ECP_MALLOC_FAILED -0x4D80 /**< Memory allocation failed. */
#define POLARSSL_ERR_ECP_RANDOM_FAILED -0x4D00 /**< Generation of random value, such as (ephemeral) key, failed. */
#define POLARSSL_ERR_ECP_INVALID_KEY -0x4C80 /**< Invalid private or public key. */
+#define POLARSSL_ERR_ECP_SIG_LEN_MISMATCH -0x4C00 /**< Signature is valid but shorter than the user-supplied length. */
#ifdef __cplusplus
extern "C" {
diff --git a/include/polarssl/error.h b/include/polarssl/error.h
index 23c0ed7..83102bd 100644
--- a/include/polarssl/error.h
+++ b/include/polarssl/error.h
@@ -87,7 +87,7 @@
* DHM 3 9
* PKCS5 3 4 (Started from top)
* RSA 4 9
- * ECP 4 7 (Started from top)
+ * ECP 4 8 (Started from top)
* MD 5 4
* CIPHER 6 6
* SSL 6 9 (Started from top)