mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Remove overly strict final checks
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
		
							parent
							
								
									91b021e4c7
								
							
						
					
					
						commit
						814fffbd72
					
				@ -3749,11 +3749,8 @@ exit:
 | 
			
		||||
    return( status );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static psa_status_t psa_aead_final_checks( psa_aead_operation_t *operation,
 | 
			
		||||
                                           size_t output_size )
 | 
			
		||||
static psa_status_t psa_aead_final_checks( psa_aead_operation_t *operation )
 | 
			
		||||
{
 | 
			
		||||
    size_t finish_output_size;
 | 
			
		||||
 | 
			
		||||
    if( operation->id == 0 || !operation->nonce_set )
 | 
			
		||||
        return( PSA_ERROR_BAD_STATE );
 | 
			
		||||
 | 
			
		||||
@ -3761,13 +3758,6 @@ static psa_status_t psa_aead_final_checks( psa_aead_operation_t *operation,
 | 
			
		||||
                                   operation->body_remaining != 0 ) )
 | 
			
		||||
        return( PSA_ERROR_INVALID_ARGUMENT );
 | 
			
		||||
 | 
			
		||||
    finish_output_size = operation->is_encrypt ?
 | 
			
		||||
         PSA_AEAD_FINISH_OUTPUT_SIZE( operation->key_type, operation->alg ) :
 | 
			
		||||
         PSA_AEAD_VERIFY_OUTPUT_SIZE( operation->key_type, operation->alg );
 | 
			
		||||
 | 
			
		||||
    if( output_size < finish_output_size )
 | 
			
		||||
        return( PSA_ERROR_BUFFER_TOO_SMALL );
 | 
			
		||||
 | 
			
		||||
    return( PSA_SUCCESS );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -3785,7 +3775,7 @@ psa_status_t psa_aead_finish( psa_aead_operation_t *operation,
 | 
			
		||||
    *ciphertext_length = 0;
 | 
			
		||||
    *tag_length = tag_size;
 | 
			
		||||
 | 
			
		||||
    status = psa_aead_final_checks( operation, ciphertext_size );
 | 
			
		||||
    status = psa_aead_final_checks( operation );
 | 
			
		||||
 | 
			
		||||
    if( status != PSA_SUCCESS )
 | 
			
		||||
        goto exit;
 | 
			
		||||
@ -3831,7 +3821,7 @@ psa_status_t psa_aead_verify( psa_aead_operation_t *operation,
 | 
			
		||||
 | 
			
		||||
    *plaintext_length = 0;
 | 
			
		||||
 | 
			
		||||
    status = psa_aead_final_checks( operation, plaintext_size );
 | 
			
		||||
    status = psa_aead_final_checks( operation );
 | 
			
		||||
 | 
			
		||||
    if( status != PSA_SUCCESS )
 | 
			
		||||
        goto exit;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user