Check-in [986ea5b483]
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA
Overview
Comment:Ensure minimum buffer size for encryption channel.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | crypto
Files: files | file ages | folders
SHA3-256: 986ea5b483ed1ddde0e907d0352608cd810f22c4f2bc9d406fa4598883befb49
User & Date: bohagan on 2024-05-19 20:54:37
Other Links: branch diff | manifest | tags
Context
2024-05-19
21:56
Removed obsolete unstack commands from digest and encrypt modules. check-in: 8ae6d68bc3 user: bohagan tags: crypto
20:54
Ensure minimum buffer size for encryption channel. check-in: 986ea5b483 user: bohagan tags: crypto
20:15
Fixed bug in update and finalize handlers for encrypt using accumulator command. check-in: 9bcee7c0e7 user: bohagan tags: crypto
Changes

Modified generic/tlsEncrypt.c from [8d7af4c409] to [e1aafa1002].

801
802
803
804
805
806
807



808
809
810
811
812
813
814
    }

    /* Make sure to operate on the topmost channel */
    chan = Tcl_GetTopChannel(chan);

    /* Configure channel */
    Tcl_SetChannelOption(interp, chan, "-translation", "binary");




    /* Create state data structure */
    if ((statePtr = EncryptStateNew(interp, type)) == NULL) {
	Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL);
	return TCL_ERROR;
    }
    statePtr->self = chan;







>
>
>







801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
    }

    /* Make sure to operate on the topmost channel */
    chan = Tcl_GetTopChannel(chan);

    /* Configure channel */
    Tcl_SetChannelOption(interp, chan, "-translation", "binary");
    if (Tcl_GetChannelBufferSize(chan) < EVP_MAX_BLOCK_LENGTH) {
	Tcl_SetChannelBufferSize(chan, EVP_MAX_BLOCK_LENGTH);
    }

    /* Create state data structure */
    if ((statePtr = EncryptStateNew(interp, type)) == NULL) {
	Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL);
	return TCL_ERROR;
    }
    statePtr->self = chan;
823
824
825
826
827
828
829


830
831
832
833
834
835
836
837
838
    /* Stack channel */
    statePtr->self = Tcl_StackChannel(interp, &encryptChannelType, (ClientData) statePtr, mode, chan);
    if (statePtr->self == (Tcl_Channel) NULL) {
	EncryptStateFree(statePtr);
	return TCL_ERROR;
    }



    /* Set result to channel Id */
    Tcl_SetResult(interp, (char *) Tcl_GetChannelName(chan), TCL_VOLATILE);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Unstack Channel --







>
>

|







826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
    /* Stack channel */
    statePtr->self = Tcl_StackChannel(interp, &encryptChannelType, (ClientData) statePtr, mode, chan);
    if (statePtr->self == (Tcl_Channel) NULL) {
	EncryptStateFree(statePtr);
	return TCL_ERROR;
    }

    dprintf("Created channel named %s", Tcl_GetChannelName(statePtr->self));

    /* Set result to channel Id */
    Tcl_SetResult(interp, (char *) Tcl_GetChannelName(statePtr->self), TCL_VOLATILE);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Unstack Channel --