mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	Nix the memset loop
Speaking of which: Why wasn't it JUST a memset() call? The encrypted version of packet_write fills in this data with OpenSSL RAND_bytes() data, and as far as the unencrypted version goes? Well, it's unencrypted, randomness doesn't help at that point.
This commit is contained in:
		@@ -893,11 +893,6 @@ int libssh2_packet_write(LIBSSH2_SESSION *session, unsigned char *data, unsigned
 | 
			
		||||
	libssh2_htonu32(buf, packet_length);
 | 
			
		||||
	buf[4] = padding_length;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < padding_length; i++) {
 | 
			
		||||
		/* Make random */
 | 
			
		||||
		buf[5 + i] = '\0';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (session->state & LIBSSH2_STATE_NEWKEYS) {
 | 
			
		||||
		/* Encryption is in effect */
 | 
			
		||||
		unsigned char *encbuf, *s;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user