summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2020-09-19 10:12:06 +0000
committertb <>2020-09-19 10:12:06 +0000
commitea977a7fe6f863754263a4149c1ea1c7a9a803fd (patch)
treeb72124575f2ccc8dc52bf3ae578363e4c1c16518 /src
parent6946a1a0fe28e7ca3594e290ba2654826ac23618 (diff)
downloadopenbsd-ea977a7fe6f863754263a4149c1ea1c7a9a803fd.tar.gz
openbsd-ea977a7fe6f863754263a4149c1ea1c7a9a803fd.tar.bz2
openbsd-ea977a7fe6f863754263a4149c1ea1c7a9a803fd.zip
Prepare to provide stubbed out versions for reading/writing 0-RTT data
We do not support this feature but need to provide OpenSSL's API since software assumes it's available whenever TLS1_3_VERSION is available. These are minimal stubs that should have a decent chance to interact reasonably with software expecting the tricky upstream semantics, but this will have to be sorted out with runtime testing, so will likely have to be refined and revisited. ok beck jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl.h13
-rw-r--r--src/lib/libssl/ssl_lib.c30
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
1466uint32_t SSL_get_max_early_data(const SSL *s); 1466uint32_t SSL_get_max_early_data(const SSL *s);
1467int SSL_set_max_early_data(SSL *s, uint32_t max_early_data); 1467int 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
1472int 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
1477int SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes);
1478int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written);
1468#endif 1479#endif
1469 1480
1470long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); 1481long 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
1027int
1028SSL_get_early_data_status(const SSL *s)
1029{
1030 return SSL_EARLY_DATA_REJECTED;
1031}
1032
1033int
1034SSL_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
1046int
1047SSL_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
1026int 1054int
1027SSL_shutdown(SSL *s) 1055SSL_shutdown(SSL *s)
1028{ 1056{