diff --git a/ManagedOpenSsl/Core/Native.cs b/ManagedOpenSsl/Core/Native.cs index e0d4138..9a102f2 100644 --- a/ManagedOpenSsl/Core/Native.cs +++ b/ManagedOpenSsl/Core/Native.cs @@ -2120,6 +2120,9 @@ public static int SSL_CTX_get_options(IntPtr ctx) [DllImport(SSLDLLNAME)] public extern static int SSL_state(IntPtr ssl); + [DllImport(SSLDLLNAME)] + public extern static void SSL_set_read_ahead(IntPtr ssl, int yes); + #endregion #endregion diff --git a/ManagedOpenSsl/Ssl.cs b/ManagedOpenSsl/Ssl.cs index d26c1eb..adae0c8 100644 --- a/ManagedOpenSsl/Ssl.cs +++ b/ManagedOpenSsl/Ssl.cs @@ -266,8 +266,7 @@ public SslState State set { int offset = (int)Marshal.OffsetOf(typeof(ssl_st), "state"); - IntPtr offset_ptr = new IntPtr((int)this.ptr + offset); - Marshal.WriteInt32(offset_ptr, (int) value); + Marshal.WriteInt32(this.ptr, offset, (int) value); } } @@ -371,7 +370,7 @@ public int Renegotiate() public int DoHandshake() { - return Native.SSL_do_handshake(this.ptr); + return Native.SSL_do_handshake(this.ptr); } public void SetAcceptState() @@ -404,6 +403,11 @@ public string StateStringLong() return Marshal.PtrToStringAnsi(Native.SSL_state_string_long(this.ptr)); } + public void SetReadAhead(int yes) + { + Native.SSL_set_read_ahead(this.ptr, yes); + } + public int Clear() { return Native.ExpectSuccess(Native.SSL_clear(this.ptr)); diff --git a/ManagedOpenSsl/SslContext.cs b/ManagedOpenSsl/SslContext.cs index 6efbe35..5163b23 100644 --- a/ManagedOpenSsl/SslContext.cs +++ b/ManagedOpenSsl/SslContext.cs @@ -104,8 +104,7 @@ private struct SSL_CTX public IntPtr default_verify_callback; //int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx) public IntPtr generate_session_id; //typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,unsigned int *id_len); #region X509_VERIFY_PARAM - public IntPtr x509_verify_param_name; - public long x509_verify_param_check_time; + public IntPtr x509_verify_param_name; public long x509_verify_param_check_time; public int x509_verify_param_inh_flags; public int x509_verify_param_flags; public int x509_verify_param_purpose;