]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
cipher: declare common OSSL_PARAM structures and helper functions
authorPauli <ppzgs1@gmail.com>
Thu, 19 Jun 2025 01:40:16 +0000 (11:40 +1000)
committerPauli <ppzgs1@gmail.com>
Wed, 25 Jun 2025 07:22:07 +0000 (17:22 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27859)

providers/implementations/digests/digestcommon.c.in [moved from providers/implementations/digests/digestcommon.c with 100% similarity]
providers/implementations/include/prov/ciphercommon.h

index 46efdc80033f527e934b88d03a04407db841a8fe..b5f0b92c432a0eb36646572a23a9566b100fd273 100644 (file)
@@ -362,6 +362,30 @@ const OSSL_PARAM * name##_settable_ctx_params(ossl_unused void *cctx,          \
     return name##_known_settable_ctx_params;                                   \
 }
 
+struct ossl_cipher_get_ctx_param_list_st {
+    OSSL_PARAM *keylen;         /* all ciphers */
+    OSSL_PARAM *ivlen;          /* all ciphers */
+    OSSL_PARAM *pad;            /* all ciphers */
+    OSSL_PARAM *num;            /* all ciphers */
+    OSSL_PARAM *iv;             /* all ciphers */
+    OSSL_PARAM *updiv;          /* all ciphers */
+    OSSL_PARAM *tlsmac;         /* generic cipher */
+};
+
+struct ossl_cipher_set_ctx_param_list_st {
+    OSSL_PARAM *pad;            /* all ciphers */
+    OSSL_PARAM *num;            /* all ciphers */
+    OSSL_PARAM *bits;           /* generic cipher */
+    OSSL_PARAM *tlsvers;        /* generic cipher */
+    OSSL_PARAM *tlsmacsize;     /* generic cipher */
+    OSSL_PARAM *keylen;         /* variable key length ciphers */
+};
+
+int ossl_cipher_common_get_ctx_params
+    (PROV_CIPHER_CTX *ctx, const struct ossl_cipher_get_ctx_param_list_st *p);
+int ossl_cipher_common_set_ctx_params
+    (PROV_CIPHER_CTX *ctx, const struct ossl_cipher_set_ctx_param_list_st *p);
+
 int ossl_cipher_generic_initiv(PROV_CIPHER_CTX *ctx, const unsigned char *iv,
                                size_t ivlen);