61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
static int UnimportObjCmd _ANSI_ARGS_ ((ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
static SSL_CTX *CTX_Init _ANSI_ARGS_((State *statePtr, int proto, char *key,
char *cert, char *CAdir, char *CAfile, char *ciphers,
char *DHparams));
static int TlsLibInit _ANSI_ARGS_ (()) ;
#define TLS_PROTO_SSL2 0x01
#define TLS_PROTO_SSL3 0x02
#define TLS_PROTO_TLS1 0x04
#define TLS_PROTO_TLS1_1 0x08
#define TLS_PROTO_TLS1_2 0x10
#define ENABLED(flag, mask) (((flag) & (mask)) == (mask))
|
|
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
static int UnimportObjCmd _ANSI_ARGS_ ((ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
static SSL_CTX *CTX_Init _ANSI_ARGS_((State *statePtr, int proto, char *key,
char *cert, char *CAdir, char *CAfile, char *ciphers,
char *DHparams));
static int TlsLibInit _ANSI_ARGS_ ((void)) ;
#define TLS_PROTO_SSL2 0x01
#define TLS_PROTO_SSL3 0x02
#define TLS_PROTO_TLS1 0x04
#define TLS_PROTO_TLS1_1 0x08
#define TLS_PROTO_TLS1_2 0x10
#define ENABLED(flag, mask) (((flag) & (mask)) == (mask))
|
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
/*
* Threaded operation requires locking callbacks
* Based from /crypto/cryptlib.c of OpenSSL and NSOpenSSL.
*/
static Tcl_Mutex locks[CRYPTO_NUM_LOCKS];
static Tcl_Mutex init_mx;
static int initialized;
static void CryptoThreadLockCallback (int mode, int n, const char *file, int line);
static unsigned long CryptoThreadIdCallback (void);
static void
CryptoThreadLockCallback(int mode, int n, const char *file, int line)
{
|
<
|
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
/*
* Threaded operation requires locking callbacks
* Based from /crypto/cryptlib.c of OpenSSL and NSOpenSSL.
*/
static Tcl_Mutex locks[CRYPTO_NUM_LOCKS];
static Tcl_Mutex init_mx;
static void CryptoThreadLockCallback (int mode, int n, const char *file, int line);
static unsigned long CryptoThreadIdCallback (void);
static void
CryptoThreadLockCallback(int mode, int n, const char *file, int line)
{
|
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
|
* initilizes SSL library
*
* Result:
* none
*
*------------------------------------------------------*
*/
static int
TlsLibInit ()
{
int i;
char rnd_seed[16] = "GrzSlplKqUdnnzP!"; /* 16 bytes */
int status=TCL_OK;
#if defined(OPENSSL_THREADS) && defined(TCL_THREADS)
size_t num_locks;
if (initialized) {
|
|
|
<
|
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
|
* initilizes SSL library
*
* Result:
* none
*
*------------------------------------------------------*
*/
static int TlsLibInit (void) {
static int initialized = 0;
int i;
char rnd_seed[16] = "GrzSlplKqUdnnzP!"; /* 16 bytes */
int status=TCL_OK;
#if defined(OPENSSL_THREADS) && defined(TCL_THREADS)
size_t num_locks;
if (initialized) {
|