mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Timing: fix mbedtls_set_alarm(0) on Unix/POSIX
The POSIX/Unix implementation of mbedtls_set_alarm did not set the mbedtls_timing_alarmed flag when called with 0, which was inconsistent with what the documentation implied and with the Windows behavior.
This commit is contained in:
		
							parent
							
								
									ec82da4cb2
								
							
						
					
					
						commit
						a0af95f052
					
				@ -9,6 +9,7 @@ Bugfix
 | 
			
		||||
   * Fix memory leak in mbedtls_ssl_set_hostname() when called multiple times.
 | 
			
		||||
     Found by projectgus and jethrogb, #836.
 | 
			
		||||
   * Fix usage help in ssl_server2 example. Found and fixed by Bei Lin.
 | 
			
		||||
   * Fix mbedtls_timing_alarm(0) on Unix.
 | 
			
		||||
 | 
			
		||||
= mbed TLS 2.6.0 branch released 2017-08-10
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -315,6 +315,12 @@ void mbedtls_set_alarm( int seconds )
 | 
			
		||||
    mbedtls_timing_alarmed = 0;
 | 
			
		||||
    signal( SIGALRM, sighandler );
 | 
			
		||||
    alarm( seconds );
 | 
			
		||||
    if( seconds == 0 )
 | 
			
		||||
    {
 | 
			
		||||
        /* alarm(0) cancelled any previous pending alarm, but the
 | 
			
		||||
           handler won't fire, so raise the flag straight away. */
 | 
			
		||||
        mbedtls_timing_alarmed = 1;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* _WIN32 && !EFIX64 && !EFI32 */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user