Skip to content

Commit

Permalink
RELEASE: Go 1.21 (#216)
Browse files Browse the repository at this point in the history
* sync: Go 1.21.0

* [release-branch.go1.21] crypto/tls: change SendSessionTicket to take an options struct

To allow for future evolution of the API, make
QUICConn.SendSessionTicket take a QUICSessionTicketOptions
rather than a single bool.

Change-Id: I798fd0feec5c7581e3c3574e2de99611c81df47f
Reviewed-on: https://go-review.googlesource.com/c/go/+/514997
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
(cherry picked from commit a915b99)
Reviewed-on: https://go-review.googlesource.com/c/go/+/515335
Auto-Submit: Damien Neil <dneil@google.com>
Co-Authored-By: Damien Neil <52544+neild@users.noreply.github.com>

* new: CI bump up to use Go 1.21.0 stable release

* fix: better CI streamline for multi-platform

---------

Co-authored-by: Damien Neil <52544+neild@users.noreply.github.com>
  • Loading branch information
gaukas and neild authored Aug 9, 2023
1 parent 2ae5748 commit a998534
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 42 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/go_1_20.yml → .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: "Go 1.20"
name: "Go"

on:
push:
Expand All @@ -10,18 +10,20 @@ on:
branches: [ "master" ]

jobs:
go_build_test:
runs-on: ubuntu-latest
build:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
go: [ "1.20.x", "1.21.0" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20.7'

go-version: ${{ matrix.go }}
- run: go version
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
run: go test -v ./...
27 changes: 0 additions & 27 deletions .github/workflows/go_1_21.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ![uTLS](logo_small.png) uTLS
[![Build Status](https://github.com/refraction-networking/utls/actions/workflows/go_1_20.yml/badge.svg?branch=master)](https://github.com/refraction-networking/utls/actions/workflows/go_1_20.yml)
[![Build Status](https://github.com/refraction-networking/utls/actions/workflows/go_1_21.yml/badge.svg?branch=master)](https://github.com/refraction-networking/utls/actions/workflows/go_1_21.yml)
[![Build Status](https://github.com/refraction-networking/utls/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/refraction-networking/utls/actions/workflows/go.yml)
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/refraction-networking/utls#UConn)
---
uTLS is a fork of "crypto/tls", which provides ClientHello fingerprinting resistance, low-level access to handshake, fake session tickets and some other features. Handshake is still performed by "crypto/tls", this library merely changes ClientHello part of it and provides low-level access.
Expand Down
9 changes: 7 additions & 2 deletions quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,15 @@ func (q *QUICConn) HandleData(level QUICEncryptionLevel, data []byte) error {
return nil
}

type QUICSessionTicketOptions struct {
// EarlyData specifies whether the ticket may be used for 0-RTT.
EarlyData bool
}

// SendSessionTicket sends a session ticket to the client.
// It produces connection events, which may be read with NextEvent.
// Currently, it can only be called once.
func (q *QUICConn) SendSessionTicket(earlyData bool) error {
func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error {
c := q.conn
if !c.isHandshakeComplete.Load() {
return quicError(errors.New("tls: SendSessionTicket called before handshake completed"))
Expand All @@ -261,7 +266,7 @@ func (q *QUICConn) SendSessionTicket(earlyData bool) error {
return quicError(errors.New("tls: SendSessionTicket called multiple times"))
}
q.sessionTicketSent = true
return quicError(c.sendSessionTicket(earlyData))
return quicError(c.sendSessionTicket(opts.EarlyData))
}

// ConnectionState returns basic TLS details about the connection.
Expand Down
3 changes: 2 additions & 1 deletion quic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func runTestQUICConnection(ctx context.Context, cli, srv *testQUICConn, onHandle
case QUICHandshakeDone:
a.complete = true
if a == srv {
if err := srv.conn.SendSessionTicket(false); err != nil {
opts := QUICSessionTicketOptions{}
if err := srv.conn.SendSessionTicket(opts); err != nil {
return err
}
}
Expand Down

0 comments on commit a998534

Please sign in to comment.