diff options
author | Matt Caswell <matt@openssl.org> | 2022-04-07 17:35:36 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2022-08-18 16:38:12 +0100 |
commit | e2d5742b1460c45bf39094ea08e4e85a8f507ea8 (patch) | |
tree | 67cfdbe193f5dff47d05460da589619a4eeb2a55 /ssl/ssl_lib.c | |
parent | 0c974fc754e4b0525819ca9f6c3e124141b690ad (diff) |
Transfer the functionality from ssl3_read_n to the new record layer
This transfers the low level function ssl3_read_n to the new record layer.
We temporarily make the read_n function a top level record layer function.
Eventually, in later commits in this refactor, we will remove it as a top
level function and it will just be called from read_record.
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 1a7242aee2..c61ad65063 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -885,6 +885,22 @@ SSL *ossl_ssl_connection_new(SSL_CTX *ctx) goto err; #endif + /* + * TODO(RECLAYER): This assignment should probably initialy come from the + * SSL_METHOD, and potentially be updated later. For now though we just + * assign it. + */ + if (SSL_CONNECTION_IS_DTLS(s)) + s->rrlmethod = &ossl_dtls_record_method; + else + s->rrlmethod = &ossl_tls_record_method; + + /* BIO is NULL initially. It will get updated later */ + s->rrl = s->rrlmethod->new_record_layer(s->version, s->server, + OSSL_RECORD_DIRECTION_READ, + 0, 0, 0, NULL, NULL, NULL, + NULL, NULL, NULL); + return ssl; err: SSL_free(ssl); @@ -1422,6 +1438,7 @@ void SSL_set0_rbio(SSL *s, BIO *rbio) BIO_free_all(sc->rbio); sc->rbio = rbio; + sc->rrlmethod->set1_bio(sc->rrl, sc->rbio); } void SSL_set0_wbio(SSL *s, BIO *wbio) |