]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
encode_decode: Use include file for generated code
authorSimo Sorce <simo@redhat.com>
Thu, 16 Oct 2025 19:48:07 +0000 (15:48 -0400)
committerDmitry Belyavskiy <beldmit@gmail.com>
Mon, 20 Oct 2025 07:45:53 +0000 (09:45 +0200)
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28838)

16 files changed:
.gitignore
build.info
providers/implementations/encode_decode/decode_der2key.c [moved from providers/implementations/encode_decode/decode_der2key.c.in with 99% similarity]
providers/implementations/encode_decode/decode_der2key.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/decode_epki2pki.c [moved from providers/implementations/encode_decode/decode_epki2pki.c.in with 96% similarity]
providers/implementations/encode_decode/decode_epki2pki.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/decode_pem2der.c [moved from providers/implementations/encode_decode/decode_pem2der.c.in with 96% similarity]
providers/implementations/encode_decode/decode_pem2der.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/decode_pvk2key.c [moved from providers/implementations/encode_decode/decode_pvk2key.c.in with 97% similarity]
providers/implementations/encode_decode/decode_pvk2key.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/decode_spki2typespki.c [moved from providers/implementations/encode_decode/decode_spki2typespki.c.in with 95% similarity]
providers/implementations/encode_decode/decode_spki2typespki.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/encode_key2any.c [moved from providers/implementations/encode_decode/encode_key2any.c.in with 99% similarity]
providers/implementations/encode_decode/encode_key2any.inc.in [new file with mode: 0644]
providers/implementations/encode_decode/encode_key2ms.c [moved from providers/implementations/encode_decode/encode_key2ms.c.in with 97% similarity]
providers/implementations/encode_decode/encode_key2ms.inc.in [new file with mode: 0644]

index b84c5403ba4302d1bc73d5a84a91ec46220e258e..bdfca92a2381980c6f00d62a05e0f54ecc95d2c1 100644 (file)
@@ -91,13 +91,13 @@ providers/implementations/asymciphers/sm2_enc.inc
 providers/implementations/exchange/dh_exch.c
 providers/implementations/exchange/ecdh_exch.c
 providers/implementations/exchange/ecx_exch.c
-providers/implementations/encode_decode/decode_der2key.c
-providers/implementations/encode_decode/decode_epki2pki.c
-providers/implementations/encode_decode/decode_pem2der.c
-providers/implementations/encode_decode/decode_pvk2key.c
-providers/implementations/encode_decode/decode_spki2typespki.c
-providers/implementations/encode_decode/encode_key2any.c
-providers/implementations/encode_decode/encode_key2ms.c
+providers/implementations/encode_decode/decode_der2key.inc
+providers/implementations/encode_decode/decode_epki2pki.inc
+providers/implementations/encode_decode/decode_pem2der.inc
+providers/implementations/encode_decode/decode_pvk2key.inc
+providers/implementations/encode_decode/decode_spki2typespki.inc
+providers/implementations/encode_decode/encode_key2any.inc
+providers/implementations/encode_decode/encode_key2ms.inc
 providers/implementations/kdfs/argon2.c
 providers/implementations/kdfs/hkdf.c
 providers/implementations/kdfs/hmacdrbg_kdf.c
index 3109435db0efc9a3b10bc970e277a9aa64a4c7eb..6f28022673d8ded057da50704621c91c8f847865 100644 (file)
@@ -53,13 +53,13 @@ DEPEND[]=include/openssl/asn1.h \
          providers/implementations/exchange/dh_exch.c \
          providers/implementations/exchange/ecdh_exch.c \
          providers/implementations/exchange/ecx_exch.c \
-         providers/implementations/encode_decode/decode_der2key.c \
-         providers/implementations/encode_decode/decode_epki2pki.c \
-         providers/implementations/encode_decode/decode_pem2der.c \
-         providers/implementations/encode_decode/decode_pvk2key.c \
-         providers/implementations/encode_decode/decode_spki2typespki.c \
-         providers/implementations/encode_decode/encode_key2any.c \
-         providers/implementations/encode_decode/encode_key2ms.c \
+         providers/implementations/encode_decode/decode_der2key.inc \
+         providers/implementations/encode_decode/decode_epki2pki.inc \
+         providers/implementations/encode_decode/decode_pem2der.inc \
+         providers/implementations/encode_decode/decode_pvk2key.inc \
+         providers/implementations/encode_decode/decode_spki2typespki.inc \
+         providers/implementations/encode_decode/encode_key2any.inc \
+         providers/implementations/encode_decode/encode_key2ms.inc \
          providers/implementations/kdfs/argon2.c \
          providers/implementations/kdfs/hkdf.c \
          providers/implementations/kdfs/hmacdrbg_kdf.c \
@@ -171,13 +171,13 @@ DEPEND[providers/implementations/asymciphers/rsa_enc.inc \
        providers/implementations/exchange/dh_exch.c \
        providers/implementations/exchange/ecdh_exch.c \
        providers/implementations/exchange/ecx_exch.c \
-       providers/implementations/encode_decode/decode_der2key.c \
-       providers/implementations/encode_decode/decode_epki2pki.c \
-       providers/implementations/encode_decode/decode_pem2der.c \
-       providers/implementations/encode_decode/decode_pvk2key.c \
-       providers/implementations/encode_decode/decode_spki2typespki.c \
-       providers/implementations/encode_decode/encode_key2any.c \
-       providers/implementations/encode_decode/encode_key2ms.c \
+       providers/implementations/encode_decode/decode_der2key.inc \
+       providers/implementations/encode_decode/decode_epki2pki.inc \
+       providers/implementations/encode_decode/decode_pem2der.inc \
+       providers/implementations/encode_decode/decode_pvk2key.inc \
+       providers/implementations/encode_decode/decode_spki2typespki.inc \
+       providers/implementations/encode_decode/encode_key2any.inc \
+       providers/implementations/encode_decode/encode_key2ms.inc \
        providers/implementations/kdfs/argon2.c \
        providers/implementations/kdfs/hkdf.c \
        providers/implementations/kdfs/hmacdrbg_kdf.c \
@@ -261,20 +261,20 @@ GENERATE[providers/implementations/exchange/ecdh_exch.c]=\
     providers/implementations/exchange/ecdh_exch.c.in
 GENERATE[providers/implementations/exchange/ecx_exch.c]=\
     providers/implementations/exchange/ecx_exch.c.in
-GENERATE[providers/implementations/encode_decode/decode_der2key.c]=\
-    providers/implementations/encode_decode/decode_der2key.c.in
-GENERATE[providers/implementations/encode_decode/decode_epki2pki.c]=\
-    providers/implementations/encode_decode/decode_epki2pki.c.in
-GENERATE[providers/implementations/encode_decode/decode_pem2der.c]=\
-    providers/implementations/encode_decode/decode_pem2der.c.in
-GENERATE[providers/implementations/encode_decode/decode_pvk2key.c]=\
-    providers/implementations/encode_decode/decode_pvk2key.c.in
-GENERATE[providers/implementations/encode_decode/decode_spki2typespki.c]=\
-    providers/implementations/encode_decode/decode_spki2typespki.c.in
-GENERATE[providers/implementations/encode_decode/encode_key2any.c]=\
-    providers/implementations/encode_decode/encode_key2any.c.in
-GENERATE[providers/implementations/encode_decode/encode_key2ms.c]=\
-    providers/implementations/encode_decode/encode_key2ms.c.in
+GENERATE[providers/implementations/encode_decode/decode_der2key.inc]=\
+    providers/implementations/encode_decode/decode_der2key.inc.in
+GENERATE[providers/implementations/encode_decode/decode_epki2pki.inc]=\
+    providers/implementations/encode_decode/decode_epki2pki.inc.in
+GENERATE[providers/implementations/encode_decode/decode_pem2der.inc]=\
+    providers/implementations/encode_decode/decode_pem2der.inc.in
+GENERATE[providers/implementations/encode_decode/decode_pvk2key.inc]=\
+    providers/implementations/encode_decode/decode_pvk2key.inc.in
+GENERATE[providers/implementations/encode_decode/decode_spki2typespki.inc]=\
+    providers/implementations/encode_decode/decode_spki2typespki.inc.in
+GENERATE[providers/implementations/encode_decode/encode_key2any.inc]=\
+    providers/implementations/encode_decode/encode_key2any.inc.in
+GENERATE[providers/implementations/encode_decode/encode_key2ms.inc]=\
+    providers/implementations/encode_decode/encode_key2ms.inc.in
 GENERATE[providers/implementations/kdfs/argon2.c]=\
     providers/implementations/kdfs/argon2.c.in
 GENERATE[providers/implementations/kdfs/hkdf.c]=\
similarity index 99%
rename from providers/implementations/encode_decode/decode_der2key.c.in
rename to providers/implementations/encode_decode/decode_der2key.c
index 22e7ad58030e10659c341d9a36e2e03ee1cc5f82..d39301a0f79ba00ae5c952c2659160fae5d67e1c 100644 (file)
@@ -6,9 +6,6 @@
  * 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
@@ -47,6 +44,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "internal/nelem.h"
 #include "prov/ml_dsa_codecs.h"
 #include "prov/ml_kem_codecs.h"
+#include "providers/implementations/encode_decode/decode_der2key.inc"
 
 #ifndef OPENSSL_NO_SLH_DSA
 typedef struct {
@@ -172,10 +170,6 @@ der2key_newctx(void *provctx, const struct keytype_desc_st *desc)
     return ctx;
 }
 
-{- produce_param_decoder('der2key_set_ctx_params',
-                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *der2key_settable_ctx_params(ossl_unused void *provctx)
 {
     return der2key_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/decode_der2key.inc.in b/providers/implementations/encode_decode/decode_der2key.inc.in
new file mode 100644 (file)
index 0000000..96b1955
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('der2key_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
similarity index 96%
rename from providers/implementations/encode_decode/decode_epki2pki.c.in
rename to providers/implementations/encode_decode/decode_epki2pki.c
index 3c3b794d865ce3501ba9d6cbc6f9a8e31bc9703f..1c98377d3c13125bea95099af66f54c5fc8f384e 100644 (file)
@@ -6,9 +6,6 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
 
 #include <openssl/core.h>
 #include <openssl/core_dispatch.h>
@@ -27,6 +24,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/decoders.h"
 #include "prov/implementations.h"
 #include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_epki2pki.inc"
 
 static OSSL_FUNC_decoder_newctx_fn epki2pki_newctx;
 static OSSL_FUNC_decoder_freectx_fn epki2pki_freectx;
@@ -58,10 +56,6 @@ static void epki2pki_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('epki2pki_set_ctx_params',
-                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *epki2pki_settable_ctx_params(ossl_unused void *provctx)
 {
     return epki2pki_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/decode_epki2pki.inc.in b/providers/implementations/encode_decode/decode_epki2pki.inc.in
new file mode 100644 (file)
index 0000000..064c616
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('epki2pki_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
similarity index 96%
rename from providers/implementations/encode_decode/decode_pem2der.c.in
rename to providers/implementations/encode_decode/decode_pem2der.c
index 7512da13092f1d38d3da45f1344092b510438780..5eba9fff391bdc7dd058e831c2b2d05e1e398b6d 100644 (file)
@@ -6,9 +6,6 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
 
 /*
  * RSA low level APIs are deprecated for public use, but still ok for
@@ -33,6 +30,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/decoders.h"
 #include "prov/implementations.h"
 #include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_pem2der.inc"
 
 static int read_pem(PROV_CTX *provctx, OSSL_CORE_BIO *cin,
                     char **pem_name, char **pem_header,
@@ -78,11 +76,6 @@ static void pem2der_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('pem2der_set_ctx_params',
-                         (['OSSL_DECODER_PARAM_PROPERTIES',    'propq', 'utf8_string'],
-                          ['OSSL_OBJECT_PARAM_DATA_STRUCTURE', 'ds',    'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *pem2der_settable_ctx_params(ossl_unused void *provctx)
 {
     return pem2der_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/decode_pem2der.inc.in b/providers/implementations/encode_decode/decode_pem2der.inc.in
new file mode 100644 (file)
index 0000000..20d7e00
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pem2der_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES',    'propq', 'utf8_string'],
+                          ['OSSL_OBJECT_PARAM_DATA_STRUCTURE', 'ds',    'utf8_string'],
+                         )); -}
similarity index 97%
rename from providers/implementations/encode_decode/decode_pvk2key.c.in
rename to providers/implementations/encode_decode/decode_pvk2key.c
index 8dfd57bb0d859ade61fb042619b6223c6d45097f..b137288a52125753aff337992e68a527459d479c 100644 (file)
@@ -6,9 +6,6 @@
  * 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
@@ -35,6 +32,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/bio.h"
 #include "prov/implementations.h"
 #include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_pvk2key.inc"
 
 struct pvk2key_ctx_st;            /* Forward declaration */
 typedef int check_key_fn(void *, struct pvk2key_ctx_st *ctx);
@@ -88,10 +86,6 @@ static void pvk2key_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('pvk2key_set_ctx_params',
-                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *pvk2key_settable_ctx_params(ossl_unused void *provctx)
 {
     return pvk2key_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/decode_pvk2key.inc.in b/providers/implementations/encode_decode/decode_pvk2key.inc.in
new file mode 100644 (file)
index 0000000..b53c643
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pvk2key_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
similarity index 95%
rename from providers/implementations/encode_decode/decode_spki2typespki.c.in
rename to providers/implementations/encode_decode/decode_spki2typespki.c
index 210f2f5efde869aa591911bbee73e4b071a046bf..aec17455d8126202783472bd7166eb8c10cfb4b6 100644 (file)
@@ -6,9 +6,6 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
 
 #include <string.h>
 #include <openssl/asn1t.h>
@@ -25,6 +22,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/decoders.h"
 #include "prov/implementations.h"
 #include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_spki2typespki.inc"
 
 static OSSL_FUNC_decoder_newctx_fn spki2typespki_newctx;
 static OSSL_FUNC_decoder_freectx_fn spki2typespki_freectx;
@@ -57,10 +55,6 @@ static void spki2typespki_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('spki2typespki_set_ctx_params',
-                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *spki2typespki_settable_ctx_params(ossl_unused void *provctx)
 {
     return spki2typespki_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/decode_spki2typespki.inc.in b/providers/implementations/encode_decode/decode_spki2typespki.inc.in
new file mode 100644 (file)
index 0000000..69f7124
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('spki2typespki_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
similarity index 99%
rename from providers/implementations/encode_decode/encode_key2any.c.in
rename to providers/implementations/encode_decode/encode_key2any.c
index d293f2256eb4cee09ba708dd1390f55755fb516e..c9945a548290f663defc820c8e1038735b00debb 100644 (file)
@@ -6,9 +6,6 @@
  * 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.
@@ -44,6 +41,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/endecoder_local.h"
 #include "prov/ml_dsa_codecs.h"
 #include "prov/ml_kem_codecs.h"
+#include "providers/implementations/encode_decode/encode_key2any.inc"
 
 #if defined(OPENSSL_NO_DH) && defined(OPENSSL_NO_DSA) && defined(OPENSSL_NO_EC)
 # define OPENSSL_NO_KEYPARAMS
@@ -72,7 +70,6 @@ typedef int key_to_der_fn(BIO *out, const void *key,
                           OSSL_i2d_of_void_ctx *k2d, KEY2ANY_CTX *ctx);
 typedef int write_bio_of_void_fn(BIO *bp, const void *x);
 
-
 /* Free the blob allocated during key_to_paramstring_fn */
 static void free_asn1_data(int type, void *data)
 {
@@ -162,7 +159,6 @@ static X509_PUBKEY *key_to_pubkey(const void *key, int key_nid,
     /* The final X509_PUBKEY */
     X509_PUBKEY *xpk = NULL;
 
-
     if ((xpk = X509_PUBKEY_new()) == NULL
         || (derlen = k2d(key, &der, (void *)ctx)) <= 0
         || !X509_PUBKEY_set0_param(xpk, OBJ_nid2obj(key_nid),
@@ -1137,12 +1133,6 @@ static void key2any_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('key2any_set_ctx_params',
-                         (['OSSL_ENCODER_PARAM_CIPHER',          'cipher', 'utf8_string'],
-                          ['OSSL_ENCODER_PARAM_PROPERTIES',      'propq',  'utf8_string'],
-                          ['OSSL_ENCODER_PARAM_SAVE_PARAMETERS', 'svprm',  'int'],
-                         )); -}
-
 static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx)
 {
     return key2any_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/encode_key2any.inc.in b/providers/implementations/encode_decode/encode_key2any.inc.in
new file mode 100644 (file)
index 0000000..6fe9688
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('key2any_set_ctx_params',
+                         (['OSSL_ENCODER_PARAM_CIPHER',          'cipher', 'utf8_string'],
+                          ['OSSL_ENCODER_PARAM_PROPERTIES',      'propq',  'utf8_string'],
+                          ['OSSL_ENCODER_PARAM_SAVE_PARAMETERS', 'svprm',  'int'],
+                         )); -}
similarity index 97%
rename from providers/implementations/encode_decode/encode_key2ms.c.in
rename to providers/implementations/encode_decode/encode_key2ms.c
index ec3f3050a799f8b28a20156bf6bd5f089ea1ab1c..d32dfaebf13a1fb0a1c39ba4ed2bd30590227d11 100644 (file)
@@ -6,9 +6,6 @@
  * 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.
@@ -31,6 +28,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/bio.h"
 #include "prov/provider_ctx.h"
 #include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/encode_key2ms.inc"
 
 struct key2ms_ctx_st {
     PROV_CTX *provctx;
@@ -93,10 +91,6 @@ static void key2ms_freectx(void *vctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('key2pvk_set_ctx_params',
-                         (['OSSL_ENCODER_PARAM_ENCRYPT_LEVEL', 'enclvl', 'int'],
-                         )); -}
-
 static const OSSL_PARAM *key2pvk_settable_ctx_params(ossl_unused void *provctx)
 {
     return key2pvk_set_ctx_params_list;
diff --git a/providers/implementations/encode_decode/encode_key2ms.inc.in b/providers/implementations/encode_decode/encode_key2ms.inc.in
new file mode 100644 (file)
index 0000000..f926fa9
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 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
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('key2pvk_set_ctx_params',
+                         (['OSSL_ENCODER_PARAM_ENCRYPT_LEVEL', 'enclvl', 'int'],
+                         )); -}