mirror of
				https://git.code.sf.net/p/linux-ima/ima-evm-utils
				synced 2025-10-30 20:52:15 +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>
			
			
This commit is contained in:
		 Vitaly Chikunov
					Vitaly Chikunov
				
			
				
					committed by
					
						 Mimi Zohar
						Mimi Zohar
					
				
			
			
				
	
			
			
			 Mimi Zohar
						Mimi Zohar
					
				
			
						parent
						
							7fd8c13b64
						
					
				
				
					commit
					19b77c8667
				
			| @@ -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