Skip to content

Commit

Permalink
update: use boring package not global var
Browse files Browse the repository at this point in the history
Align with the upstream to use `boring` as a name for a package. No functional changes.
  • Loading branch information
gaukas committed Oct 10, 2023
1 parent eafff68 commit ef75789
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
1 change: 1 addition & 0 deletions cipher_suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"hash"
"runtime"

"github.com/refraction-networking/utls/internal/boring"
"golang.org/x/sys/cpu"

"golang.org/x/crypto/chacha20poly1305"
Expand Down
16 changes: 16 additions & 0 deletions internal/boring/notboring.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package boring

import (
"crypto/cipher"
"errors"
)

const Enabled bool = false

func NewGCMTLS(_ cipher.Block) (cipher.AEAD, error) {
return nil, errors.New("boring not implemented")
}

func Unreachable() {
// do nothing
}
22 changes: 0 additions & 22 deletions notboring.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
// license that can be found in the LICENSE file.
package tls

import (
"crypto/cipher"
"errors"
)

func needFIPS() bool { return false }

func supportedSignatureAlgorithms() []SignatureScheme {
Expand All @@ -20,20 +15,3 @@ func fipsCurvePreferences(c *Config) []CurveID { panic("fipsCurvePreferences") }
func fipsCipherSuites(c *Config) []uint16 { panic("fipsCipherSuites") }

var fipsSupportedSignatureAlgorithms []SignatureScheme

// [uTLS]
// Boring struct is only to be used to record static env variables
// in boring package. We do not implement BoringSSL compatibliity here.
type Boring struct {
Enabled bool
}

func (*Boring) NewGCMTLS(_ cipher.Block) (cipher.AEAD, error) {
return nil, errors.New("boring not implemented")
}

func (*Boring) Unreachable() {
// do nothing
}

var boring Boring

0 comments on commit ef75789

Please sign in to comment.