Fix documentation for mbedtls_gcm_finish()

Fix implementation and documentation missmatch for the function
arguments to mbedtls_gcm_finish(). Also, removed redundant if condition
that always evaluates to true.
This commit is contained in:
Andres AG 2016-09-26 10:09:30 +01:00 committed by Simon Butcher
parent d5e33f14df
commit 6c05208f96
3 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,8 @@ Bugfix
* Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for * Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
by inestlerode. #559. by inestlerode. #559.
* Fix documentation and implementation missmatch for function arguments of
mbedtls_gcm_finish(). Found by cmiatpaar.
= mbed TLS 2.1.5 branch released 2016-06-28 = mbed TLS 2.1.5 branch released 2016-06-28

View File

@ -190,8 +190,8 @@ int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
* 16 bytes. * 16 bytes.
* *
* \param ctx GCM context * \param ctx GCM context
* \param tag buffer for holding the tag (may be NULL if tag_len is 0) * \param tag buffer for holding the tag
* \param tag_len length of the tag to generate * \param tag_len length of the tag to generate (must be at least 4)
* *
* \return 0 if successful or MBEDTLS_ERR_GCM_BAD_INPUT * \return 0 if successful or MBEDTLS_ERR_GCM_BAD_INPUT
*/ */

View File

@ -415,8 +415,7 @@ int mbedtls_gcm_finish( mbedtls_gcm_context *ctx,
if( tag_len > 16 || tag_len < 4 ) if( tag_len > 16 || tag_len < 4 )
return( MBEDTLS_ERR_GCM_BAD_INPUT ); return( MBEDTLS_ERR_GCM_BAD_INPUT );
if( tag_len != 0 ) memcpy( tag, ctx->base_ectr, tag_len );
memcpy( tag, ctx->base_ectr, tag_len );
if( orig_len || orig_add_len ) if( orig_len || orig_add_len )
{ {