Rename OSSL_SERIALIZER / OSSL_DESERIALIZER to OSSL_ENCODE / OSSL_DECODE
[openssl.git] / providers / implementations / encode_decode / encoder_dsa_priv.c
similarity index 74%
rename from providers/implementations/serializers/serializer_dsa_priv.c
rename to providers/implementations/encode_decode/encoder_dsa_priv.c
index 0db3ef49e44f2240f7bed7040cfd384f66aebe1e..c37c9f9f3c82ebf3f7feaa8637337e4b1f714b91 100644 (file)
 #include "prov/bio.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
-#include "serializer_local.h"
-
-static OSSL_FUNC_serializer_newctx_fn dsa_priv_newctx;
-static OSSL_FUNC_serializer_freectx_fn dsa_priv_freectx;
-static OSSL_FUNC_serializer_set_ctx_params_fn dsa_priv_set_ctx_params;
-static OSSL_FUNC_serializer_settable_ctx_params_fn dsa_priv_settable_ctx_params;
-static OSSL_FUNC_serializer_serialize_data_fn dsa_priv_der_data;
-static OSSL_FUNC_serializer_serialize_object_fn dsa_priv_der;
-static OSSL_FUNC_serializer_serialize_data_fn dsa_pem_priv_data;
-static OSSL_FUNC_serializer_serialize_object_fn dsa_pem_priv;
-
-static OSSL_FUNC_serializer_newctx_fn dsa_print_newctx;
-static OSSL_FUNC_serializer_freectx_fn dsa_print_freectx;
-static OSSL_FUNC_serializer_serialize_data_fn dsa_priv_print_data;
-static OSSL_FUNC_serializer_serialize_object_fn dsa_priv_print;
-
- /*
- * Context used for private key serialization.
+#include "encoder_local.h"
+
+static OSSL_FUNC_encoder_newctx_fn dsa_priv_newctx;
+static OSSL_FUNC_encoder_freectx_fn dsa_priv_freectx;
+static OSSL_FUNC_encoder_set_ctx_params_fn dsa_priv_set_ctx_params;
+static OSSL_FUNC_encoder_settable_ctx_params_fn dsa_priv_settable_ctx_params;
+static OSSL_FUNC_encoder_encode_data_fn dsa_priv_der_data;
+static OSSL_FUNC_encoder_encode_object_fn dsa_priv_der;
+static OSSL_FUNC_encoder_encode_data_fn dsa_pem_priv_data;
+static OSSL_FUNC_encoder_encode_object_fn dsa_pem_priv;
+
+static OSSL_FUNC_encoder_newctx_fn dsa_print_newctx;
+static OSSL_FUNC_encoder_freectx_fn dsa_print_freectx;
+static OSSL_FUNC_encoder_encode_data_fn dsa_priv_print_data;
+static OSSL_FUNC_encoder_encode_object_fn dsa_priv_print;
+
+/*
+ * Context used for private key encoding.
  */
 struct dsa_priv_ctx_st {
     void *provctx;
@@ -74,8 +74,8 @@ static void dsa_priv_freectx(void *vctx)
 static const OSSL_PARAM *dsa_priv_settable_ctx_params(ossl_unused void *provctx)
 {
     static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_SERIALIZER_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_SERIALIZER_PARAM_PASS, NULL, 0),
+        OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0),
+        OSSL_PARAM_octet_string(OSSL_ENCODER_PARAM_PASS, NULL, 0),
         OSSL_PARAM_END,
     };
 
@@ -87,10 +87,10 @@ static int dsa_priv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     struct dsa_priv_ctx_st *ctx = vctx;
     const OSSL_PARAM *p;
 
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_CIPHER))
+    if ((p = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER))
         != NULL) {
         const OSSL_PARAM *propsp =
-            OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_PROPERTIES);
+            OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES);
         const char *props = NULL;
 
         if (p->data_type != OSSL_PARAM_UTF8_STRING)
@@ -106,7 +106,7 @@ static int dsa_priv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
                 == NULL))
             return 0;
     }
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_PASS))
+    if ((p = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PASS))
         != NULL) {
         OPENSSL_free(ctx->sc.cipher_pass);
         ctx->sc.cipher_pass = NULL;
@@ -256,35 +256,35 @@ static int dsa_priv_print(void *ctx, void *dsa, OSSL_CORE_BIO *cout,
     return ret;
 }
 
-const OSSL_DISPATCH dsa_priv_der_serializer_functions[] = {
-    { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))dsa_priv_newctx },
-    { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))dsa_priv_freectx },
-    { OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS,
+const OSSL_DISPATCH dsa_priv_der_encoder_functions[] = {
+    { OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))dsa_priv_newctx },
+    { OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))dsa_priv_freectx },
+    { OSSL_FUNC_ENCODER_SET_CTX_PARAMS,
       (void (*)(void))dsa_priv_set_ctx_params },
-    { OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS,
+    { OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS,
       (void (*)(void))dsa_priv_settable_ctx_params },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))dsa_priv_der_data },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))dsa_priv_der },
+    { OSSL_FUNC_ENCODER_ENCODE_DATA, (void (*)(void))dsa_priv_der_data },
+    { OSSL_FUNC_ENCODER_ENCODE_OBJECT, (void (*)(void))dsa_priv_der },
     { 0, NULL }
 };
 
-const OSSL_DISPATCH dsa_priv_pem_serializer_functions[] = {
-    { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))dsa_priv_newctx },
-    { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))dsa_priv_freectx },
-    { OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS,
+const OSSL_DISPATCH dsa_priv_pem_encoder_functions[] = {
+    { OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))dsa_priv_newctx },
+    { OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))dsa_priv_freectx },
+    { OSSL_FUNC_ENCODER_SET_CTX_PARAMS,
       (void (*)(void))dsa_priv_set_ctx_params },
-    { OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS,
+    { OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS,
       (void (*)(void))dsa_priv_settable_ctx_params },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))dsa_pem_priv_data },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))dsa_pem_priv },
+    { OSSL_FUNC_ENCODER_ENCODE_DATA, (void (*)(void))dsa_pem_priv_data },
+    { OSSL_FUNC_ENCODER_ENCODE_OBJECT, (void (*)(void))dsa_pem_priv },
     { 0, NULL }
 };
 
-const OSSL_DISPATCH dsa_priv_text_serializer_functions[] = {
-    { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))dsa_print_newctx },
-    { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))dsa_print_freectx },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))dsa_priv_print },
-    { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA,
+const OSSL_DISPATCH dsa_priv_text_encoder_functions[] = {
+    { OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))dsa_print_newctx },
+    { OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))dsa_print_freectx },
+    { OSSL_FUNC_ENCODER_ENCODE_OBJECT, (void (*)(void))dsa_priv_print },
+    { OSSL_FUNC_ENCODER_ENCODE_DATA,
       (void (*)(void))dsa_priv_print_data },
     { 0, NULL }
 };