Complete tests for reading round one
Also change the code to forbid public keys being 0
diff --git a/library/ecjpake.c b/library/ecjpake.c
index 8a8f0e2..4ffeaa3 100644
--- a/library/ecjpake.c
+++ b/library/ecjpake.c
@@ -355,6 +355,12 @@
* } ECJPAKEKeyKP;
*/
MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, X, p, end - *p ) );
+ if( mbedtls_ecp_is_zero( X ) )
+ {
+ ret = MBEDTLS_ERR_ECP_INVALID_KEY;
+ goto cleanup;
+ }
+
MBEDTLS_MPI_CHK( ecjpake_zkp_read( md_info, grp, G, X, id, p, end ) );
cleanup: