1
2
3
4
5
6
7
8
9
10
11
|
/*
* Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com>
*
* $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tlsInt.h,v 1.6 2000/08/15 00:02:08 hobbs Exp $
*
* TLS (aka SSL) Channel - can be layered on any bi-directional
* Tcl_Channel (Note: Requires Trf Core Patch)
*
* This was built from scratch based upon observation of OpenSSL 0.9.2B
*
* Addition credit is due for Andreas Kupries (a.kupries@westend.com), for
|
|
|
1
2
3
4
5
6
7
8
9
10
11
|
/*
* Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com>
*
* $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tlsInt.h,v 1.7 2000/08/15 18:49:31 hobbs Exp $
*
* TLS (aka SSL) Channel - can be layered on any bi-directional
* Tcl_Channel (Note: Requires Trf Core Patch)
*
* This was built from scratch based upon observation of OpenSSL 0.9.2B
*
* Addition credit is due for Andreas Kupries (a.kupries@westend.com), for
|
︙ | | | ︙ | |
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
BIO *bio; /* Struct for SSL processing */
BIO *p_bio; /* Parent BIO (that is layered on Tcl_Channel) */
char *err;
} State;
/*
* The following definitions have to be usable for 8.0.x, 8.1.x, 8.2.x,
* 8.3.[01], 8.3.2 and beyond. The differences between these versions:
*
* 8.0-8.1: There is no support for these in TLS 1.4 (get 1.3). This
* was the version with the original patch.
*
* 8.2.0- Changed semantics for Tcl_StackChannel (Tcl_ReplaceChannel).
* 8.3.1: Check at runtime to switch the behaviour. The patch is part
* of the core from now on.
*
* 8.3.2+: Stacked channels rewritten for better behaviour in some
* situations (closing). Some new API's, semantic changes.
*
* The following magic was taken from Trf 2.1 (Kupries).
*/
#define TLS_CHANNEL_VERSION_1 0x1
#define TLS_CHANNEL_VERSION_2 0x2
extern int channelTypeVersion;
#ifdef USE_TCL_STUBS
|
|
|
|
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
BIO *bio; /* Struct for SSL processing */
BIO *p_bio; /* Parent BIO (that is layered on Tcl_Channel) */
char *err;
} State;
/*
* The following definitions have to be usable for 8.2.0-8.3.1 and 8.3.2+.
* The differences between these versions:
*
* 8.0-8.1: There is no support for these in TLS 1.4 (get 1.3). This
* was the version with the original patch.
*
* 8.2.0- Changed semantics for Tcl_StackChannel (Tcl_ReplaceChannel).
* 8.3.1: Check at runtime to switch the behaviour. The patch is part
* of the core from now on.
*
* 8.3.2+: Stacked channels rewritten for better behaviour in some
* situations (closing). Some new API's, semantic changes.
*
* The following magic was adapted from Trf 2.1 (Kupries).
*/
#define TLS_CHANNEL_VERSION_1 0x1
#define TLS_CHANNEL_VERSION_2 0x2
extern int channelTypeVersion;
#ifdef USE_TCL_STUBS
|
︙ | | | ︙ | |
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
typedef Tcl_Channel (tls_GetStackedChannel) _ANSI_ARGS_((Tcl_Channel chan));
#define Tcl_GetStackedChannel ((tls_GetStackedChannel*) tclStubsPtr->reserved283)
#endif /* Tcl_GetStackedChannel */
#ifndef Tcl_WriteRaw
/*
* Core is older than 8.3.2. Supply the missing definitions for
* the new API's in 8.3.2.
*/
/* 394 */
typedef int (tls_ReadRaw) _ANSI_ARGS_((Tcl_Channel chan, char *dst,
int bytesToRead));
/* 395 */
typedef int (tls_WriteRaw) _ANSI_ARGS_((Tcl_Channel chan, char *src,
int srcLen));
/* 397 */
|
|
>
>
>
>
>
>
|
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
typedef Tcl_Channel (tls_GetStackedChannel) _ANSI_ARGS_((Tcl_Channel chan));
#define Tcl_GetStackedChannel ((tls_GetStackedChannel*) tclStubsPtr->reserved283)
#endif /* Tcl_GetStackedChannel */
#ifndef TCL_CHANNEL_VERSION_2
/*
* Core is older than 8.3.2. Supply the missing definitions for
* the new API's in 8.3.2.
*/
#define EMULATE_CHANNEL_VERSION_2
typedef struct TlsChannelTypeVersion_* TlsChannelTypeVersion;
#define TCL_CHANNEL_VERSION_2 ((TlsChannelTypeVersion) 0x2)
typedef int (TlsDriverHandlerProc) _ANSI_ARGS_((ClientData instanceData,
int interestMask));
/* 394 */
typedef int (tls_ReadRaw) _ANSI_ARGS_((Tcl_Channel chan, char *dst,
int bytesToRead));
/* 395 */
typedef int (tls_WriteRaw) _ANSI_ARGS_((Tcl_Channel chan, char *src,
int srcLen));
/* 397 */
|
︙ | | | ︙ | |
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
#define IDX(n) (((n)-370) * procPtrSize)
#define SLOT(n) (STUB_BASE + IDX(n))
#define Tcl_ReadRaw (*((tls_ReadRaw**) (SLOT(394))))
#define Tcl_WriteRaw (*((tls_WriteRaw**) (SLOT(395))))
#define Tcl_GetTopChannel (*((tls_GetTopChannel**)(SLOT(396))))
typedef struct TlsChannelTypeVersion_* TlsChannelTypeVersion;
#define TCL_CHANNEL_VERSION_2 ((TlsChannelTypeVersion) 0x2)
/*
* Required, easy emulation.
*/
#define Tcl_ChannelGetOptionProc(chanDriver) ((chanDriver)->getOptionProc)
#endif /* Tcl_WriteRaw */
#endif /* USE_TCL_STUBS */
/*
* Forward declarations
*/
|
<
<
<
|
|
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
#define IDX(n) (((n)-370) * procPtrSize)
#define SLOT(n) (STUB_BASE + IDX(n))
#define Tcl_ReadRaw (*((tls_ReadRaw**) (SLOT(394))))
#define Tcl_WriteRaw (*((tls_WriteRaw**) (SLOT(395))))
#define Tcl_GetTopChannel (*((tls_GetTopChannel**)(SLOT(396))))
/*
* Required, easy emulation.
*/
#define Tcl_ChannelGetOptionProc(chanDriver) ((chanDriver)->getOptionProc)
#endif /* TCL_CHANNEL_VERSION_2 */
#endif /* USE_TCL_STUBS */
/*
* Forward declarations
*/
|
︙ | | | ︙ | |