diff options
author | Richard Levitte <levitte@openssl.org> | 2019-11-18 01:29:06 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-11-29 20:54:48 +0100 |
commit | 0d003c52d3dcf4b076bb01a6767cdd5ace2d79f6 (patch) | |
tree | c04a81334735f506d3c94a3591e224683feb78ad /crypto/err | |
parent | 36fa4d8a0df9dc168047fadd0365966c7116b31d (diff) |
SERIALIZER: New API for serialization of objects through providers
Serialization is needed to be able to take a provider object (such as
the provider side key data) and output it in PEM form, DER form, text
form (for display), and possibly other future forms (XML? JSON? JWK?)
The idea is that a serializer should be able to handle objects it has
intimate knowledge of, as well as object data in OSSL_PARAM form. The
latter will allow libcrypto to serialize some object with a different
provider than the one holding the data, if exporting of that data is
allowed and there is a serializer that can handle it.
We will provide serializers for the types of objects we know about,
which should be useful together with any other provider that provides
implementations of the same type of object.
Serializers are selected by method name and a couple of additional
properties:
- format used to tell what format the output should be in.
Possibilities could include "format=text",
"format=pem", "format=der", "format=pem-pkcs1"
(traditional), "format=der-pkcs1" (traditional)
- type used to tell exactly what type of data should be
output, for example "type=public" (the public part of
a key), "type=private" (the private part of a key),
"type=domainparams" (domain parameters).
This also adds a passphrase callback function type,
OSSL_PASSPHRASE_CALLBACK, which is a bit like OSSL_CALLBACK, but it
takes a few extra arguments to place the result in.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10394)
Diffstat (limited to 'crypto/err')
-rw-r--r-- | crypto/err/err.c | 2 | ||||
-rw-r--r-- | crypto/err/openssl.ec | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index bc33a06b7e..0fb46bef4d 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -75,6 +75,7 @@ static ERR_STRING_DATA ERR_str_libraries[] = { {ERR_PACK(ERR_LIB_SM2, 0, 0), "SM2 routines"}, {ERR_PACK(ERR_LIB_ESS, 0, 0), "ESS routines"}, {ERR_PACK(ERR_LIB_PROV, 0, 0), "Provider routines"}, + {ERR_PACK(ERR_LIB_OSSL_SERIALIZER, 0, 0), "SERIALIZER routines"}, {0, NULL}, }; @@ -111,6 +112,7 @@ static ERR_STRING_DATA ERR_str_reasons[] = { {ERR_R_DISABLED, "called a function that was disabled at compile-time"}, {ERR_R_INIT_FAIL, "init fail"}, {ERR_R_OPERATION_FAIL, "operation fail"}, + {ERR_R_INVALID_PROVIDER_FUNCTIONS, "invalid provider functions"}, {0, NULL}, }; diff --git a/crypto/err/openssl.ec b/crypto/err/openssl.ec index 211edd42f3..485c0c89ce 100644 --- a/crypto/err/openssl.ec +++ b/crypto/err/openssl.ec @@ -40,6 +40,7 @@ L OSSL_STORE include/openssl/store.h crypto/store/store_err.c L ESS include/openssl/ess.h crypto/ess/ess_err.c L PROP include/internal/property.h crypto/property/property_err.c L PROV providers/common/include/prov/providercommon.h providers/common/provider_err.c +L OSSL_SERIALIZER include/openssl/serializer.h crypto/serializer/serializer_err.c # additional header files to be scanned for function names L NONE include/openssl/x509_vfy.h NONE |