diff options
| author | jsing <> | 2020-05-11 17:28:33 +0000 |
|---|---|---|
| committer | jsing <> | 2020-05-11 17:28:33 +0000 |
| commit | e8ee587ebd9067593183cd7937f0693b858d1c07 (patch) | |
| tree | da6bc62c26f406643a28cb04f02d6bef6e8ed477 /src/lib/libssl/tls13_internal.h | |
| parent | d2a7acec963c15613c30a3b20b28cbdca0777462 (diff) | |
| download | openbsd-e8ee587ebd9067593183cd7937f0693b858d1c07.tar.gz openbsd-e8ee587ebd9067593183cd7937f0693b858d1c07.tar.bz2 openbsd-e8ee587ebd9067593183cd7937f0693b858d1c07.zip | |
Move the record layer callbacks into a struct.
This makes the code more readable, requires less code churn when adding
a new callback and is likely to avoid bugs due to function argument
ordering.
ok beck@ inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
| -rw-r--r-- | src/lib/libssl/tls13_internal.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index 7ec166f3fa..764b58b00b 100644 --- a/src/lib/libssl/tls13_internal.h +++ b/src/lib/libssl/tls13_internal.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls13_internal.h,v 1.75 2020/05/10 17:13:30 tb Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.76 2020/05/11 17:28:33 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> |
| 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
| @@ -174,10 +174,16 @@ int tls13_key_share_derive(struct tls13_key_share *ks, uint8_t **shared_key, | |||
| 174 | */ | 174 | */ |
| 175 | struct tls13_record_layer; | 175 | struct tls13_record_layer; |
| 176 | 176 | ||
| 177 | struct tls13_record_layer *tls13_record_layer_new(tls13_read_cb wire_read, | 177 | struct tls13_record_layer_callbacks { |
| 178 | tls13_write_cb wire_write, tls13_alert_cb alert_cb, | 178 | tls13_read_cb wire_read; |
| 179 | tls13_phh_recv_cb phh_recv_cb, | 179 | tls13_write_cb wire_write; |
| 180 | tls13_phh_sent_cb phh_sent_cb, void *cb_arg); | 180 | tls13_alert_cb alert_recv; |
| 181 | tls13_phh_recv_cb phh_recv; | ||
| 182 | tls13_phh_sent_cb phh_sent; | ||
| 183 | }; | ||
| 184 | |||
| 185 | struct tls13_record_layer *tls13_record_layer_new( | ||
| 186 | const struct tls13_record_layer_callbacks *callbacks, void *cb_arg); | ||
| 181 | void tls13_record_layer_free(struct tls13_record_layer *rl); | 187 | void tls13_record_layer_free(struct tls13_record_layer *rl); |
| 182 | void tls13_record_layer_allow_ccs(struct tls13_record_layer *rl, int allow); | 188 | void tls13_record_layer_allow_ccs(struct tls13_record_layer *rl, int allow); |
| 183 | void tls13_record_layer_allow_legacy_alerts(struct tls13_record_layer *rl, int allow); | 189 | void tls13_record_layer_allow_legacy_alerts(struct tls13_record_layer *rl, int allow); |
