diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/restricted/aws/aws-c-cal/source/cal.c | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/aws/aws-c-cal/source/cal.c')
-rw-r--r-- | contrib/restricted/aws/aws-c-cal/source/cal.c | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/contrib/restricted/aws/aws-c-cal/source/cal.c b/contrib/restricted/aws/aws-c-cal/source/cal.c index d0792ce09a..100e7fd034 100644 --- a/contrib/restricted/aws/aws-c-cal/source/cal.c +++ b/contrib/restricted/aws/aws-c-cal/source/cal.c @@ -1,63 +1,63 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ -#include <aws/cal/cal.h> -#include <aws/common/common.h> -#include <aws/common/error.h> - -#define AWS_DEFINE_ERROR_INFO_CAL(CODE, STR) [(CODE)-0x1C00] = AWS_DEFINE_ERROR_INFO(CODE, STR, "aws-c-cal") - -static struct aws_error_info s_errors[] = { - AWS_DEFINE_ERROR_INFO_CAL(AWS_ERROR_CAL_SIGNATURE_VALIDATION_FAILED, "Verify on a cryptographic signature failed."), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_MISSING_REQUIRED_KEY_COMPONENT, - "An attempt was made to perform an " - "Asymmetric cryptographic operation with the" - "wrong key component. For example, attempt to" - "verify a signature with a private key or " - "sign a message with a public key."), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_INVALID_KEY_LENGTH_FOR_ALGORITHM, - "A key length was used for an algorithm that needs a different key length"), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_UNKNOWN_OBJECT_IDENTIFIER, - "An ASN.1 OID was encountered that wasn't expected or understood. Most likely, an unsupported algorithm was " - "encountered."), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED, - "An ASN.1 DER decoding operation failed on malformed input."), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_MISMATCHED_DER_TYPE, - "An invalid DER type was requested during encoding/decoding"), - AWS_DEFINE_ERROR_INFO_CAL( - AWS_ERROR_CAL_UNSUPPORTED_ALGORITHM, - "The specified algorithim is unsupported on this platform."), -}; - -static struct aws_error_info_list s_list = { - .error_list = s_errors, - .count = AWS_ARRAY_SIZE(s_errors), -}; - -extern void aws_cal_platform_init(struct aws_allocator *allocator); -extern void aws_cal_platform_clean_up(void); - -static bool s_cal_library_initialized = false; - -void aws_cal_library_init(struct aws_allocator *allocator) { - if (!s_cal_library_initialized) { - aws_common_library_init(allocator); - aws_register_error_info(&s_list); - aws_cal_platform_init(allocator); - s_cal_library_initialized = true; - } -} -void aws_cal_library_clean_up(void) { - if (s_cal_library_initialized) { - s_cal_library_initialized = false; - aws_cal_platform_clean_up(); - aws_unregister_error_info(&s_list); - aws_common_library_clean_up(); - } -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +#include <aws/cal/cal.h> +#include <aws/common/common.h> +#include <aws/common/error.h> + +#define AWS_DEFINE_ERROR_INFO_CAL(CODE, STR) [(CODE)-0x1C00] = AWS_DEFINE_ERROR_INFO(CODE, STR, "aws-c-cal") + +static struct aws_error_info s_errors[] = { + AWS_DEFINE_ERROR_INFO_CAL(AWS_ERROR_CAL_SIGNATURE_VALIDATION_FAILED, "Verify on a cryptographic signature failed."), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_MISSING_REQUIRED_KEY_COMPONENT, + "An attempt was made to perform an " + "Asymmetric cryptographic operation with the" + "wrong key component. For example, attempt to" + "verify a signature with a private key or " + "sign a message with a public key."), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_INVALID_KEY_LENGTH_FOR_ALGORITHM, + "A key length was used for an algorithm that needs a different key length"), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_UNKNOWN_OBJECT_IDENTIFIER, + "An ASN.1 OID was encountered that wasn't expected or understood. Most likely, an unsupported algorithm was " + "encountered."), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED, + "An ASN.1 DER decoding operation failed on malformed input."), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_MISMATCHED_DER_TYPE, + "An invalid DER type was requested during encoding/decoding"), + AWS_DEFINE_ERROR_INFO_CAL( + AWS_ERROR_CAL_UNSUPPORTED_ALGORITHM, + "The specified algorithim is unsupported on this platform."), +}; + +static struct aws_error_info_list s_list = { + .error_list = s_errors, + .count = AWS_ARRAY_SIZE(s_errors), +}; + +extern void aws_cal_platform_init(struct aws_allocator *allocator); +extern void aws_cal_platform_clean_up(void); + +static bool s_cal_library_initialized = false; + +void aws_cal_library_init(struct aws_allocator *allocator) { + if (!s_cal_library_initialized) { + aws_common_library_init(allocator); + aws_register_error_info(&s_list); + aws_cal_platform_init(allocator); + s_cal_library_initialized = true; + } +} +void aws_cal_library_clean_up(void) { + if (s_cal_library_initialized) { + s_cal_library_initialized = false; + aws_cal_platform_clean_up(); + aws_unregister_error_info(&s_list); + aws_common_library_clean_up(); + } +} |