Check-in [1505883e4a]
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA
Overview
Comment:Changed to send SSL_shutdown as part of BIO close channel handler rather than Tls_Clean.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tls-1.8
Files: files | file ages | folders
SHA3-256: 1505883e4a18b50ec620644ddeea2339c3f6d3b7b1a79fe96685697f366e2969
User & Date: bohagan on 2024-07-01 01:08:10
Other Links: branch diff | manifest | tags
Context
2024-07-01
01:08
Changed to send SSL_shutdown as part of BIO close channel handler rather than Tls_Clean. Leaf check-in: 1505883e4a user: bohagan tags: tls-1.8
2024-06-29
19:21
Backed out changes to provide error status when setting -cadir, -cafile, and -castore options. Breaks IO test cases. check-in: 89536252d5 user: bohagan tags: tls-1.8
Changes

Modified generic/tls.c from [6e62c9c865] to [2cf7b99093].

2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
 *	Frees all the state
 *
 *-------------------------------------------------------------------
 */
void Tls_Clean(State *statePtr) {
    dprintf("Called");

    if (statePtr->ssl) {
	/* Send close_notify message */
	dprintf("SSL_shutdown(%p)", statePtr->ssl);
	/* Will return return 0 while shutdown in process, then 1 when complete */
	/* closes the write direction of the connection; the read direction is closed by the peer. */
	/* Does not affect socket */
	SSL_shutdown(statePtr->ssl);
    }

    /*
     * we're assuming here that we're single-threaded
     */
    if (statePtr->timer != (Tcl_TimerToken) NULL) {
	Tcl_DeleteTimerHandler(statePtr->timer);
	statePtr->timer = NULL;
    }







<
<
<
<
<
<
<
<
<







2820
2821
2822
2823
2824
2825
2826









2827
2828
2829
2830
2831
2832
2833
 *	Frees all the state
 *
 *-------------------------------------------------------------------
 */
void Tls_Clean(State *statePtr) {
    dprintf("Called");










    /*
     * we're assuming here that we're single-threaded
     */
    if (statePtr->timer != (Tcl_TimerToken) NULL) {
	Tcl_DeleteTimerHandler(statePtr->timer);
	statePtr->timer = NULL;
    }

Modified generic/tlsIO.c from [7360e0f9d2] to [bf6e0784e3].

70
71
72
73
74
75
76
77




78



79
80
81
82
83
84
85
 */
static int TlsCloseProc(ClientData instanceData, Tcl_Interp *interp) {
    State *statePtr = (State *) instanceData;

    dprintf("TlsCloseProc(%p)", (void *) statePtr);

    /* Flush any pending data */





    Tls_Clean(statePtr);



    Tcl_EventuallyFree((ClientData)statePtr, Tls_Free);
    return 0;
}

/*
 *-----------------------------------------------------------------------------
 *







|
>
>
>
>
|
>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 */
static int TlsCloseProc(ClientData instanceData, Tcl_Interp *interp) {
    State *statePtr = (State *) instanceData;

    dprintf("TlsCloseProc(%p)", (void *) statePtr);

    /* Flush any pending data */
    
    /* Send shutdown notification. Will return 0 while in process, then 1 when complete. */
    /* Closes the write direction of the connection; the read direction is closed by the peer. */
    /* Does not affect socket state. */
    if (statePtr->ssl != NULL) {
	SSL_shutdown(statePtr->ssl);
    }

    /* Tls_Free calls Tls_Clean */
    Tcl_EventuallyFree((ClientData)statePtr, Tls_Free);
    return 0;
}

/*
 *-----------------------------------------------------------------------------
 *