aboutsummaryrefslogtreecommitdiff
path: root/include/crypto/tlssession.h
diff options
context:
space:
mode:
authorAntoine Damhet <antoine.damhet@shadow.tech>2022-11-15 15:23:28 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2023-02-15 11:01:03 -0500
commit33ee0d8e2fb5e7772a67c8785554ec9fc9477678 (patch)
tree7750cd30780d8cb0d2c2af92728bfbc38769b5d1 /include/crypto/tlssession.h
parent6a50f64ca01d0a7b97f14f069762bfd88160f31e (diff)
downloadqemu-33ee0d8e2fb5e7772a67c8785554ec9fc9477678.zip
qemu-33ee0d8e2fb5e7772a67c8785554ec9fc9477678.tar.gz
qemu-33ee0d8e2fb5e7772a67c8785554ec9fc9477678.tar.bz2
crypto: TLS: introduce `check_pending`
The new `qcrypto_tls_session_check_pending` function allows the caller to know if data have already been consumed from the backend and is already available. Signed-off-by: Antoine Damhet <antoine.damhet@shadow.tech> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'include/crypto/tlssession.h')
-rw-r--r--include/crypto/tlssession.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/crypto/tlssession.h b/include/crypto/tlssession.h
index 15b9cef..571049b 100644
--- a/include/crypto/tlssession.h
+++ b/include/crypto/tlssession.h
@@ -249,6 +249,17 @@ ssize_t qcrypto_tls_session_read(QCryptoTLSSession *sess,
size_t len);
/**
+ * qcrypto_tls_session_check_pending:
+ * @sess: the TLS session object
+ *
+ * Check if there are unread data in the TLS buffers that have
+ * already been read from the underlying data source.
+ *
+ * Returns: the number of bytes available or zero
+ */
+size_t qcrypto_tls_session_check_pending(QCryptoTLSSession *sess);
+
+/**
* qcrypto_tls_session_handshake:
* @sess: the TLS session object
* @errp: pointer to a NULL-initialized error object