mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-30 13:42:17 +01:00
wolfssl/wolfcrypt/error-crypt.h: add WC_FIRST_E. wolfcrypt/src/error.c: add MP error code strings. wolfssl/error-ssl.h: add WOLFSSL_FIRST_E and WOLFSSL_LAST_E. wolfcrypt/test/test.c: update error_test() for new error code layout, refactoring the "missing" check. src/internal.c: use WC_FIRST_E and WC_LAST_E in wolfSSL_ERR_reason_error_string(). src/ssl.c: fix wolfSSL_ERR_GET_REASON() to identify in-range error codes using WC_FIRST_E, WC_LAST_E, WOLFSSL_FIRST_E, and WOLFSSL_LAST_E. sp_int.h: provide for WOLFSSL_DEBUG_TRACE_ERROR_CODES, and refactor MP error codes as enums, for consistency with other error codes. wolfcrypt/src/ecc.c: fix 2 identicalInnerCondition's.
38 lines
1.8 KiB
Bash
Executable File
38 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
awk '
|
|
BEGIN {
|
|
print("/* automatically generated, do not edit */") > "wolfssl/debug-trace-error-codes.h";
|
|
print("#ifndef WOLFSSL_DEBUG_TRACE_ERROR_CODES_H") >> "wolfssl/debug-trace-error-codes.h";
|
|
print("#define WOLFSSL_DEBUG_TRACE_ERROR_CODES_H") >> "wolfssl/debug-trace-error-codes.h";
|
|
print("") >> "wolfssl/debug-trace-error-codes.h";
|
|
|
|
print("/* automatically generated, do not edit */") > "wolfssl/debug-untrace-error-codes.h";
|
|
print("#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES_H") >> "wolfssl/debug-untrace-error-codes.h";
|
|
print("#undef WOLFSSL_DEBUG_TRACE_ERROR_CODES_H") >> "wolfssl/debug-untrace-error-codes.h";
|
|
}
|
|
{
|
|
if (match($0, "^[[:space:]]+([A-Z][A-Z0-9_]+)[[:space:]]*=[[:space:]]*(-[0-9]+)([,[:space:]]|$)")) {
|
|
|
|
# for mawkward compatibility -- gawk allows errcode_a as the 3rd arg to match().
|
|
gsub("^[[:space:]]+", "", $0);
|
|
split($0, errcode_a, "[[:space:]=,]+");
|
|
|
|
if ((errcode_a[1] == "MIN_CODE_E") ||
|
|
(errcode_a[1] == "WC_LAST_E") ||
|
|
(errcode_a[1] == "MAX_CODE_E"))
|
|
{
|
|
next;
|
|
}
|
|
printf("#define %s WC_ERR_TRACE(%s)\n#define CONST_NUM_ERR_%s (%s)\n", errcode_a[1], errcode_a[1], errcode_a[1], errcode_a[2]) >> "wolfssl/debug-trace-error-codes.h";
|
|
printf("#undef %s\n#undef CONST_NUM_ERR_%s\n", errcode_a[1], errcode_a[1]) >> "wolfssl/debug-untrace-error-codes.h";
|
|
}
|
|
}
|
|
END {
|
|
print("") >> "wolfssl/debug-trace-error-codes.h";
|
|
print("#endif /* WOLFSSL_DEBUG_TRACE_ERROR_CODES_H */") >> "wolfssl/debug-trace-error-codes.h";
|
|
|
|
print("") >> "wolfssl/debug-untrace-error-codes.h";
|
|
print("#endif /* WOLFSSL_DEBUG_TRACE_ERROR_CODES_H */") >> "wolfssl/debug-untrace-error-codes.h";
|
|
}' wolfssl/wolfcrypt/error-crypt.h wolfssl/error-ssl.h
|