aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/jnetlib/sslconnection.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/jnetlib/sslconnection.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/replicant/jnetlib/sslconnection.h')
-rw-r--r--Src/replicant/jnetlib/sslconnection.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/Src/replicant/jnetlib/sslconnection.h b/Src/replicant/jnetlib/sslconnection.h
new file mode 100644
index 00000000..f6e54d05
--- /dev/null
+++ b/Src/replicant/jnetlib/sslconnection.h
@@ -0,0 +1,61 @@
+/*
+** JNetLib
+** Copyright (C) 2000-2006 CockOS, Inc.
+** Author: Justin Frankel, Joshua Teitelbaum
+** File: sslconnection.h - JNL SSL TCP connection interface
+** License: see jnetlib.h
+*/
+
+#ifndef _JNETLIB_SSL_H_
+#define _JNETLIB_SSL_H_
+
+#include "netinc.h"
+#include "util.h"
+#include "connection.h"
+
+/*
+** AUTOLINK WITH THESE GUYS NOT IN PROJECT HEH HEH :)
+** Build and go, for you :)
+*/
+
+#include <openssl/ssl.h>
+
+class JNL_SSL_Connection : public JNL_Connection
+{
+protected:
+ SSL *m_ssl;
+ bool m_bcontextowned;
+ bool m_bsslinit;
+
+public:
+ JNL_SSL_Connection();
+ JNL_SSL_Connection( SSL *pssl, JNL_AsyncDNS *dns, size_t sendbufsize, size_t recvbufsize );
+ virtual ~JNL_SSL_Connection();
+
+ virtual void connect( SOCKET sock, sockaddr *addr, socklen_t length /* of addr */ ); // used by the listen object, usually not needed by users.
+ virtual void run( size_t max_send_bytes = -1, size_t max_recv_bytes = -1, size_t *bytes_sent = NULL, size_t *bytes_rcvd = NULL );
+
+ /*
+ ** Joshua Teitelbaum 1/27/2006 Adding new BSD socket analogues for SSL compatibility
+ */
+protected:
+ virtual void socket_shutdown();
+ virtual ssize_t socket_recv( char *buf, size_t len, int options );
+ virtual ssize_t socket_send( const char *buf, size_t len, int options );
+ virtual int socket_connect();
+ virtual void on_socket_connected();
+ /*
+ ** init_ssl_connection:
+ ** returns true if can continue onwards (could be error, in which case
+ ** we want the error to cascade through).
+ ** Else, false if connection was not made, and we have to call this
+ ** again.
+ */
+ bool init_ssl_connection();
+
+ bool forceConnect;
+};
+
+extern SSL_CTX *sslContext;
+
+#endif