aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/s2n/error/s2n_errno.h
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2023-10-23 21:53:30 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2023-10-23 22:17:19 +0300
commit185aad3f5de6274260a161e58d92312d91813770 (patch)
tree39b2a93a9a649bffaaea9e405b00ceeea0d13c11 /contrib/restricted/aws/s2n/error/s2n_errno.h
parenta14514f8c6ab647d334ae41253e65f69ee9b5fa6 (diff)
downloadydb-185aad3f5de6274260a161e58d92312d91813770.tar.gz
Update contrib/restricted/aws/s2n to 1.3.54
Diffstat (limited to 'contrib/restricted/aws/s2n/error/s2n_errno.h')
-rw-r--r--contrib/restricted/aws/s2n/error/s2n_errno.h48
1 files changed, 41 insertions, 7 deletions
diff --git a/contrib/restricted/aws/s2n/error/s2n_errno.h b/contrib/restricted/aws/s2n/error/s2n_errno.h
index 6955266945..1ff5070717 100644
--- a/contrib/restricted/aws/s2n/error/s2n_errno.h
+++ b/contrib/restricted/aws/s2n/error/s2n_errno.h
@@ -17,6 +17,7 @@
#include <stdbool.h>
#include <stdio.h>
+#include <string.h>
#include "api/s2n.h"
#include "utils/s2n_ensure.h"
@@ -109,10 +110,12 @@ typedef enum {
S2N_ERR_RECORD_LIMIT,
S2N_ERR_CERT_UNTRUSTED,
S2N_ERR_CERT_REVOKED,
+ S2N_ERR_CERT_NOT_YET_VALID,
S2N_ERR_CERT_EXPIRED,
S2N_ERR_CERT_TYPE_UNSUPPORTED,
S2N_ERR_CERT_INVALID,
S2N_ERR_CERT_MAX_CHAIN_DEPTH_EXCEEDED,
+ S2N_ERR_CERT_REJECTED,
S2N_ERR_CRL_LOOKUP_FAILED,
S2N_ERR_CRL_SIGNATURE,
S2N_ERR_CRL_ISSUER,
@@ -165,6 +168,7 @@ typedef enum {
S2N_ERR_HASH_INVALID_ALGORITHM,
S2N_ERR_PRF_INVALID_ALGORITHM,
S2N_ERR_PRF_INVALID_SEED,
+ S2N_ERR_PRF_DERIVE,
S2N_ERR_P_HASH_INVALID_ALGORITHM,
S2N_ERR_P_HASH_INIT_FAILED,
S2N_ERR_P_HASH_UPDATE_FAILED,
@@ -172,6 +176,7 @@ typedef enum {
S2N_ERR_P_HASH_WIPE_FAILED,
S2N_ERR_HMAC_INVALID_ALGORITHM,
S2N_ERR_HKDF_OUTPUT_SIZE,
+ S2N_ERR_HKDF,
S2N_ERR_ALERT_PRESENT,
S2N_ERR_HANDSHAKE_STATE,
S2N_ERR_SHUTDOWN_PAUSED,
@@ -226,6 +231,7 @@ typedef enum {
S2N_ERR_LIBCRYPTO_VERSION_NUMBER_MISMATCH,
S2N_ERR_LIBCRYPTO_VERSION_NAME_MISMATCH,
S2N_ERR_OSSL_PROVIDER,
+ S2N_ERR_TEST_ASSERTION,
S2N_ERR_T_INTERNAL_END,
/* S2N_ERR_T_USAGE */
@@ -253,6 +259,7 @@ typedef enum {
S2N_ERR_SEND_SIZE,
S2N_ERR_CORK_SET_ON_UNMANAGED,
S2N_ERR_UNRECOGNIZED_EXTENSION,
+ S2N_ERR_EXTENSION_NOT_RECEIVED,
S2N_ERR_INVALID_SCT_LIST,
S2N_ERR_INVALID_OCSP_RESPONSE,
S2N_ERR_UPDATING_EXTENSION,
@@ -304,22 +311,48 @@ typedef enum {
S2N_ERR_SECRET_SCHEDULE_STATE,
S2N_ERR_CERT_OWNERSHIP,
S2N_ERR_INTERNAL_LIBCRYPTO_ERROR,
+ S2N_ERR_HANDSHAKE_NOT_COMPLETE,
+ S2N_ERR_KTLS_MANAGED_IO,
+ S2N_ERR_KTLS_UNSUPPORTED_PLATFORM,
+ S2N_ERR_KTLS_UNSUPPORTED_CONN,
+ S2N_ERR_KTLS_ENABLE,
+ S2N_ERR_KTLS_BAD_CMSG,
+ S2N_ERR_KTLS_RENEG,
+ S2N_ERR_ATOMIC,
S2N_ERR_T_USAGE_END,
} s2n_error;
#define S2N_DEBUG_STR_LEN 128
-extern __thread const char *s2n_debug_str;
+
+struct s2n_debug_info {
+ const char *debug_str;
+ const char *source;
+};
+
+extern __thread struct s2n_debug_info _s2n_debug_info;
#define TO_STRING(s) #s
#define STRING_(s) TO_STRING(s)
#define STRING__LINE__ STRING_(__LINE__)
-#define _S2N_DEBUG_LINE "Error encountered in " __FILE__ ":" STRING__LINE__
-#define _S2N_ERROR(x) \
- do { \
- s2n_debug_str = _S2N_DEBUG_LINE; \
- s2n_errno = (x); \
- s2n_calculate_stacktrace(); \
+/* gets the basename of a file path */
+/* _S2N_EXTRACT_BASENAME("Error encountered in /path/to/my/file.c") -> "file.c" */
+#if !(defined(CBMC) || defined(__TIMING_CONTRACTS__))
+ #define _S2N_RSPLIT(subject, c) (strrchr((subject), c) ? strrchr((subject), c) + 1 : (subject))
+ #define _S2N_EXTRACT_BASENAME(path) _S2N_RSPLIT((path) + strlen(_S2N_DEBUG_LINE_PREFIX), '/')
+#else
+ #define _S2N_EXTRACT_BASENAME(path) path
+#endif
+
+#define _S2N_DEBUG_LINE_PREFIX "Error encountered in "
+#define _S2N_DEBUG_LINE _S2N_DEBUG_LINE_PREFIX __FILE__ ":" STRING__LINE__
+
+#define _S2N_ERROR(x) \
+ do { \
+ _s2n_debug_info.debug_str = _S2N_DEBUG_LINE; \
+ _s2n_debug_info.source = _S2N_EXTRACT_BASENAME(_s2n_debug_info.debug_str); \
+ s2n_errno = (x); \
+ s2n_calculate_stacktrace(); \
} while (0)
#define S2N_ERROR_PRESERVE_ERRNO() \
do { \
@@ -362,3 +395,4 @@ int s2n_calculate_stacktrace(void);
int s2n_print_stacktrace(FILE *fptr);
int s2n_free_stacktrace(void);
int s2n_get_stacktrace(struct s2n_stacktrace *trace);
+void s2n_debug_info_reset(void);