Check-in [366542d9a0]
Overview
Comment: * tls.c (StatusObjCmd): memleak: free peer if loaded. [Bug 3041925]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 366542d9a07b2f8082c8cc3d50a8eb3bb6a691f9
User & Date: hobbs2 on 2010-08-11 19:50:50
Other Links: manifest | tags
Context
2010-08-11
19:52
brace TESTFLAGS in make test check-in: cceaa397bc user: hobbs2 tags: trunk
19:50
* tls.c (StatusObjCmd): memleak: free peer if loaded. [Bug 3041925] check-in: 366542d9a0 user: hobbs2 tags: trunk
2010-07-27
17:15
* tls.tcl (tls::socket): some socket implementations have a -type support (e.g. for inet6). check-in: 119a8780e7 user: hobbs2 tags: trunk
Changes

Modified ChangeLog from [4ec4d039e1] to [d4cd3e5338].





1
2
3
4
5
6
7




2010-07-27  Jeff Hobbs  <[email protected]>

	* tls.tcl (tls::socket): some socket implementations have a -type
	support (e.g. for inet6).

2009-04-23  Jeff Hobbs  <[email protected]>

>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
2010-08-11  Jeff Hobbs  <[email protected]>

	* tls.c (StatusObjCmd): memleak: free peer if loaded. [Bug 3041925]

2010-07-27  Jeff Hobbs  <[email protected]>

	* tls.tcl (tls::socket): some socket implementations have a -type
	support (e.g. for inet6).

2009-04-23  Jeff Hobbs  <[email protected]>

Modified tls.c from [863315bd45] to [510496cc5c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Copyright (C) 1997-1999 Matt Newman <[email protected]>
 * some modifications:
 *	Copyright (C) 2000 Ajuba Solutions
 *	Copyright (C) 2002 ActiveState Corporation
 *	Copyright (C) 2004 Starfish Systems 
 *
 * $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.c,v 1.30 2008/03/19 22:06:13 hobbs2 Exp $
 *
 * TLS (aka SSL) Channel - can be layered on any bi-directional
 * Tcl_Channel (Note: Requires Trf Core Patch)
 *
 * This was built (almost) from scratch based upon observation of
 * OpenSSL 0.9.2B
 *







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Copyright (C) 1997-1999 Matt Newman <[email protected]>
 * some modifications:
 *	Copyright (C) 2000 Ajuba Solutions
 *	Copyright (C) 2002 ActiveState Corporation
 *	Copyright (C) 2004 Starfish Systems 
 *
 * $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.c,v 1.31 2010/08/11 19:50:50 hobbs2 Exp $
 *
 * TLS (aka SSL) Channel - can be layered on any bi-directional
 * Tcl_Channel (Note: Requires Trf Core Patch)
 *
 * This was built (almost) from scratch based upon observation of
 * OpenSSL 0.9.2B
 *
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156

1157
1158

1159
1160
1161
1162
1163
1164
1165
	chan = Tcl_GetTopChannel(chan);
    }
    if (Tcl_GetChannelType(chan) != Tls_ChannelType()) {
	Tcl_AppendResult(interp, "bad channel \"", Tcl_GetChannelName(chan),
		"\": not a TLS channel", NULL);
	return TCL_ERROR;
    }
    statePtr	= (State *) Tcl_GetChannelInstanceData(chan);
    if (objc == 2)
	peer	= SSL_get_peer_certificate(statePtr->ssl);
    else
	peer	= SSL_get_certificate(statePtr->ssl);

    if (peer) {
	objPtr = Tls_NewX509Obj(interp, peer);

    } else {
	objPtr = Tcl_NewListObj(0, NULL);
    }

    Tcl_ListObjAppendElement (interp, objPtr,
	    Tcl_NewStringObj ("sbits", -1));
    Tcl_ListObjAppendElement (interp, objPtr,







|
|
|
|
|
>


>







1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
	chan = Tcl_GetTopChannel(chan);
    }
    if (Tcl_GetChannelType(chan) != Tls_ChannelType()) {
	Tcl_AppendResult(interp, "bad channel \"", Tcl_GetChannelName(chan),
		"\": not a TLS channel", NULL);
	return TCL_ERROR;
    }
    statePtr = (State *) Tcl_GetChannelInstanceData(chan);
    if (objc == 2) {
	peer = SSL_get_peer_certificate(statePtr->ssl);
    } else {
	peer = SSL_get_certificate(statePtr->ssl);
    }
    if (peer) {
	objPtr = Tls_NewX509Obj(interp, peer);
	if (objc == 2) { X509_free(peer); }
    } else {
	objPtr = Tcl_NewListObj(0, NULL);
    }

    Tcl_ListObjAppendElement (interp, objPtr,
	    Tcl_NewStringObj ("sbits", -1));
    Tcl_ListObjAppendElement (interp, objPtr,