Changeset 105945 in vbox for trunk/src/libs/openssl-3.1.7/crypto/property/property.c
- Timestamp:
- Sep 4, 2024 11:32:47 AM (8 months ago)
- svn:sync-xref-src-repo-rev:
- 164679
- Location:
- trunk/src/libs/openssl-3.1.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.1.7
- Property svn:mergeinfo
-
old new 25 25 /vendor/openssl/3.0.3:151497-151729 26 26 /vendor/openssl/3.0.7:154371 27 /vendor/openssl/3.1.7:164675-164677
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.1.7/crypto/property/property.c
r104078 r105945 1 1 /* 2 * Copyright 2019-202 3The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved. 3 3 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. 4 4 * … … 97 97 DEFINE_SPARSE_ARRAY_OF(ALGORITHM); 98 98 99 DEFINE_STACK_OF(ALGORITHM) 100 99 101 typedef struct ossl_global_properties_st { 100 102 OSSL_PROPERTY_LIST *list; … … 462 464 } 463 465 464 struct alg_do_each_data_st { 465 void (*fn)(int id, void *method, void *fnarg); 466 void *fnarg; 467 }; 468 469 static void alg_do_each(ossl_uintmax_t idx, ALGORITHM *alg, void *arg) 470 { 471 struct alg_do_each_data_st *data = arg; 472 int i, end = sk_IMPLEMENTATION_num(alg->impls); 473 474 for (i = 0; i < end; i++) { 475 IMPLEMENTATION *impl = sk_IMPLEMENTATION_value(alg->impls, i); 476 477 alg_do_one(alg, impl, data->fn, data->fnarg); 478 } 466 static void alg_copy(ossl_uintmax_t idx, ALGORITHM *alg, void *arg) 467 { 468 STACK_OF(ALGORITHM) *newalg = arg; 469 470 (void)sk_ALGORITHM_push(newalg, alg); 479 471 } 480 472 … … 483 475 void *fnarg) 484 476 { 485 struct alg_do_each_data_st data; 486 487 data.fn = fn; 488 data.fnarg = fnarg; 489 if (store != NULL) 490 ossl_sa_ALGORITHM_doall_arg(store->algs, alg_do_each, &data); 477 int i, j; 478 int numalgs, numimps; 479 STACK_OF(ALGORITHM) *tmpalgs; 480 ALGORITHM *alg; 481 482 if (store != NULL) { 483 484 if (!ossl_property_read_lock(store)) 485 return; 486 487 tmpalgs = sk_ALGORITHM_new_reserve(NULL, 488 ossl_sa_ALGORITHM_num(store->algs)); 489 if (tmpalgs == NULL) { 490 ossl_property_unlock(store); 491 return; 492 } 493 494 ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs); 495 ossl_property_unlock(store); 496 numalgs = sk_ALGORITHM_num(tmpalgs); 497 for (i = 0; i < numalgs; i++) { 498 alg = sk_ALGORITHM_value(tmpalgs, i); 499 numimps = sk_IMPLEMENTATION_num(alg->impls); 500 for (j = 0; j < numimps; j++) 501 alg_do_one(alg, sk_IMPLEMENTATION_value(alg->impls, j), fn, fnarg); 502 } 503 sk_ALGORITHM_free(tmpalgs); 504 } 491 505 } 492 506 … … 644 658 { 645 659 IMPL_CACHE_FLUSH *state = (IMPL_CACHE_FLUSH *)v; 660 unsigned long orig_down_load = lh_QUERY_get_down_load(alg->cache); 646 661 647 662 state->cache = alg->cache; 663 lh_QUERY_set_down_load(alg->cache, 0); 648 664 lh_QUERY_doall_IMPL_CACHE_FLUSH(state->cache, &impl_cache_flush_cache, 649 665 state); 666 lh_QUERY_set_down_load(alg->cache, orig_down_load); 650 667 } 651 668
Note:
See TracChangeset
for help on using the changeset viewer.