From a818134b67ae85ae0a5ba8dec3c4c44a7cd4e6ac Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 7 Jul 2017 18:10:57 -0400 Subject: [PATCH] Simplify ChangeCipherSpec code in runner. Not sure why it was expanded out like that. Change-Id: I6899dbd23130ed7196c45c2784330b2a4fe9bdba Reviewed-on: https://boringssl-review.googlesource.com/17666 Commit-Queue: Steven Valdez Reviewed-by: Steven Valdez --- ssl/test/runner/conn.go | 7 +------ ssl/test/runner/dtls.go | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ssl/test/runner/conn.go b/ssl/test/runner/conn.go index 61fc9d31..9e720840 100644 --- a/ssl/test/runner/conn.go +++ b/ssl/test/runner/conn.go @@ -1141,12 +1141,7 @@ func (c *Conn) doWriteRecord(typ recordType, data []byte) (n int, err error) { if typ == recordTypeChangeCipherSpec { err = c.out.changeCipherSpec(c.config) if err != nil { - // Cannot call sendAlert directly, - // because we already hold c.out.Mutex. - c.tmp[0] = alertLevelError - c.tmp[1] = byte(err.(alert)) - c.writeRecord(recordTypeAlert, c.tmp[0:2]) - return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err}) + return n, c.sendAlertLocked(alertLevelError, err.(alert)) } } return diff --git a/ssl/test/runner/dtls.go b/ssl/test/runner/dtls.go index d46b247a..87b99756 100644 --- a/ssl/test/runner/dtls.go +++ b/ssl/test/runner/dtls.go @@ -159,12 +159,7 @@ func (c *Conn) dtlsWriteRecord(typ recordType, data []byte) (n int, err error) { if typ == recordTypeChangeCipherSpec { err = c.out.changeCipherSpec(c.config) if err != nil { - // Cannot call sendAlert directly, - // because we already hold c.out.Mutex. - c.tmp[0] = alertLevelError - c.tmp[1] = byte(err.(alert)) - c.writeRecord(recordTypeAlert, c.tmp[0:2]) - return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err}) + return n, c.sendAlertLocked(alertLevelError, err.(alert)) } } return