DESERIALIZER: Add foundation for deserializers
authorRichard Levitte <levitte@openssl.org>
Wed, 8 Jul 2020 21:04:08 +0000 (23:04 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 24 Jul 2020 14:32:00 +0000 (16:32 +0200)
commitc3e4c1f325e6fc829a5b00a19a6019249cac781a
treecc05f9636e452d3fba177163cfca9d13b403a4d6
parent5dacb38ccefd45d832c9710b4dd0121fdcbdac72
DESERIALIZER: Add foundation for deserializers

This adds a method OSSL_DESERIALIZER, a deserializer context and basic
support to use a set of serializers to get a desired type of data, as
well as deserializer chains.

The idea is that the caller can call OSSL_DESERIALIZER_CTX_add_serializer()
to set up the set of desired results, and to add possible chains, call
OSSL_DESERIALIZER_CTX_add_extra().  All these deserializers are pushed
on an internal stack.

The actual deserialization is then performed using functions like
OSSL_DESERIALIZER_from_bio().  When performing deserialization, the
inernal stack is walked backwards, keeping track of the deserialized
data and its type along the way, until the data kan be processed into
the desired type of data.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12410)
24 files changed:
crypto/err/err.c
crypto/err/openssl.ec
crypto/err/openssl.txt
crypto/property/property_parse.c
crypto/serializer/build.info
crypto/serializer/deserializer_err.c [new file with mode: 0644]
crypto/serializer/deserializer_lib.c [new file with mode: 0644]
crypto/serializer/deserializer_meth.c [new file with mode: 0644]
crypto/serializer/serializer_local.h
crypto/serializer/serializer_meth.c
doc/man3/OSSL_DESERIALIZER.pod [new file with mode: 0644]
doc/man3/OSSL_DESERIALIZER_CTX.pod [new file with mode: 0644]
doc/man3/OSSL_DESERIALIZER_from_bio.pod [new file with mode: 0644]
include/crypto/serializer.h
include/internal/cryptlib.h
include/openssl/core_dispatch.h
include/openssl/core_names.h
include/openssl/deserializer.h [new file with mode: 0644]
include/openssl/deserializererr.h [new file with mode: 0644]
include/openssl/err.h
include/openssl/types.h
util/libcrypto.num
util/missingcrypto.txt
util/other.syms