From 5e3a91428d2796c3d4b68b2b42276903f2419320 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 17 Jun 2015 05:31:39 +0300 Subject: add the "Not implemented" error --- include/aesni/error.h | 4 ++++ src/error.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/include/aesni/error.h b/include/aesni/error.h index d4dcb81..4fa7936 100644 --- a/include/aesni/error.h +++ b/include/aesni/error.h @@ -48,6 +48,7 @@ typedef enum AESNI_NULL_ARGUMENT_ERROR, ///< Invalid argument value NULL AESNI_PARSE_ERROR, ///< Couldn't parse AESNI_INVALID_PKCS7_PADDING_ERROR, ///< Invalid PKCS7 padding + AESNI_NOT_IMPLEMENTED, } AesNI_StatusCode; @@ -163,6 +164,9 @@ AesNI_StatusCode aesni_make_parse_error( AesNI_StatusCode aesni_make_invalid_pkcs7_padding_error( AesNI_ErrorDetails* err_details); +AesNI_StatusCode aesni_error_not_implemented( + AesNI_ErrorDetails* err_details); + #ifdef __cplusplus } #endif diff --git a/src/error.c b/src/error.c index 5e25104..830520c 100644 --- a/src/error.c +++ b/src/error.c @@ -19,6 +19,7 @@ static const char* err_msgs[] = "Invalid argument value NULL", "Couldn't parse", "Invalid PKCS7 padding (wrong key?)", + "Not implemented", }; const char* aesni_strerror(AesNI_StatusCode ec) @@ -80,6 +81,7 @@ static AesNI_ErrorFormatter err_formatters[] = &aesni_format_null_argument_error, &aesni_format_error_strerror, &aesni_format_error_strerror, + &aesni_format_error_strerror, }; size_t aesni_format_error( @@ -140,3 +142,9 @@ AesNI_StatusCode aesni_make_invalid_pkcs7_padding_error( { return aesni_make_error(err_details, AESNI_INVALID_PKCS7_PADDING_ERROR); } + +AesNI_StatusCode aesni_error_not_implemented( + AesNI_ErrorDetails* err_details) +{ + return aesni_make_error(err_details, AESNI_NOT_IMPLEMENTED); +} -- cgit v1.2.3