@@ -617,9 +617,6 @@ func (PSS PskIdentities) ToPrivate() []pskIdentity {
617617
618618// ClientSessionState is public, but all its fields are private. Let's add setters, getters and constructor
619619
620- // TODO! can we change this enought (or export SessionState),
621- // such that we wouldn't need to fork crypto/tls?
622-
623620// ClientSessionState contains the state needed by clients to resume TLS sessions.
624621func MakeClientSessionState (
625622 SessionTicket []uint8 ,
@@ -679,43 +676,70 @@ func (css *ClientSessionState) VerifiedChains() [][]*x509.Certificate {
679676func (css * ClientSessionState ) SetSessionTicket (SessionTicket []uint8 ) {
680677 css .ticket = SessionTicket
681678}
679+
682680func (css * ClientSessionState ) SetVers (Vers uint16 ) {
683681 if css .session == nil {
684682 css .session = & SessionState {}
685683 }
686684 css .session .version = Vers
687685}
686+
688687func (css * ClientSessionState ) SetCipherSuite (CipherSuite uint16 ) {
689688 if css .session == nil {
690689 css .session = & SessionState {}
691690 }
692691 css .session .cipherSuite = CipherSuite
693692}
693+
694+ func (css * ClientSessionState ) SetCreatedAt (createdAt uint64 ) {
695+ if css .session == nil {
696+ css .session = & SessionState {}
697+ }
698+ css .session .createdAt = createdAt
699+ }
700+
694701func (css * ClientSessionState ) SetMasterSecret (MasterSecret []byte ) {
695702 if css .session == nil {
696703 css .session = & SessionState {}
697704 }
698705 css .session .secret = MasterSecret
699706}
707+
700708func (css * ClientSessionState ) SetEMS (ems bool ) {
701709 if css .session == nil {
702710 css .session = & SessionState {}
703711 }
704712 css .session .extMasterSecret = ems
705713}
714+
706715func (css * ClientSessionState ) SetServerCertificates (ServerCertificates []* x509.Certificate ) {
707716 if css .session == nil {
708717 css .session = & SessionState {}
709718 }
710719 css .session .peerCertificates = ServerCertificates
711720}
721+
712722func (css * ClientSessionState ) SetVerifiedChains (VerifiedChains [][]* x509.Certificate ) {
713723 if css .session == nil {
714724 css .session = & SessionState {}
715725 }
716726 css .session .verifiedChains = VerifiedChains
717727}
718728
729+ func (css * ClientSessionState ) SetUseBy (useBy uint64 ) {
730+ if css .session == nil {
731+ css .session = & SessionState {}
732+ }
733+ css .session .useBy = useBy
734+ }
735+
736+ func (css * ClientSessionState ) SetAgeAdd (ageAdd uint32 ) {
737+ if css .session == nil {
738+ css .session = & SessionState {}
739+ }
740+ css .session .ageAdd = ageAdd
741+ }
742+
719743// TicketKey is the internal representation of a session ticket key.
720744type TicketKey struct {
721745 AesKey [16 ]byte
0 commit comments