mirror of
				https://git.code.sf.net/p/linux-ima/ima-evm-utils
				synced 2025-10-30 20:52:15 +01:00 
			
		
		
		
	evmctl: Define and use an ENGINE field in libimaevm_params
Extend the global libimaevm_params structure with an ENGINE field 'eng' and use it in place of the local ENGINE variable in main(). 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
						
							29aa7465d5
						
					
				
				
					commit
					1de1e3c8ce
				
			
							
								
								
									
										11
									
								
								src/evmctl.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/evmctl.c
									
									
									
									
									
								
							| @@ -2660,7 +2660,6 @@ static ENGINE *setup_engine(const char *engine_id) | ||||
| int main(int argc, char *argv[]) | ||||
| { | ||||
| 	int err = 0, c, lind; | ||||
| 	ENGINE *eng = NULL; | ||||
| 	unsigned long keyid; | ||||
| 	char *eptr; | ||||
|  | ||||
| @@ -2781,8 +2780,8 @@ int main(int argc, char *argv[]) | ||||
| 			verify_list_sig = 1; | ||||
| 			break; | ||||
| 		case 139: /* --engine e */ | ||||
| 			eng = setup_engine(optarg); | ||||
| 			if (!eng) | ||||
| 			imaevm_params.eng = setup_engine(optarg); | ||||
| 			if (!imaevm_params.eng) | ||||
| 				goto error; | ||||
| 			break; | ||||
| 		case 140: /* --xattr-user */ | ||||
| @@ -2858,9 +2857,9 @@ int main(int argc, char *argv[]) | ||||
| 	} | ||||
|  | ||||
| error: | ||||
| 	if (eng) { | ||||
| 		ENGINE_finish(eng); | ||||
| 		ENGINE_free(eng); | ||||
| 	if (imaevm_params.eng) { | ||||
| 		ENGINE_finish(imaevm_params.eng); | ||||
| 		ENGINE_free(imaevm_params.eng); | ||||
| #if OPENSSL_API_COMPAT < 0x10100000L | ||||
| 		ENGINE_cleanup(); | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user