ANSC_STATUS
TlsHsoClientStateTimerInvoke
    (
        ANSC_HANDLE                 hThisObject
    )
{
    PTLS_HSO_CLIENT_OBJECT          pMyObject          = (PTLS_HSO_CLIENT_OBJECT     )hThisObject;
    PTLS_CBC_INTERFACE              pTlsCbcIf          = (PTLS_CBC_INTERFACE         )pMyObject->hTlsCbcIf;

    return
        pTlsCbcIf->GenerateAlert
            (
                pTlsCbcIf->hOwnerContext,
                TLS_ALERT_LEVEL_fatal,
                TLS_ALERT_DESCR_timeout
            );
}
ANSC_STATUS
TlsCsoRecvChangeCipherSpec
    (
        ANSC_HANDLE                 hThisObject,
        void*                       buffer,
        ULONG                       ulSize
    )
{
    PTLS_CIPHER_SWITCH_OBJECT       pMyObject          = (PTLS_CIPHER_SWITCH_OBJECT  )hThisObject;
    PTLS_CBC_INTERFACE              pTlsCbcIf          = (PTLS_CBC_INTERFACE         )pMyObject->hTlsCbcIf;
    PTLS_CCS_HEADER                 pTlsCcsHeader      = (PTLS_CCS_HEADER            )buffer;

    if ( ulSize != sizeof(TLS_CCS_HEADER) )
    {
        pTlsCbcIf->GenerateAlert
            (
                pTlsCbcIf->hOwnerContext,
                TLS_ALERT_LEVEL_fatal,
                TLS_ALERT_DESCR_unexpectedMessage
            );

        return  ANSC_STATUS_DISCARD;
    }
    else if ( TlsCcsGetType(pTlsCcsHeader) != TLS_CCS_TYPE_changeCipherSpec )
    {
        pTlsCbcIf->GenerateAlert
            (
                pTlsCbcIf->hOwnerContext,
                TLS_ALERT_LEVEL_fatal,
                TLS_ALERT_DESCR_unexpectedMessage
            );

        return  ANSC_STATUS_DISCARD;
    }

    return
        pTlsCbcIf->NotifyEvent
            (
                pTlsCbcIf->hOwnerContext,
                TLS_CBC_EVENT_CCS_RECEIVED,
                TlsCcsGetType(pTlsCcsHeader),
                (ANSC_HANDLE)pTlsCcsHeader
            );
}