summaryrefslogtreecommitdiffstats
path: root/ssl_backend.h
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-06-28 09:47:52 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-21 10:53:32 +0200
commitdd5e1102c1a2a431510be3e5a179c6e264d8f913 (patch)
tree479b40ad6310822a5c58a5a766b6ab2992b98fe1 /ssl_backend.h
parent963ad54e53c1fc1b701a9c62231b011243321cef (diff)
downloadopenvpn-dd5e1102c1a2a431510be3e5a179c6e264d8f913.tar.gz
openvpn-dd5e1102c1a2a431510be3e5a179c6e264d8f913.tar.xz
openvpn-dd5e1102c1a2a431510be3e5a179c6e264d8f913.zip
Refactored key_state read code (including bio_read())
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: James Yonan <james@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'ssl_backend.h')
-rw-r--r--ssl_backend.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/ssl_backend.h b/ssl_backend.h
index 7023e60..9883c40 100644
--- a/ssl_backend.h
+++ b/ssl_backend.h
@@ -294,6 +294,65 @@ void key_state_ssl_init(struct key_state_ssl *ks_ssl,
*/
void key_state_ssl_free(struct key_state_ssl *ks_ssl);
+/**************************************************************************/
+/** @addtogroup control_tls
+ * @{ */
+
+/** @name Functions for packets to be sent to a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Extract ciphertext data from the TLS module.
+ *
+ * If the \a buf buffer has a length other than zero, this function does
+ * not perform any action and returns 0.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - A buffer in which to store the ciphertext.
+ * @param maxlen - The maximum number of bytes to extract.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: Data was extracted successfully.
+ * - \c 0: No data was extracted, this function should be called again
+ * later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_read_ciphertext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen);
+
+/** @} name Functions for packets to be sent to a remote OpenVPN peer */
+
+
+/** @name Functions for packets received from a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Extract plaintext data from the TLS module.
+ *
+ * If the \a buf buffer has a length other than zero, this function does
+ * not perform any action and returns 0.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - A buffer in which to store the plaintext.
+ * @param maxlen - The maximum number of bytes to extract.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: Data was extracted successfully.
+ * - \c 0: No data was extracted, this function should be called again
+ * later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_read_plaintext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen);
+
+/** @} name Functions for packets received from a remote OpenVPN peer */
+
+/** @} addtogroup control_tls */
+
/* **************************************
*
* Information functions