X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fssl_lib.c;h=b0d016a03d0083bf2589fd2d59f251a5d2735caf;hp=1457fc68f62115c8977cdb877dcabe235efee57d;hb=042c57539bfe7bbd642cdf6410c56327e91ad908;hpb=10ee72461254643bd152a7f3f6112edb6f517d4b diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 1457fc68f6..b0d016a03d 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -5295,3 +5295,20 @@ __owur unsigned int ssl_get_split_send_fragment(const SSL *ssl) /* return current SSL connection setting */ return ssl->split_send_fragment; } + +int SSL_stateless(SSL *s) +{ + int ret; + + /* Ensure there is no state left over from a previous invocation */ + if (!SSL_clear(s)) + return -1; + + ERR_clear_error(); + + s->s3->flags |= TLS1_FLAGS_STATELESS; + ret = SSL_accept(s); + s->s3->flags &= ~TLS1_FLAGS_STATELESS; + + return ret; +}