diff options
author | Richard Levitte <levitte@openssl.org> | 2021-04-12 12:11:07 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-04-21 10:53:03 +0200 |
commit | f99659535d180f15cd19c63cb53392c256e35534 (patch) | |
tree | 5e435ea7e73a4e4421b07b93e9635380499e31fd /include | |
parent | a2502862f679c82b794869ac88ed0d8ca7bc291c (diff) |
ENCODER & DECODER: Allow decoder implementations to specify "carry on"
So far, decoder implementations would return true (1) for a successful
decode all the way, including what the callback it called returned,
and false (0) in all other cases.
This construction didn't allow to stop to decoding process on fatal
errors, nor to choose what to report in the provider code.
This is now changed so that decoders implementations are made to
return false only on errors that should stop the decoding process from
carrying on with other implementations, and return true for all other
cases, even if that didn't result in a constructed object (EVP_PKEY
for example), essentially making it OK to return "empty handed".
The success of the decoding process is now all about successfully
constructing the final object, rather than about the return value of
the decoding chain. If no construction is attempted, the central
decoding processing code concludes that whatever the input consisted
of, it's not supported by the available decoder implementations.
Fixes #14423
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14834)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/decodererr.h | 2 | ||||
-rw-r--r-- | include/openssl/decodererr.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/crypto/decodererr.h b/include/crypto/decodererr.h index c19f70c1c6..edf826798d 100644 --- a/include/crypto/decodererr.h +++ b/include/crypto/decodererr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/include/openssl/decodererr.h b/include/openssl/decodererr.h index 886c3750fe..824a0a9253 100644 --- a/include/openssl/decodererr.h +++ b/include/openssl/decodererr.h @@ -21,6 +21,7 @@ /* * OSSL_DECODER reason codes. */ +# define OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT 101 # define OSSL_DECODER_R_MISSING_GET_PARAMS 100 #endif |