commit | b6e81bc3d7ba726a9dbc72b4127e31be2fc1ab41 | [log] [tgz] |
---|---|---|
author | Andrzej Kurek <andrzej.kurek@arm.com> | Tue Feb 20 11:20:09 2018 -0500 |
committer | Andrzej Kurek <andrzej.kurek@arm.com> | Tue Feb 20 11:20:09 2018 -0500 |
tree | f6de6104e3c6ed9bdeaa29e630e66a6ba987691a | |
parent | 0044ab12b7099457a24930aa80bd85d9724431dc [diff] [blame] |
ECP: Add a sanity check to mbedtls_ecp_ansi_write_group Check for p != q at the end to ensure that everything went as it should.
diff --git a/library/ecp.c b/library/ecp.c index 477ed0d..89b0af4 100644 --- a/library/ecp.c +++ b/library/ecp.c
@@ -2082,6 +2082,8 @@ return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL ); q = p + 2 + oid_length; *olen = mbedtls_asn1_write_oid( &q, p, oid, oid_length ); + if ( p != q ) + return ( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); return ( 0 ); }