mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Return BAD_INPUT error for CCM context's erroneous state
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
		
							parent
							
								
									7251eda6ff
								
							
						
					
					
						commit
						64f0b5f454
					
				@ -263,7 +263,7 @@ int mbedtls_ccm_update_ad( mbedtls_ccm_context *ctx,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( ctx->state & CCM_STATE__ERROR )
 | 
					    if( ctx->state & CCM_STATE__ERROR )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return ret;
 | 
					        return MBEDTLS_ERR_CCM_BAD_INPUT;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( ctx->add_len > 0 && add_len > 0 )
 | 
					    if( ctx->add_len > 0 && add_len > 0 )
 | 
				
			||||||
@ -339,7 +339,7 @@ int mbedtls_ccm_update( mbedtls_ccm_context *ctx,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( ctx->state & CCM_STATE__ERROR )
 | 
					    if( ctx->state & CCM_STATE__ERROR )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
 | 
					        return MBEDTLS_ERR_CCM_BAD_INPUT;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( ctx->processed + input_len > ctx->plaintext_len )
 | 
					    if( ctx->processed + input_len > ctx->plaintext_len )
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user