Refactor the async wait fd logic
Implementation experience has shown that the original plan for async wait fds was too simplistic. Originally the async logic created a pipe internally and user/engine code could then get access to it via API calls. It is more flexible if the engine is able to create its own fd and provide it to the async code. Another issue is that there can be a lot of churn in the fd value within the context of (say) a single SSL connection leading to continually adding and removing fds from (say) epoll. It is better if we can provide some stability of the fd value across a whole SSL connection. This is problematic because an engine has no concept of an SSL connection. This commit refactors things to introduce an ASYNC_WAIT_CTX which acts as a proxy for an SSL connection down at the engine layer. Reviewed-by: Richard Levitte <levitte@openssl.org>master
parent
b32166b4fa
commit
ff75a25749
@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Written by Matt Caswell (matt@openssl.org) for the OpenSSL project.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
/* This must be the first #include file */
|
||||
#include "async_locl.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void)
|
||||
{
|
||||
return OPENSSL_zalloc(sizeof(ASYNC_WAIT_CTX));
|
||||
}
|
||||
|
||||
void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx)
|
||||
{
|
||||
struct fd_lookup_st *curr;
|
||||
|
||||
if (ctx == NULL)
|
||||
return;
|
||||
|
||||
curr = ctx->fds;
|
||||
while (curr != NULL) {
|
||||
if (curr->del) {
|
||||
/* This one has already been deleted so do nothing */
|
||||
curr = curr->next;
|
||||
continue;
|
||||
}
|
||||
if (curr->cleanup != NULL)
|
||||
curr->cleanup(ctx, curr->key, curr->fd, curr->custom_data);
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
OPENSSL_free(ctx);
|
||||
}
|
||||
int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD fd, void *custom_data,
|
||||
void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
|
||||
OSSL_ASYNC_FD, void *))
|
||||
{
|
||||
struct fd_lookup_st *fdlookup;
|
||||
|
||||
fdlookup = OPENSSL_zalloc(sizeof *fdlookup);
|
||||
if (fdlookup == NULL)
|
||||
return 0;
|
||||
|
||||
fdlookup->key = key;
|
||||
fdlookup->fd = fd;
|
||||
fdlookup->custom_data = custom_data;
|
||||
fdlookup->cleanup = cleanup;
|
||||
fdlookup->add = 1;
|
||||
fdlookup->next = ctx->fds;
|
||||
ctx->fds = fdlookup;
|
||||
ctx->numadd++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD *fd, void **custom_data)
|
||||
{
|
||||
struct fd_lookup_st *curr;
|
||||
|
||||
curr = ctx->fds;
|
||||
while (curr != NULL) {
|
||||
if (curr->del) {
|
||||
/* This one has been marked deleted so do nothing */
|
||||
curr = curr->next;
|
||||
continue;
|
||||
}
|
||||
if (curr->key == key) {
|
||||
*fd = curr->fd;
|
||||
*custom_data = curr->custom_data;
|
||||
return 1;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
|
||||
size_t *numfds)
|
||||
{
|
||||
struct fd_lookup_st *curr;
|
||||
|
||||
curr = ctx->fds;
|
||||
*numfds = 0;
|
||||
while (curr != NULL) {
|
||||
if (curr->del) {
|
||||
/* This one has been marked deleted so do nothing */
|
||||
curr = curr->next;
|
||||
continue;
|
||||
}
|
||||
if (fd != NULL) {
|
||||
*fd = curr->fd;
|
||||
fd++;
|
||||
}
|
||||
(*numfds)++;
|
||||
curr = curr->next;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
|
||||
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
|
||||
size_t *numdelfds)
|
||||
{
|
||||
struct fd_lookup_st *curr;
|
||||
|
||||
*numaddfds = ctx->numadd;
|
||||
*numdelfds = ctx->numdel;
|
||||
if (addfd == NULL && delfd == NULL)
|
||||
return 1;
|
||||
|
||||
curr = ctx->fds;
|
||||
|
||||
while (curr != NULL) {
|
||||
/* We ignore fds that have been marked as both added and deleted */
|
||||
if (curr->del && !curr->add && (delfd != NULL)) {
|
||||
*delfd = curr->fd;
|
||||
delfd++;
|
||||
}
|
||||
if (curr->add && !curr->del && (addfd != NULL)) {
|
||||
*addfd = curr->fd;
|
||||
addfd++;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key)
|
||||
{
|
||||
struct fd_lookup_st *curr;
|
||||
|
||||
curr = ctx->fds;
|
||||
while (curr != NULL) {
|
||||
if (curr->del) {
|
||||
/* This one has been marked deleted already so do nothing */
|
||||
curr = curr->next;
|
||||
continue;
|
||||
}
|
||||
if (curr->key == key) {
|
||||
/*
|
||||
* Mark it as deleted. We don't call cleanup if explicitly asked
|
||||
* to clear an fd. We assume the caller is going to do that
|
||||
*/
|
||||
curr->del = 1;
|
||||
ctx->numdel++;
|
||||
return 1;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx)
|
||||
{
|
||||
struct fd_lookup_st *curr, *prev = NULL;
|
||||
|
||||
ctx->numadd = 0;
|
||||
ctx->numdel = 0;
|
||||
|
||||
curr = ctx->fds;
|
||||
|
||||
while (curr != NULL) {
|
||||
if (curr->del) {
|
||||
if (prev == NULL)
|
||||
ctx->fds = curr->next;
|
||||
else
|
||||
prev->next = curr->next;
|
||||
OPENSSL_free(curr);
|
||||
if (prev == NULL)
|
||||
curr = ctx->fds;
|
||||
else
|
||||
curr = prev->next;
|
||||
continue;
|
||||
}
|
||||
if (curr->add) {
|
||||
curr->add = 0;
|
||||
}
|
||||
prev = curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
LIBS=../../libcrypto
|
||||
SOURCE[../../libcrypto]=\
|
||||
async.c async_err.c arch/async_posix.c arch/async_win.c arch/async_null.c
|
||||
async.c async_wait.c async_err.c arch/async_posix.c arch/async_win.c \
|
||||
arch/async_null.c
|
||||
|
@ -0,0 +1,125 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ASYNC_WAIT_CTX_new, ASYNC_WAIT_CTX_free, ASYNC_WAIT_CTX_set_wait_fd,
|
||||
ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
ASYNC_WAIT_CTX_get_changed_fds, ASYNC_WAIT_CTX_clear_fd - functions to manage
|
||||
waiting for asynchronous jobs to complete
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/async.h>
|
||||
|
||||
ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void);
|
||||
void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx);
|
||||
int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD fd,
|
||||
void *custom_data,
|
||||
void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
|
||||
OSSL_ASYNC_FD, void *));
|
||||
int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD *fd, void **custom_data);
|
||||
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
|
||||
size_t *numfds);
|
||||
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
|
||||
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
|
||||
size_t *numdelfds);
|
||||
int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
For an overview of how asynchronous operations are implemented in OpenSSL see
|
||||
L<ASYNC_start_job(3)>. An ASYNC_WAIT_CTX object represents an asynchronous
|
||||
"session", i.e. a related set of crypto operations. For example in SSL terms
|
||||
this would have a one-to-one correspondence with an SSL connection.
|
||||
|
||||
Application code must create an ASYNC_WAIT_CTX using the ASYNC_WAIT_CTX_new()
|
||||
function prior to calling ASYNC_start_job() (see L<ASYNC_start_job(3)>). When
|
||||
the job is started it is associated with the ASYNC_WAIT_CTX for the duration of
|
||||
that job. An ASYNC_WAIT_CTX should only be used for one ASYNC_JOB at any one
|
||||
time, but can be reused after an ASYNC_JOB has finished for a subsequent
|
||||
ASYNC_JOB. When the session is complete (e.g. the SSL connection is closed),
|
||||
application code cleans up with ASYNC_WAIT_CTX_free().
|
||||
|
||||
ASYNC_WAIT_CTXs can have "wait" file descriptors associated with them. Calling
|
||||
ASYNC_WAIT_CTX_get_all_fds() and passing in a pointer to an ASYNC_WAIT_CTX in
|
||||
the B<ctx> parameter will return the wait file descriptors associated with that
|
||||
job in B<*fd>. The number of file descriptors returned will be stored in
|
||||
B<*numfds>. It is the caller's responsibility to ensure that sufficient memory
|
||||
has been allocated in B<*fd> to receive all the file descriptors. Calling
|
||||
ASYNC_WAIT_CTX_get_all_fds() with a NULL B<fd> value will return no file
|
||||
descriptors but will still populate B<*numfds>. Therefore application code is
|
||||
typically expected to call this function twice: once to get the number of fds,
|
||||
and then again when sufficient memory has been allocated. If only one
|
||||
asynchronous engine is being used then noramlly this call will only ever return
|
||||
one fd. If multiple asynchronous engines are being used then more could be
|
||||
returned.
|
||||
|
||||
The function ASYNC_WAIT_CTX_fds_have_changed() can be used to detect if any fds
|
||||
have changed since the last call time ASYNC_start_job() returned an ASYNC_PAUSE
|
||||
result (or since the ASYNC_WAIT_CTX was created if no ASYNC_PAUSE result has
|
||||
been received). The B<numaddfds> and B<numdelfds> parameters will be populated
|
||||
with the number of fds added or deleted respectively. B<*addfd> and B<*delfd>
|
||||
will be populated with the list of added and deleted fds respectively. Similarly
|
||||
to ASYNC_WAIT_CTX_get_all_fds() either of these can be NULL, but if they are not
|
||||
NULL then the caller is responsible for ensuring sufficient memory is allocated.
|
||||
|
||||
Implementors of async aware code (e.g. engines) are encouraged to return a
|
||||
stable fd for the lifetime of the ASYNC_WAIT_CTX in order to reduce the "churn"
|
||||
of regularly changing fds - although no guarantees of this are provided to
|
||||
applications.
|
||||
|
||||
Applications can wait for the file descriptor to be ready for "read" using a
|
||||
system function call such as select or poll (being ready for "read" indicates
|
||||
that the job should be resumed). If no file descriptor is made available then an
|
||||
application will have to periodically "poll" the job by attempting to restart it
|
||||
to see if it is ready to continue.
|
||||
|
||||
Async aware code (e.g. engines) can get the current ASYNC_WAIT_CTX from the job
|
||||
via L<ASYNC_get_async_wait_ctx(3)> and provide a file descriptor to use for
|
||||
waiting on by calling ASYNC_WAIT_CTX_set_wait_fd(). Typically this would be done
|
||||
by an engine immediately prior to calling ASYNC_pause_job() and not by end user
|
||||
code. An existing association with a file descriptor can be obtained using
|
||||
ASYNC_WAIT_CTX_get_fd() and cleared using ASYNC_WAIT_CTX_clear_fd(). Both of
|
||||
these functions requires a B<key> value which is unique to the async aware code.
|
||||
This could be any unique value but a good candidate might be the B<ENGINE *> for
|
||||
the engine. The B<custom_data> parameter can be any value, and will be returned
|
||||
in a subsequent call to ASYNC_WAIT_CTX_get_fd(). The
|
||||
ASYNC_WAIT_CTX_set_wait_fd() function also expects a pointer to a "cleanup"
|
||||
routine. This can be NULL but if provided will automatically get called when the
|
||||
ASYNC_WAIT_CTX is freed, and gives the engine the opportunity to close the fd or
|
||||
any other resources.
|
||||
|
||||
An example of typical usage might be an async capable engine. User code would
|
||||
initiate cryptographic operations. The engine would initiate those operations
|
||||
asynchronously and then call ASYNC_WAIT_CTX_set_wait_fd() followed by
|
||||
ASYNC_pause_job() to return control to the user code. The user code can then
|
||||
perform other tasks or wait for the job to be ready by calling "select" or other
|
||||
similar function on the wait file descriptor. The engine can signal to the user
|
||||
code that the job should be resumed by making the wait file descriptor
|
||||
"readable". Once resumed the engine should clear the wake signal on the wait
|
||||
file descriptor.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ASYNC_WAIT_CTX_new() returns a pointer to the newly allocated ASYNC_WAIT_CTX or
|
||||
NULL on error.
|
||||
|
||||
ASYNC_WAIT_CTX_set_wait_fd, ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
ASYNC_WAIT_CTX_get_changed_fds and ASYNC_WAIT_CTX_clear_fd all return 1 on
|
||||
success or 0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<crypto(3)>, L<ASYNC_start_job(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
ASYNC_WAIT_CTX_new, ASYNC_WAIT_CTX_free, ASYNC_WAIT_CTX_set_wait_fd,
|
||||
ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
ASYNC_WAIT_CTX_get_changed_fds, ASYNC_WAIT_CTX_clear_fd were first added to
|
||||
OpenSSL 1.1.0.
|
||||
|
||||
=cut
|
@ -0,0 +1,65 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SSL_waiting_for_async, SSL_get_all_async_fds, SSL_get_changed_async_fds - manage
|
||||
asynchronous operations
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
int SSL_waiting_for_async(SSL *s);
|
||||
int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fd, size_t *numfds);
|
||||
int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, size_t *numaddfds,
|
||||
OSSL_ASYNC_FD *delfd, size_t *numdelfds);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SSL_waiting_for_async() determines whether an SSL connection is currently
|
||||
waiting for asynchronous operations to complete (see the SSL_MODE_ASYNC mode in
|
||||
L<SSL_CTX_set_mode(3)>).
|
||||
|
||||
SSL_get_all_async_fds() returns a list of file descriptor which can be used in a
|
||||
call to select() or poll() to determine whether the current asynchronous
|
||||
operation has completed or not. A completed operation will result in data
|
||||
appearing as "read ready" on the file descriptor (no actual data should be read
|
||||
from the file descriptor). This function should only be called if the SSL object
|
||||
is currently waiting for asynchronous work to complete (i.e.
|
||||
SSL_ERROR_WANT_ASYNC has been received - see L<SSL_get_error(3)>). Typically the
|
||||
list will only contain one file descriptor. However if multiple asynchronous
|
||||
capable engines are in use then more than one is possible. The number of file
|
||||
descriptors returned is stored in B<*numfds> and the file descriptors themselves
|
||||
are in B<*fds>. The B<fds> parameter may be NULL in which case no file
|
||||
descriptors are returned but B<*numfds> is still populated. It is the callers
|
||||
responsibility to ensure sufficient memory is allocated at B<*fds> so typically
|
||||
this function is called twice (once with a NULL B<fds> parameter and once
|
||||
without).
|
||||
|
||||
SSL_get_changed_async_fds() returns a list of the asynchronous file descriptors
|
||||
that have been added and a list that have been deleted since the last
|
||||
SSL_ERROR_WANT_ASYNC was received (or since the SSL object was created if no
|
||||
SSL_ERROR_WANT_ASYNC has been received). Similar to SSL_get_all_async_fds() it
|
||||
is the callers responsibility to ensure that B<*addfd> and B<*delfd> have
|
||||
sufficient memory allocated, although they may be NULL. The number of added fds
|
||||
and the number of deleted fds are stored in B<*numaddfds> and B<*numdelfds>
|
||||
respectively.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
SSL_waiting_for_async() will return 1 if the current SSL operation is waiting
|
||||
for an async operation to complete and 0 otherwise.
|
||||
|
||||
SSL_get_all_async_fds() and SSL_get_changed_async_fds() return 1 on success or
|
||||
0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<SSL_get_error(3)>, L<SSL_CTX_set_mode(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
SSL_waiting_for_async(), SSL_get_all_async_fds() and SSL_get_changed_async_fds()
|
||||
were first added to OpenSSL 1.1.0.
|
||||
|
||||
=cut
|
@ -1,45 +0,0 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SSL_waiting_for_async, SSL_get_async_wait_fd - manage asynchronous operations
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
int SSL_waiting_for_async(SSL *s);
|
||||
int SSL_get_async_wait_fd(SSL *s);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SSL_waiting_for_async() determines whether an SSL connection is currently
|
||||
waiting for asynchronous operations to complete (see the SSL_MODE_ASYNC mode in
|
||||
L<SSL_CTX_set_mode(3)>).
|
||||
|
||||
SSL_get_async_wait_fd() returns a file descriptor which can be used in a call to
|
||||
select() or poll() to determine whether the current asynchronous operation has
|
||||
completed or not. A completed operation will result in data appearing as
|
||||
"read ready" on the file descriptor (no actual data should be read from the
|
||||
file descriptor). This function should only be called if the SSL object is
|
||||
currently waiting for asynchronous work to complete (i.e. SSL_ERROR_WANT_ASYNC
|
||||
has been received - see L<SSL_get_error(3)>).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
SSL_waiting_for_async() will return 1 if the current SSL operation is waiting
|
||||
for an async operation to complete and 0 otherwise.
|
||||
|
||||
SSL_get_async_wait_fd() will return a file descriptor that can be used in a call
|
||||
to select() or poll() to wait for asynchronous work to complete, or -1 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<SSL_get_error(3)>, L<SSL_CTX_set_mode(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
SSL_waiting_for_async() and SSL_get_async_wait_fd() were first added to
|
||||
OpenSSL 1.1.0
|
||||
|
||||
=cut
|