mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Better checking on cipher_info_from_values()
This commit is contained in:
		
							parent
							
								
									a0558e0484
								
							
						
					
					
						commit
						2a6a3a7e69
					
				@ -494,7 +494,7 @@ const cipher_info_t *cipher_info_from_values( const cipher_id_t cipher_id,
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(POLARSSL_DES_C)
 | 
					#if defined(POLARSSL_DES_C)
 | 
				
			||||||
    if( cipher_id == POLARSSL_CIPHER_ID_DES )
 | 
					    if( cipher_id == POLARSSL_CIPHER_ID_DES && key_length == 64 )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if( mode == POLARSSL_MODE_ECB )
 | 
					        if( mode == POLARSSL_MODE_ECB )
 | 
				
			||||||
            return &des_ecb_info;
 | 
					            return &des_ecb_info;
 | 
				
			||||||
@ -524,13 +524,13 @@ const cipher_info_t *cipher_info_from_values( const cipher_id_t cipher_id,
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(POLARSSL_ARC4_C)
 | 
					#if defined(POLARSSL_ARC4_C)
 | 
				
			||||||
    if( cipher_id == POLARSSL_CIPHER_ID_ARC4 )
 | 
					    if( cipher_id == POLARSSL_CIPHER_ID_ARC4 &&
 | 
				
			||||||
        if( mode == POLARSSL_MODE_STREAM )
 | 
					        key_length == 128 && mode == POLARSSL_MODE_STREAM )
 | 
				
			||||||
            return &arc4_128_info;
 | 
					            return &arc4_128_info;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(POLARSSL_BLOWFISH_C)
 | 
					#if defined(POLARSSL_BLOWFISH_C)
 | 
				
			||||||
    if( cipher_id == POLARSSL_CIPHER_ID_BLOWFISH )
 | 
					    if( cipher_id == POLARSSL_CIPHER_ID_BLOWFISH && key_length == 128 )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if( mode == POLARSSL_MODE_ECB )
 | 
					        if( mode == POLARSSL_MODE_ECB )
 | 
				
			||||||
            return &blowfish_ecb_info;
 | 
					            return &blowfish_ecb_info;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user