| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include <stdint.h> |
| 19 |
|
| 20 |
#include "tls/s2n_connection.h" |
| 21 |
|
| 22 |
#define S2N_TLS_ALERT_LEVEL_WARNING 1 |
| 23 |
#define S2N_TLS_ALERT_LEVEL_FATAL 2 |
| 24 |
|
| 25 |
typedef enum { |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
S2N_TLS_ALERT_CLOSE_NOTIFY = 0, |
| 36 |
S2N_TLS_ALERT_UNEXPECTED_MESSAGE = 10, |
| 37 |
S2N_TLS_ALERT_BAD_RECORD_MAC = 20, |
| 38 |
S2N_TLS_ALERT_RECORD_OVERFLOW = 22, |
| 39 |
S2N_TLS_ALERT_HANDSHAKE_FAILURE = 40, |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
S2N_TLS_ALERT_BAD_CERTIFICATE = 42, |
| 49 |
S2N_TLS_ALERT_UNSUPPORTED_CERTIFICATE = 43, |
| 50 |
S2N_TLS_ALERT_CERTIFICATE_REVOKED = 44, |
| 51 |
S2N_TLS_ALERT_CERTIFICATE_EXPIRED = 45, |
| 52 |
S2N_TLS_ALERT_CERTIFICATE_UNKNOWN = 46, |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
S2N_TLS_ALERT_ILLEGAL_PARAMETER = 47, |
| 62 |
S2N_TLS_ALERT_UNKNOWN_CA = 48, |
| 63 |
S2N_TLS_ALERT_ACCESS_DENIED = 49, |
| 64 |
S2N_TLS_ALERT_DECODE_ERROR = 50, |
| 65 |
S2N_TLS_ALERT_DECRYPT_ERROR = 51, |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
S2N_TLS_ALERT_PROTOCOL_VERSION = 70, |
| 75 |
S2N_TLS_ALERT_INSUFFICIENT_SECURITY = 71, |
| 76 |
S2N_TLS_ALERT_INTERNAL_ERROR = 80, |
| 77 |
S2N_TLS_ALERT_INAPPROPRIATE_FALLBACK = 86, |
| 78 |
S2N_TLS_ALERT_USER_CANCELED = 90, |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
S2N_TLS_ALERT_NO_RENEGOTIATION = 100, |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
S2N_TLS_ALERT_MISSING_EXTENSION = 109, |
| 93 |
S2N_TLS_ALERT_UNSUPPORTED_EXTENSION = 110, |
| 94 |
S2N_TLS_ALERT_UNRECOGNIZED_NAME = 112, |
| 95 |
S2N_TLS_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE = 113, |
| 96 |
S2N_TLS_ALERT_UNKNOWN_PSK_IDENTITY = 115, |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
S2N_TLS_ALERT_CERTIFICATE_REQUIRED = 116, |
| 105 |
S2N_TLS_ALERT_NO_APPLICATION_PROTOCOL = 120, |
| 106 |
} s2n_tls_alert_code; |
| 107 |
|
| 108 |
int s2n_process_alert_fragment(struct s2n_connection *conn); |
| 109 |
int s2n_queue_reader_unsupported_protocol_version_alert(struct s2n_connection *conn); |
| 110 |
int s2n_queue_reader_handshake_failure_alert(struct s2n_connection *conn); |
| 111 |
S2N_RESULT s2n_queue_reader_no_renegotiation_alert(struct s2n_connection *conn); |
| 112 |
S2N_RESULT s2n_alerts_write_error_or_close_notify(struct s2n_connection *conn); |
| 113 |
S2N_RESULT s2n_alerts_write_warning(struct s2n_connection *conn); |