Browse Source
Add enough tls.ConnectionState and tls.CipherSuiteName() to compile fortio/log (#4345)
src/crypt: add enough tls.ConnectionState and tls.CipherSuiteName() to compile fortio/log
pull/4354/head
Laurent Demailly
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
13 additions and
0 deletions
-
src/crypto/tls/common.go
|
@ -10,6 +10,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"crypto" |
|
|
"crypto" |
|
|
"crypto/x509" |
|
|
"crypto/x509" |
|
|
|
|
|
"fmt" |
|
|
"io" |
|
|
"io" |
|
|
"net" |
|
|
"net" |
|
|
"sync" |
|
|
"sync" |
|
@ -23,9 +24,21 @@ import ( |
|
|
// only supports Elliptic Curve based groups. See RFC 8446, Section 4.2.7.
|
|
|
// only supports Elliptic Curve based groups. See RFC 8446, Section 4.2.7.
|
|
|
type CurveID uint16 |
|
|
type CurveID uint16 |
|
|
|
|
|
|
|
|
|
|
|
// CipherSuiteName returns the standard name for the passed cipher suite ID
|
|
|
|
|
|
//
|
|
|
|
|
|
// Not Implemented.
|
|
|
|
|
|
func CipherSuiteName(id uint16) string { |
|
|
|
|
|
return fmt.Sprintf("0x%04X", id) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// ConnectionState records basic TLS details about the connection.
|
|
|
// ConnectionState records basic TLS details about the connection.
|
|
|
type ConnectionState struct { |
|
|
type ConnectionState struct { |
|
|
// TINYGO: empty; TLS connection offloaded to device
|
|
|
// TINYGO: empty; TLS connection offloaded to device
|
|
|
|
|
|
//
|
|
|
|
|
|
// Minimum (empty) fields for fortio.org/log http logging and others
|
|
|
|
|
|
// to compile and run.
|
|
|
|
|
|
PeerCertificates []*x509.Certificate |
|
|
|
|
|
CipherSuite uint16 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ClientAuthType declares the policy the server will follow for
|
|
|
// ClientAuthType declares the policy the server will follow for
|
|
|