You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: server-state-machine.go
    path of file: ./repos/kubeedge/vendor/github.com/bifurcation/mint
    
    the code of the file until where you have to start completion: package mint

import (
	"bytes"
	"crypto/x509"
	"fmt"
	"hash"
	"reflect"

	"github.com/bifurcation/mint/syntax"
)

// Server State Machine
//
//                              START <-----+
//               Recv ClientHello |         | Send HelloRetryRequest
//                                v         |
//                             RECVD_CH ---
    
func (state serverStateReadPastEarlyData) Next(hr handshakeMessageReader) (HandshakeState, []HandshakeAction, Alert) {
	for {
		logf(logTypeHandshake, "Server reading past early data...")
		// Scan past all records that fail to decrypt
		_, err := state.hsCtx.hIn.conn.PeekRecordType(!state.hsCtx.hIn.nonblocking)
		if err == nil {
			break
		}

		if err == AlertWouldBlock {
			return nil, nil, AlertWouldBlock
		}

		// Continue on DecryptError
		_, ok := err.(DecryptError)
		if !ok {
			return nil, nil, AlertInternalError // Really need something else.
		}
	}

	return *state.next, nil, AlertNoAlert
}