Latest update (add quic)
This commit is contained in:
+41
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -24,6 +24,42 @@ struct construct_data_st {
|
||||
void *mcm_data;
|
||||
};
|
||||
|
||||
static int ossl_method_construct_precondition(OSSL_PROVIDER *provider,
|
||||
int operation_id, void *cbdata,
|
||||
int *result)
|
||||
{
|
||||
if (!ossl_assert(result != NULL)) {
|
||||
ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ossl_provider_test_operation_bit(provider, operation_id, result))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The result we get tells if methods have already been constructed.
|
||||
* However, we want to tell whether construction should happen (true)
|
||||
* or not (false), which is the opposite of what we got.
|
||||
*/
|
||||
*result = !*result;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int ossl_method_construct_postcondition(OSSL_PROVIDER *provider,
|
||||
int operation_id, int no_store,
|
||||
void *cbdata, int *result)
|
||||
{
|
||||
if (!ossl_assert(result != NULL)) {
|
||||
ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*result = 1;
|
||||
return no_store != 0
|
||||
|| ossl_provider_set_operation_bit(provider, operation_id);
|
||||
}
|
||||
|
||||
static void ossl_method_construct_this(OSSL_PROVIDER *provider,
|
||||
const OSSL_ALGORITHM *algo,
|
||||
int no_store, void *cbdata)
|
||||
@@ -86,7 +122,10 @@ void *ossl_method_construct(OPENSSL_CTX *libctx, int operation_id,
|
||||
cbdata.mcm = mcm;
|
||||
cbdata.mcm_data = mcm_data;
|
||||
ossl_algorithm_do_all(libctx, operation_id, NULL,
|
||||
ossl_method_construct_this, &cbdata);
|
||||
ossl_method_construct_precondition,
|
||||
ossl_method_construct_this,
|
||||
ossl_method_construct_postcondition,
|
||||
&cbdata);
|
||||
|
||||
method = mcm->get(libctx, cbdata.store, mcm_data);
|
||||
mcm->dealloc_tmp_store(cbdata.store);
|
||||
|
||||
Reference in New Issue
Block a user