aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/encode_decode/encoder_lib.c1
-rw-r--r--test/endecode_api_test.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/crypto/encode_decode/encoder_lib.c b/crypto/encode_decode/encoder_lib.c
index 375c98188cd..98b9255b828 100644
--- a/crypto/encode_decode/encoder_lib.c
+++ b/crypto/encode_decode/encoder_lib.c
@@ -583,6 +583,7 @@ static int encoder_process(struct encoder_process_data_st *data)
data->prev_encoder_inst = new_data.prev_encoder_inst;
data->running_output = new_data.running_output;
data->running_output_length = new_data.running_output_length;
+ data->data_type = new_data.data_type;
/*
* ok == -1 means that the recursion call above gave no further
diff --git a/test/endecode_api_test.c b/test/endecode_api_test.c
index 768bf215c04..44d45fa19d7 100644
--- a/test/endecode_api_test.c
+++ b/test/endecode_api_test.c
@@ -119,6 +119,13 @@ static int inter2pem_encode(void *vctx, OSSL_CORE_BIO *cout,
|| memcmp(p->data, STRUCTURE_NAME, p->data_size) != 0)
return 0;
+ /* Likewise the data type, naming the encoder that produced the data */
+ p = OSSL_PARAM_locate_const(obj_abstract, OSSL_OBJECT_PARAM_DATA_TYPE);
+ if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING
+ || p->data == NULL || p->data_size != strlen(KEY_NAME)
+ || memcmp(p->data, KEY_NAME, p->data_size) != 0)
+ return 0;
+
p = OSSL_PARAM_locate_const(obj_abstract, OSSL_OBJECT_PARAM_DATA);
if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
return 0;