mirror of https://github.com/openssl/openssl.git
				
				
				
			apps/list.c: Check the result of inserting a provider into provider's stack
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22492)
(cherry picked from commit 15b83e04a5)
			
			
This commit is contained in:
		
							parent
							
								
									2fd4fd35bf
								
							
						
					
					
						commit
						f94fbe9520
					
				
							
								
								
									
										15
									
								
								apps/list.c
								
								
								
								
							
							
						
						
									
										15
									
								
								apps/list.c
								
								
								
								
							|  | @ -1209,9 +1209,11 @@ static int provider_cmp(const OSSL_PROVIDER * const *a, | ||||||
| static int collect_providers(OSSL_PROVIDER *provider, void *stack) | static int collect_providers(OSSL_PROVIDER *provider, void *stack) | ||||||
| { | { | ||||||
|     STACK_OF(OSSL_PROVIDER) *provider_stack = stack; |     STACK_OF(OSSL_PROVIDER) *provider_stack = stack; | ||||||
| 
 |     /*
 | ||||||
|     sk_OSSL_PROVIDER_push(provider_stack, provider); |      * If OK - result is the index of inserted data | ||||||
|     return 1; |      * Error - result is -1 or 0 | ||||||
|  |      */ | ||||||
|  |     return sk_OSSL_PROVIDER_push(provider_stack, provider) > 0 ? 1 : 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void list_provider_info(void) | static void list_provider_info(void) | ||||||
|  | @ -1226,8 +1228,13 @@ static void list_provider_info(void) | ||||||
|         BIO_printf(bio_err, "ERROR: Memory allocation\n"); |         BIO_printf(bio_err, "ERROR: Memory allocation\n"); | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     if (OSSL_PROVIDER_do_all(NULL, &collect_providers, providers) != 1) { | ||||||
|  |         BIO_printf(bio_err, "ERROR: Memory allocation\n"); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     BIO_printf(bio_out, "Providers:\n"); |     BIO_printf(bio_out, "Providers:\n"); | ||||||
|     OSSL_PROVIDER_do_all(NULL, &collect_providers, providers); |  | ||||||
|     sk_OSSL_PROVIDER_sort(providers); |     sk_OSSL_PROVIDER_sort(providers); | ||||||
|     for (i = 0; i < sk_OSSL_PROVIDER_num(providers); i++) { |     for (i = 0; i < sk_OSSL_PROVIDER_num(providers); i++) { | ||||||
|         const OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(providers, i); |         const OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(providers, i); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue