mirror of
				https://git.code.sf.net/p/linux-ima/ima-evm-utils
				synced 2025-10-31 13:10:42 +01:00 
			
		
		
		
	ima_evm_utils: Fix calculation of keyid for older distros
Older distros, such as Ubuntu Xenial or Centos 7, fail to calculate the keyid properly in the bash script. Adding 'tail -n1' into the pipe fixes the issue since we otherwise have two numbers in 'id' due to two 'BIT STRING's. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
		 Stefan Berger
					Stefan Berger
				
			
				
					committed by
					
						 Mimi Zohar
						Mimi Zohar
					
				
			
			
				
	
			
			
			 Mimi Zohar
						Mimi Zohar
					
				
			
						parent
						
							056a7d284c
						
					
				
				
					commit
					cbbe31e1ca
				
			| @@ -43,6 +43,7 @@ _keyid_from_cert() { | ||||
|   id=$($cmd 2>/dev/null \ | ||||
|     | openssl asn1parse \ | ||||
|     | grep BIT.STRING \ | ||||
|     | tail -n1 \ | ||||
|     | cut -d: -f1) | ||||
|   if [ -z "$id" ]; then | ||||
|     echo - "$cmd" >&2 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user