use the non-blocking of mint to cycle through the handshake

This commit is contained in:
Marten Seemann
2017-10-26 18:32:44 +07:00
parent fcc380187a
commit 3e39991e1e
6 changed files with 177 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
package mocks
//go:generate sh -c "mockgen -source=../handshake/mint_utils.go -package mockhandshake -destination handshake/mint_tls.go"
//go:generate sh -c "./mockgen_internal.sh mocks stream_flow_controller.go github.com/lucas-clemente/quic-go/internal/flowcontrol StreamFlowController"
//go:generate sh -c "./mockgen_internal.sh mocks connection_flow_controller.go github.com/lucas-clemente/quic-go/internal/flowcontrol ConnectionFlowController"
//go:generate sh -c "./mockgen_internal.sh mockcrypto crypto/aead.go github.com/lucas-clemente/quic-go/internal/crypto AEAD"

View File

@@ -0,0 +1,71 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../handshake/mint_utils.go
package mockhandshake
import (
reflect "reflect"
mint "github.com/bifurcation/mint"
gomock "github.com/golang/mock/gomock"
)
// MockmintTLS is a mock of mintTLS interface
type MockmintTLS struct {
ctrl *gomock.Controller
recorder *MockmintTLSMockRecorder
}
// MockmintTLSMockRecorder is the mock recorder for MockmintTLS
type MockmintTLSMockRecorder struct {
mock *MockmintTLS
}
// NewMockmintTLS creates a new mock instance
func NewMockmintTLS(ctrl *gomock.Controller) *MockmintTLS {
mock := &MockmintTLS{ctrl: ctrl}
mock.recorder = &MockmintTLSMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (_m *MockmintTLS) EXPECT() *MockmintTLSMockRecorder {
return _m.recorder
}
// GetCipherSuite mocks base method
func (_m *MockmintTLS) GetCipherSuite() mint.CipherSuiteParams {
ret := _m.ctrl.Call(_m, "GetCipherSuite")
ret0, _ := ret[0].(mint.CipherSuiteParams)
return ret0
}
// GetCipherSuite indicates an expected call of GetCipherSuite
func (_mr *MockmintTLSMockRecorder) GetCipherSuite() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "GetCipherSuite", reflect.TypeOf((*MockmintTLS)(nil).GetCipherSuite))
}
// ComputeExporter mocks base method
func (_m *MockmintTLS) ComputeExporter(label string, context []byte, keyLength int) ([]byte, error) {
ret := _m.ctrl.Call(_m, "ComputeExporter", label, context, keyLength)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ComputeExporter indicates an expected call of ComputeExporter
func (_mr *MockmintTLSMockRecorder) ComputeExporter(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "ComputeExporter", reflect.TypeOf((*MockmintTLS)(nil).ComputeExporter), arg0, arg1, arg2)
}
// Handshake mocks base method
func (_m *MockmintTLS) Handshake() mint.Alert {
ret := _m.ctrl.Call(_m, "Handshake")
ret0, _ := ret[0].(mint.Alert)
return ret0
}
// Handshake indicates an expected call of Handshake
func (_mr *MockmintTLSMockRecorder) Handshake() *gomock.Call {
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Handshake", reflect.TypeOf((*MockmintTLS)(nil).Handshake))
}