]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
storemgmt: Use include file for generated code
authorSimo Sorce <simo@redhat.com>
Mon, 13 Oct 2025 21:48:54 +0000 (17: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)

.gitignore
build.info
providers/implementations/storemgmt/file_store.c [moved from providers/implementations/storemgmt/file_store.c.in with 98% similarity]
providers/implementations/storemgmt/file_store.inc.in [new file with mode: 0644]
providers/implementations/storemgmt/file_store_any2obj.c [moved from providers/implementations/storemgmt/file_store_any2obj.c.in with 97% similarity]
providers/implementations/storemgmt/file_store_any2obj.inc.in [new file with mode: 0644]
providers/implementations/storemgmt/winstore_store.c [moved from providers/implementations/storemgmt/winstore_store.c.in with 96% similarity]
providers/implementations/storemgmt/winstore_store.inc.in [new file with mode: 0644]

index f4d759b5d6fc3e701ce7b16e1e1caab5047bc247..9c29f7ef2ad09756c986a459390e08e3d3dab03f 100644 (file)
@@ -137,9 +137,9 @@ providers/implementations/signature/rsa_sig.c
 providers/implementations/signature/slh_dsa_sig.c
 providers/implementations/signature/sm2_sig.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
+providers/implementations/storemgmt/file_store_any2obj.inc
+providers/implementations/storemgmt/file_store.inc
+providers/implementations/storemgmt/winstore_store.inc
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
 providers/implementations/ciphers/cipher_aes_gcm_siv.c
index 66898cb8a7efb5b832bca0892b46a9d27a28f482..27f4866a4e5746750a6259710acbbe8603d7e7ec 100644 (file)
@@ -96,9 +96,9 @@ DEPEND[]=include/openssl/asn1.h \
          providers/implementations/signature/slh_dsa_sig.c \
          providers/implementations/signature/sm2_sig.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 \
+         providers/implementations/storemgmt/file_store_any2obj.inc \
+         providers/implementations/storemgmt/file_store.inc \
+         providers/implementations/storemgmt/winstore_store.inc \
          providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c \
          providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c \
          providers/implementations/ciphers/cipher_aes_gcm_siv.c \
@@ -214,9 +214,9 @@ DEPEND[providers/implementations/asymciphers/rsa_enc.c \
        providers/implementations/signature/slh_dsa_sig.c \
        providers/implementations/signature/sm2_sig.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 \
+       providers/implementations/storemgmt/file_store_any2obj.inc \
+       providers/implementations/storemgmt/file_store.inc \
+       providers/implementations/storemgmt/winstore_store.inc \
        providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c \
        providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c \
        providers/implementations/ciphers/cipher_aes_gcm_siv.c \
@@ -347,12 +347,12 @@ GENERATE[providers/implementations/signature/sm2_sig.c]=\
     providers/implementations/signature/sm2_sig.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]=\
-    providers/implementations/storemgmt/file_store.c.in
-GENERATE[providers/implementations/storemgmt/winstore_store.c]=\
-    providers/implementations/storemgmt/winstore_store.c.in
+GENERATE[providers/implementations/storemgmt/file_store_any2obj.inc]=\
+    providers/implementations/storemgmt/file_store_any2obj.inc.in
+GENERATE[providers/implementations/storemgmt/file_store.inc]=\
+    providers/implementations/storemgmt/file_store.inc.in
+GENERATE[providers/implementations/storemgmt/winstore_store.inc]=\
+    providers/implementations/storemgmt/winstore_store.inc.in
 GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c]=\
     providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c.in
 GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c]=\
similarity index 98%
rename from providers/implementations/storemgmt/file_store.c.in
rename to providers/implementations/storemgmt/file_store.c
index c1007af34ccc2eb8b455a332c4ba972dd64ff398..527c5f2b7e4e017514f4ec54ef5add2feddfadc5 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);
--}
 
 /* This file has quite some overlap with engines/e_loader_attic.c */
 
@@ -35,6 +32,8 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "prov/providercommon.h"
 #include "prov/file_store_local.h"
 
+#include "providers/implementations/storemgmt/file_store.inc"
+
 DEFINE_STACK_OF(OSSL_STORE_INFO)
 
 #ifdef _WIN32
@@ -293,13 +292,6 @@ void *file_attach(void *provctx, OSSL_CORE_BIO *cin)
  *  ------------------
  */
 
-{- produce_param_decoder('file_set_ctx_params',
-                         (['OSSL_STORE_PARAM_PROPERTIES', 'propq',  'utf8_string'],
-                          ['OSSL_STORE_PARAM_EXPECT',     'expect', 'int'],
-                          ['OSSL_STORE_PARAM_SUBJECT',    'sub',    'octet_string'],
-                          ['OSSL_STORE_PARAM_INPUT_TYPE', 'type',   'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *file_settable_ctx_params(void *provctx)
 {
     return file_set_ctx_params_list;
diff --git a/providers/implementations/storemgmt/file_store.inc.in b/providers/implementations/storemgmt/file_store.inc.in
new file mode 100644 (file)
index 0000000..a108df4
--- /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('file_set_ctx_params',
+                         (['OSSL_STORE_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                          ['OSSL_STORE_PARAM_EXPECT',     'expect', 'int'],
+                          ['OSSL_STORE_PARAM_SUBJECT',    'sub',    'octet_string'],
+                          ['OSSL_STORE_PARAM_INPUT_TYPE', 'type',   'utf8_string'],
+                         )); -}
similarity index 97%
rename from providers/implementations/storemgmt/file_store_any2obj.c.in
rename to providers/implementations/storemgmt/file_store_any2obj.c
index c21c3ad3723a7811b5e72d0f7558d8bbc3917bbb..cf61b00dbf3ba157269226bba8a47b485523d298 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);
--}
 
 /*
  * This is a decoder that's completely internal to the 'file:' store
@@ -41,6 +38,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 #include "crypto/pem.h"          /* For internal PVK and "blob" headers */
 #include "prov/bio.h"
 #include "prov/file_store_local.h"
+#include "providers/implementations/storemgmt/file_store_any2obj.inc"
 
 /*
  * newctx and freectx are not strictly necessary.  However, the method creator,
@@ -70,10 +68,6 @@ static void any2obj_freectx(void *ctx)
     OPENSSL_free(ctx);
 }
 
-{- produce_param_decoder('any2obj_set_ctx_params',
-                         (['OSSL_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;
@@ -190,7 +184,6 @@ static int msblob2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     if (!ok)
         goto next;
 
-
     ERR_set_mark();
     p = (unsigned char *)&mem->data[0];
     ok = ossl_do_blob_header(&p, 16, &magic, &bitlen, &isdss, &ispub) > 0;
@@ -259,7 +252,6 @@ static int pvk2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     if (!ok)
         goto next;
 
-
     ERR_set_mark();
     p = (unsigned char *)&mem->data[0];
     ok = ossl_do_PVK_header(&p, 24, 0, &isdss, &saltlen, &keylen) > 0;
diff --git a/providers/implementations/storemgmt/file_store_any2obj.inc.in b/providers/implementations/storemgmt/file_store_any2obj.inc.in
new file mode 100644 (file)
index 0000000..9e3f6f6
--- /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('any2obj_set_ctx_params',
+                         (['OSSL_OBJECT_PARAM_DATA_STRUCTURE', 'datastruct', 'utf8_string'],
+                         )); -}
similarity index 96%
rename from providers/implementations/storemgmt/winstore_store.c.in
rename to providers/implementations/storemgmt/winstore_store.c
index 5539e1e8467571f1b62b94ce530469f7b9634d7b..42a84107adf61a55a854c6630cc2fcecb4d56a68 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/store.h>
 #include <openssl/core_dispatch.h>
@@ -32,6 +29,7 @@ use OpenSSL::paramnames qw(produce_param_decoder);
 # include <windows.h>
 #endif
 #include <wincrypt.h>
+#include "providers/implementations/storemgmt/winstore_store.inc"
 
 enum {
     STATE_IDLE,
@@ -108,11 +106,6 @@ static void *winstore_attach(void *provctx, OSSL_CORE_BIO *cin)
     return NULL; /* not supported */
 }
 
-{- produce_param_decoder('winstore_set_ctx_params',
-                         (['OSSL_STORE_PARAM_SUBJECT',    'sub',   'octet_string'],
-                          ['OSSL_STORE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
-                         )); -}
-
 static const OSSL_PARAM *winstore_settable_ctx_params(void *loaderctx, const OSSL_PARAM params[])
 {
     return winstore_set_ctx_params_list;
diff --git a/providers/implementations/storemgmt/winstore_store.inc.in b/providers/implementations/storemgmt/winstore_store.inc.in
new file mode 100644 (file)
index 0000000..f8c7c46
--- /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('winstore_set_ctx_params',
+                         (['OSSL_STORE_PARAM_SUBJECT',    'sub',   'octet_string'],
+                          ['OSSL_STORE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}