2020-07-09 05:04:08 +08:00
|
|
|
/*
|
|
|
|
* Generated by util/mkerr.pl DO NOT EDIT
|
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)
2021-04-12 18:11:07 +08:00
|
|
|
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
2020-07-09 05:04:08 +08:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <openssl/err.h>
|
2020-08-17 03:25:08 +08:00
|
|
|
#include <openssl/decodererr.h>
|
2020-11-12 17:36:47 +08:00
|
|
|
#include "crypto/decodererr.h"
|
2020-07-09 05:04:08 +08:00
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_ERR
|
|
|
|
|
2020-08-17 03:25:08 +08:00
|
|
|
static const ERR_STRING_DATA OSSL_DECODER_str_reasons[] = {
|
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)
2021-04-12 18:11:07 +08:00
|
|
|
{ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT),
|
|
|
|
"could not decode object"},
|
2021-05-15 17:27:09 +08:00
|
|
|
{ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_DECODER_NOT_FOUND),
|
|
|
|
"decoder not found"},
|
2020-08-17 03:25:08 +08:00
|
|
|
{ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_MISSING_GET_PARAMS),
|
2020-11-12 17:36:47 +08:00
|
|
|
"missing get params"},
|
2020-07-09 05:04:08 +08:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2021-05-25 10:04:22 +08:00
|
|
|
int ossl_err_load_OSSL_DECODER_strings(void)
|
2020-07-09 05:04:08 +08:00
|
|
|
{
|
|
|
|
#ifndef OPENSSL_NO_ERR
|
2020-08-17 03:25:08 +08:00
|
|
|
if (ERR_reason_error_string(OSSL_DECODER_str_reasons[0].error) == NULL)
|
|
|
|
ERR_load_strings_const(OSSL_DECODER_str_reasons);
|
2020-07-09 05:04:08 +08:00
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
}
|