mirror of
				https://git.code.sf.net/p/linux-ima/ima-evm-utils
				synced 2025-11-04 06:40:49 +01:00 
			
		
		
		
	ima-evm-utils: Fix reading of sigfile
Fix reading of detached IMA signature (--sigfile). Error message: Reading to sha1.txt.sig Failed to fread 147 bytes: sha1.txt.sig Failed reading: sha1.txt Reported-by: Mimi Zohar <zohar@linux.ibm.com> Fixes:08a51e7460("ima-evm-utils: Fix file2bin stat and fopen relations") Signed-off-by: Vitaly Chikunov <vt@altlinux.org> Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com> (cherry picked from commit19b77c8667)
This commit is contained in:
		
				
					committed by
					
						
						Mimi Zohar
					
				
			
			
				
	
			
			
			
						parent
						
							97b912a727
						
					
				
				
					commit
					f27e2f7d99
				
			@@ -221,7 +221,7 @@ static unsigned char *file2bin(const char *file, const char *ext, int *size)
 | 
			
		||||
		fclose(fp);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if (fread(data, len, 1, fp) != len) {
 | 
			
		||||
	if (fread(data, len, 1, fp) != 1) {
 | 
			
		||||
		log_err("Failed to fread %zu bytes: %s\n", len, name);
 | 
			
		||||
		fclose(fp);
 | 
			
		||||
		free(data);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user