* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
/*
* This is a decoder that's completely internal to the 'file:' store
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/asn1err.h>
+#include <openssl/proverr.h>
+#include "internal/cryptlib.h"
#include <openssl/params.h>
#include "internal/asn1.h"
#include "internal/sizes.h"
OPENSSL_free(ctx);
}
+{- produce_param_decoder('any2obj_set_ctx_params',
+ (['OBJECT_PARAM_DATA_STRUCTURE', 'datastruct', 'utf8_string'],
+ )); -}
+
static int any2obj_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
struct any2obj_ctx_st *ctx = vctx;
- const OSSL_PARAM *p;
+ struct any2obj_set_ctx_params_st p;
char *str;
- p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
+ if (ctx == NULL || !any2obj_set_ctx_params_decoder(params, &p))
+ return 0;
+
str = ctx->data_structure;
- if (p != NULL
- && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->data_structure)))
+ if (p.datastruct != NULL
+ && !OSSL_PARAM_get_utf8_string(p.datastruct, &str,
+ sizeof(ctx->data_structure)))
return 0;
return 1;
static const OSSL_PARAM *any2obj_settable_ctx_params(ossl_unused void *provctx)
{
- static const OSSL_PARAM settables[] = {
- OSSL_PARAM_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE, NULL, 0),
- OSSL_PARAM_END
- };
- return settables;
+ return any2obj_set_ctx_params_list;
}
static int any2obj_decode_final(void *vctx, int objtype, const char *input_type,