aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 05:31:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 05:31:39 +0300
commit5e3a91428d2796c3d4b68b2b42276903f2419320 (patch)
tree8ec88220e1302cfeb2aeecb82ec74a9e477aa4c9
parentcode style (diff)
downloadaes-tools-5e3a91428d2796c3d4b68b2b42276903f2419320.tar.gz
aes-tools-5e3a91428d2796c3d4b68b2b42276903f2419320.zip
add the "Not implemented" error
Diffstat (limited to '')
-rw-r--r--include/aesni/error.h4
-rw-r--r--src/error.c8
2 files changed, 12 insertions, 0 deletions
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);
+}