mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Explicitly allow NULL as an argument to mbedtls_ccm_free()
This commit is contained in:
		
							parent
							
								
									438448e45f
								
							
						
					
					
						commit
						fd42d531ba
					
				@ -109,7 +109,9 @@ int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
 | 
				
			|||||||
 * \brief   This function releases and clears the specified CCM context
 | 
					 * \brief   This function releases and clears the specified CCM context
 | 
				
			||||||
 *          and underlying cipher sub-context.
 | 
					 *          and underlying cipher sub-context.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * \param ctx       The CCM context to clear. Must not be \c NULL.
 | 
					 * \param ctx       The CCM context to clear.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * \note            If ctx is \c NULL, the function has no effect.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void mbedtls_ccm_free( mbedtls_ccm_context *ctx );
 | 
					void mbedtls_ccm_free( mbedtls_ccm_context *ctx );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -106,7 +106,8 @@ int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
void mbedtls_ccm_free( mbedtls_ccm_context *ctx )
 | 
					void mbedtls_ccm_free( mbedtls_ccm_context *ctx )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    CCM_VALIDATE( ctx != NULL );
 | 
					    if( ctx == NULL )
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
    mbedtls_cipher_free( &ctx->cipher_ctx );
 | 
					    mbedtls_cipher_free( &ctx->cipher_ctx );
 | 
				
			||||||
    mbedtls_platform_zeroize( ctx, sizeof( mbedtls_ccm_context ) );
 | 
					    mbedtls_platform_zeroize( ctx, sizeof( mbedtls_ccm_context ) );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user