mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Refuse non-byte-sized raw data keys
Since the key size is stored in bytes, we can't have a key whose size isn't a whole number of bytes.
This commit is contained in:
		
							parent
							
								
									140855615f
								
							
						
					
					
						commit
						b54979a297
					
				@ -420,6 +420,8 @@ static psa_status_t prepare_raw_data_slot( psa_key_type_t type,
 | 
			
		||||
        default:
 | 
			
		||||
            return( PSA_ERROR_NOT_SUPPORTED );
 | 
			
		||||
    }
 | 
			
		||||
    if( bits % 8 != 0 )
 | 
			
		||||
        return( PSA_ERROR_INVALID_ARGUMENT );
 | 
			
		||||
 | 
			
		||||
    /* Allocate memory for the key */
 | 
			
		||||
    raw->bytes = PSA_BITS_TO_BYTES( bits );
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user