summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-11-18 01:32:22 +0100
committerRichard Levitte <levitte@openssl.org>2019-11-29 20:55:16 +0100
commit742496f1309d04f4921ca64e4b6315a45a47b4af (patch)
treee3c21274c6f1ae8e545e458edc986d96663085cc /include
parent0d003c52d3dcf4b076bb01a6767cdd5ace2d79f6 (diff)
SERIALIZER: add functions for serialization to file
These functions are added: - OSSL_SERIALIZER_to_bio() - OSSL_SERIALIZER_to_fp() (unless 'no-stdio') OSSL_SERIALIZER_to_bio() and OSSL_SERIALIZER_to_fp() work as wrapper functions, and call an internal "do_output" function with the given serializer context and a BIO to output the serialized result to. The internal "do_output" function must have intimate knowledge of the object being output. This will defined independently with context creators for specific OpenSSL types. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10394)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/serializer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/openssl/serializer.h b/include/openssl/serializer.h
index 79f8abecb5..78b57d225c 100644
--- a/include/openssl/serializer.h
+++ b/include/openssl/serializer.h
@@ -53,6 +53,12 @@ int OSSL_SERIALIZER_CTX_set_params(OSSL_SERIALIZER_CTX *ctx,
const OSSL_PARAM params[]);
void OSSL_SERIALIZER_CTX_free(OSSL_SERIALIZER_CTX *ctx);
+/* Utilities to output the object to serialize */
+int OSSL_SERIALIZER_to_bio(OSSL_SERIALIZER_CTX *ctx, BIO *out);
+#ifndef OPENSSL_NO_STDIO
+int OSSL_SERIALIZER_to_fp(OSSL_SERIALIZER_CTX *ctx, FILE *fp);
+#endif
+
# ifdef __cplusplus
}
# endif