diff options
-rw-r--r-- | src/lib/libssl/ssl.h | 13 | ||||
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 30 |
2 files changed, 41 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index b01c426c9c..093c4bde2d 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl.h,v 1.175 2020/09/19 10:05:00 tb Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.176 2020/09/19 10:12:06 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1465,6 +1465,17 @@ int SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data); | |||
1465 | 1465 | ||
1466 | uint32_t SSL_get_max_early_data(const SSL *s); | 1466 | uint32_t SSL_get_max_early_data(const SSL *s); |
1467 | int SSL_set_max_early_data(SSL *s, uint32_t max_early_data); | 1467 | int SSL_set_max_early_data(SSL *s, uint32_t max_early_data); |
1468 | |||
1469 | #define SSL_EARLY_DATA_NOT_SENT 0 | ||
1470 | #define SSL_EARLY_DATA_REJECTED 1 | ||
1471 | #define SSL_EARLY_DATA_ACCEPTED 2 | ||
1472 | int SSL_get_early_data_status(const SSL *s); | ||
1473 | |||
1474 | #define SSL_READ_EARLY_DATA_ERROR 0 | ||
1475 | #define SSL_READ_EARLY_DATA_SUCCESS 1 | ||
1476 | #define SSL_READ_EARLY_DATA_FINISH 2 | ||
1477 | int SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes); | ||
1478 | int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written); | ||
1468 | #endif | 1479 | #endif |
1469 | 1480 | ||
1470 | long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); | 1481 | long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); |
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 3c62f39a57..b04b67df41 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_lib.c,v 1.231 2020/09/19 10:05:00 tb Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.232 2020/09/19 10:12:06 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1023,6 +1023,34 @@ SSL_set_max_early_data(SSL *s, uint32_t max_early_data) | |||
1023 | { | 1023 | { |
1024 | return 1; | 1024 | return 1; |
1025 | } | 1025 | } |
1026 | |||
1027 | int | ||
1028 | SSL_get_early_data_status(const SSL *s) | ||
1029 | { | ||
1030 | return SSL_EARLY_DATA_REJECTED; | ||
1031 | } | ||
1032 | |||
1033 | int | ||
1034 | SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes) | ||
1035 | { | ||
1036 | *readbytes = 0; | ||
1037 | |||
1038 | if (!s->server) { | ||
1039 | SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
1040 | return SSL_READ_EARLY_DATA_ERROR; | ||
1041 | } | ||
1042 | |||
1043 | return SSL_READ_EARLY_DATA_FINISH; | ||
1044 | } | ||
1045 | |||
1046 | int | ||
1047 | SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written) | ||
1048 | { | ||
1049 | *written = 0; | ||
1050 | SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
1051 | return 0; | ||
1052 | } | ||
1053 | |||
1026 | int | 1054 | int |
1027 | SSL_shutdown(SSL *s) | 1055 | SSL_shutdown(SSL *s) |
1028 | { | 1056 | { |