* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
/*
* Low level APIs are deprecated for public use, but still ok for internal use.
#include <openssl/core_names.h>
#include <openssl/params.h>
#include <openssl/err.h>
+#include <openssl/proverr.h>
#include <openssl/pem.h> /* Functions for writing MSBLOB and PVK */
#include <openssl/dsa.h>
+#include "internal/cryptlib.h"
#include "internal/passphrase.h"
#include "crypto/rsa.h"
#include "prov/implementations.h"
OPENSSL_free(ctx);
}
+{- produce_param_decoder('key2pvk_set_ctx_params',
+ (['ENCODER_PARAM_ENCRYPT_LEVEL', 'enclvl', 'int'],
+ )); -}
+
static const OSSL_PARAM *key2pvk_settable_ctx_params(ossl_unused void *provctx)
{
- static const OSSL_PARAM settables[] = {
- OSSL_PARAM_int(OSSL_ENCODER_PARAM_ENCRYPT_LEVEL, NULL),
- OSSL_PARAM_END,
- };
-
- return settables;
+ return key2pvk_set_ctx_params_list;
}
static int key2pvk_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
struct key2ms_ctx_st *ctx = vctx;
- const OSSL_PARAM *p;
+ struct key2pvk_set_ctx_params_st p;
+
+ if (ctx == NULL || !key2pvk_set_ctx_params_decoder(params, &p))
+ return 0;
- p = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_ENCRYPT_LEVEL);
- if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->pvk_encr_level))
+ if (p.enclvl != NULL && !OSSL_PARAM_get_int(p.enclvl, &ctx->pvk_encr_level))
return 0;
return 1;
}