VirtualBox

Ignore:
Timestamp:
Sep 4, 2024 11:32:47 AM (8 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164679
Message:

openssl-3.1.7: Applied and adjusted our OpenSSL changes to 3.1.7. bugref:10757

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  
        2525/vendor/openssl/3.0.3:151497-151729
        2626/vendor/openssl/3.0.7:154371
         27/vendor/openssl/3.1.7:164675-164677
  • trunk/src/libs/openssl-3.1.7/crypto/property/property.c

    r104078 r105945  
    11/*
    2  * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
    33 * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
    44 *
     
    9797DEFINE_SPARSE_ARRAY_OF(ALGORITHM);
    9898
     99DEFINE_STACK_OF(ALGORITHM)
     100
    99101typedef struct ossl_global_properties_st {
    100102    OSSL_PROPERTY_LIST *list;
     
    462464}
    463465
    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     }
     466static 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);
    479471}
    480472
     
    483475                              void *fnarg)
    484476{
    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    }
    491505}
    492506
     
    644658{
    645659    IMPL_CACHE_FLUSH *state = (IMPL_CACHE_FLUSH *)v;
     660    unsigned long orig_down_load = lh_QUERY_get_down_load(alg->cache);
    646661
    647662    state->cache = alg->cache;
     663    lh_QUERY_set_down_load(alg->cache, 0);
    648664    lh_QUERY_doall_IMPL_CACHE_FLUSH(state->cache, &impl_cache_flush_cache,
    649665                                    state);
     666    lh_QUERY_set_down_load(alg->cache, orig_down_load);
    650667}
    651668
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette