]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Move generic skeymgmt param decoder to .inc file
authorSimo Sorce <simo@redhat.com>
Fri, 10 Oct 2025 20:32:27 +0000 (16:32 -0400)
committerDmitry Belyavskiy <beldmit@gmail.com>
Mon, 20 Oct 2025 07:45:53 +0000 (09:45 +0200)
The Perl-generated code for the generic symmetric key import parameter decoder
is extracted from `generic.c.in` into a new `generic.inc.in` template.

The main `generic.c` file now includes the generated `generic.inc` file. This
change separates the auto-generated code from the handwritten C code,
improving modularity and readability.

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)

.gitignore
build.info
providers/implementations/skeymgmt/generic.c [moved from providers/implementations/skeymgmt/generic.c.in with 92% similarity]
providers/implementations/skeymgmt/generic.inc.in [new file with mode: 0644]

index 88cd92f9d0de8f21b05337d9cf769e5705f17850..f4d759b5d6fc3e701ce7b16e1e1caab5047bc247 100644 (file)
@@ -136,7 +136,7 @@ providers/implementations/signature/ml_dsa_sig.c
 providers/implementations/signature/rsa_sig.c
 providers/implementations/signature/slh_dsa_sig.c
 providers/implementations/signature/sm2_sig.c
-providers/implementations/skeymgmt/generic.c
+providers/implementations/skeymgmt/generic.inc
 providers/implementations/storemgmt/file_store_any2obj.c
 providers/implementations/storemgmt/file_store.c
 providers/implementations/storemgmt/winstore_store.c
@@ -155,6 +155,7 @@ providers/implementations/ciphers/cipher_chacha20_poly1305.c
 providers/implementations/ciphers/cipher_null.c
 providers/implementations/ciphers/cipher_rc4_hmac_md5.c
 providers/implementations/ciphers/cipher_sm2_xts.c
+providers/implementations/ciphers/cipher_sm4_xts.c
 providers/implementations/digests/blake2_prov.c
 providers/implementations/digests/digestcommon.c
 providers/implementations/digests/mdc2_prov.c
index d63a1d9e02889c7acee763719837575da4162f72..66898cb8a7efb5b832bca0892b46a9d27a28f482 100644 (file)
@@ -95,7 +95,7 @@ DEPEND[]=include/openssl/asn1.h \
          providers/implementations/signature/rsa_sig.c \
          providers/implementations/signature/slh_dsa_sig.c \
          providers/implementations/signature/sm2_sig.c \
-         providers/implementations/skeymgmt/generic.c \
+         providers/implementations/skeymgmt/generic.inc \
          providers/implementations/storemgmt/file_store_any2obj.c \
          providers/implementations/storemgmt/file_store.c \
          providers/implementations/storemgmt/winstore_store.c \
@@ -213,7 +213,7 @@ DEPEND[providers/implementations/asymciphers/rsa_enc.c \
        providers/implementations/signature/rsa_sig.c \
        providers/implementations/signature/slh_dsa_sig.c \
        providers/implementations/signature/sm2_sig.c \
-       providers/implementations/skeymgmt/generic.c \
+       providers/implementations/skeymgmt/generic.inc \
        providers/implementations/storemgmt/file_store_any2obj.c \
        providers/implementations/storemgmt/file_store.c \
        providers/implementations/storemgmt/winstore_store.c \
@@ -345,8 +345,8 @@ GENERATE[providers/implementations/signature/slh_dsa_sig.c]=\
     providers/implementations/signature/slh_dsa_sig.c.in
 GENERATE[providers/implementations/signature/sm2_sig.c]=\
     providers/implementations/signature/sm2_sig.c.in
-GENERATE[providers/implementations/skeymgmt/generic.c]=\
-    providers/implementations/skeymgmt/generic.c.in
+GENERATE[providers/implementations/skeymgmt/generic.inc]=\
+    providers/implementations/skeymgmt/generic.inc.in
 GENERATE[providers/implementations/storemgmt/file_store_any2obj.c]=\
     providers/implementations/storemgmt/file_store_any2obj.c.in
 GENERATE[providers/implementations/storemgmt/file_store.c]=\
similarity index 92%
rename from providers/implementations/skeymgmt/generic.c.in
rename to providers/implementations/skeymgmt/generic.c
index d32624b9308ce8f564edd969e8bbcbe246a52915..92b8532adfbeafa5bed86a2128c022c0e1731d04 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/core_dispatch.h>
@@ -22,6 +19,8 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/implementations.h"
 #include "prov/skeymgmt_lcl.h"
 
+#include "providers/implementations/skeymgmt/generic.inc"
+
 void generic_free(void *keydata)
 {
     PROV_SKEY *generic = keydata;
@@ -33,10 +32,6 @@ void generic_free(void *keydata)
     OPENSSL_free(generic);
 }
 
-{- produce_param_decoder('generic_skey_import',
-                         (['OSSL_SKEY_PARAM_RAW_BYTES',  'raw_bytes',    'octet_string'],
-                         )); -}
-
 void *generic_import(void *provctx, int selection, const OSSL_PARAM params[])
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
diff --git a/providers/implementations/skeymgmt/generic.inc.in b/providers/implementations/skeymgmt/generic.inc.in
new file mode 100644 (file)
index 0000000..6f30d5b
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * 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('generic_skey_import',
+                         (['OSSL_SKEY_PARAM_RAW_BYTES',  'raw_bytes',    'octet_string'],
+                         )); -}