github.com/goplus/gossa@v0.3.25/pkg/crypto/tls/go117_export.go (about)

     1  // export by github.com/goplus/gossa/cmd/qexp
     2  
     3  //go:build go1.17 && !go1.18
     4  // +build go1.17,!go1.18
     5  
     6  package tls
     7  
     8  import (
     9  	q "crypto/tls"
    10  
    11  	"go/constant"
    12  	"reflect"
    13  
    14  	"github.com/goplus/gossa"
    15  )
    16  
    17  func init() {
    18  	gossa.RegisterPackage(&gossa.Package{
    19  		Name: "tls",
    20  		Path: "crypto/tls",
    21  		Deps: map[string]string{
    22  			"bytes":           "bytes",
    23  			"container/list":  "list",
    24  			"context":         "context",
    25  			"crypto":          "crypto",
    26  			"crypto/aes":      "aes",
    27  			"crypto/cipher":   "cipher",
    28  			"crypto/des":      "des",
    29  			"crypto/ecdsa":    "ecdsa",
    30  			"crypto/ed25519":  "ed25519",
    31  			"crypto/elliptic": "elliptic",
    32  			"crypto/hmac":     "hmac",
    33  			"crypto/md5":      "md5",
    34  			"crypto/rand":     "rand",
    35  			"crypto/rc4":      "rc4",
    36  			"crypto/rsa":      "rsa",
    37  			"crypto/sha1":     "sha1",
    38  			"crypto/sha256":   "sha256",
    39  			"crypto/sha512":   "sha512",
    40  			"crypto/subtle":   "subtle",
    41  			"crypto/x509":     "x509",
    42  			"encoding/pem":    "pem",
    43  			"errors":          "errors",
    44  			"fmt":             "fmt",
    45  			"hash":            "hash",
    46  			"internal/cpu":    "cpu",
    47  			"io":              "io",
    48  			"math/big":        "big",
    49  			"net":             "net",
    50  			"os":              "os",
    51  			"runtime":         "runtime",
    52  			"strconv":         "strconv",
    53  			"strings":         "strings",
    54  			"sync":            "sync",
    55  			"sync/atomic":     "atomic",
    56  			"time":            "time",
    57  			"vendor/golang.org/x/crypto/chacha20poly1305": "chacha20poly1305",
    58  			"vendor/golang.org/x/crypto/cryptobyte":       "cryptobyte",
    59  			"vendor/golang.org/x/crypto/curve25519":       "curve25519",
    60  			"vendor/golang.org/x/crypto/hkdf":             "hkdf",
    61  		},
    62  		Interfaces: map[string]reflect.Type{
    63  			"ClientSessionCache": reflect.TypeOf((*q.ClientSessionCache)(nil)).Elem(),
    64  		},
    65  		NamedTypes: map[string]gossa.NamedType{
    66  			"Certificate":            {reflect.TypeOf((*q.Certificate)(nil)).Elem(), "", "leaf"},
    67  			"CertificateRequestInfo": {reflect.TypeOf((*q.CertificateRequestInfo)(nil)).Elem(), "", "Context,SupportsCertificate"},
    68  			"CipherSuite":            {reflect.TypeOf((*q.CipherSuite)(nil)).Elem(), "", ""},
    69  			"ClientAuthType":         {reflect.TypeOf((*q.ClientAuthType)(nil)).Elem(), "String", ""},
    70  			"ClientHelloInfo":        {reflect.TypeOf((*q.ClientHelloInfo)(nil)).Elem(), "", "Context,SupportsCertificate"},
    71  			"ClientSessionState":     {reflect.TypeOf((*q.ClientSessionState)(nil)).Elem(), "", ""},
    72  			"Config":                 {reflect.TypeOf((*q.Config)(nil)).Elem(), "", "BuildNameToCertificate,Clone,SetSessionTicketKeys,cipherSuites,curvePreferences,getCertificate,initLegacySessionTicketKeyRLocked,maxSupportedVersion,mutualVersion,rand,supportedVersions,supportsCurve,ticketKeyFromBytes,ticketKeys,time,writeKeyLog"},
    73  			"Conn":                   {reflect.TypeOf((*q.Conn)(nil)).Elem(), "", "Close,CloseWrite,ConnectionState,Handshake,HandshakeContext,LocalAddr,OCSPResponse,Read,RemoteAddr,SetDeadline,SetReadDeadline,SetWriteDeadline,VerifyHostname,Write,clientHandshake,closeNotify,connectionStateLocked,decryptTicket,encryptTicket,flush,getClientCertificate,handleKeyUpdate,handleNewSessionTicket,handlePostHandshakeMessage,handleRenegotiation,handshakeComplete,handshakeContext,loadSession,makeClientHello,maxPayloadSizeForWrite,newRecordHeaderError,pickTLSVersion,processCertsFromClient,readChangeCipherSpec,readClientHello,readFromUntil,readHandshake,readRecord,readRecordOrCCS,retryReadRecord,sendAlert,sendAlertLocked,serverHandshake,verifyServerCertificate,write,writeRecord,writeRecordLocked"},
    74  			"ConnectionState":        {reflect.TypeOf((*q.ConnectionState)(nil)).Elem(), "", "ExportKeyingMaterial"},
    75  			"CurveID":                {reflect.TypeOf((*q.CurveID)(nil)).Elem(), "String", ""},
    76  			"Dialer":                 {reflect.TypeOf((*q.Dialer)(nil)).Elem(), "", "Dial,DialContext,netDialer"},
    77  			"RecordHeaderError":      {reflect.TypeOf((*q.RecordHeaderError)(nil)).Elem(), "Error", ""},
    78  			"RenegotiationSupport":   {reflect.TypeOf((*q.RenegotiationSupport)(nil)).Elem(), "", ""},
    79  			"SignatureScheme":        {reflect.TypeOf((*q.SignatureScheme)(nil)).Elem(), "String", ""},
    80  		},
    81  		AliasTypes: map[string]reflect.Type{},
    82  		Vars:       map[string]reflect.Value{},
    83  		Funcs: map[string]reflect.Value{
    84  			"CipherSuiteName":          reflect.ValueOf(q.CipherSuiteName),
    85  			"CipherSuites":             reflect.ValueOf(q.CipherSuites),
    86  			"Client":                   reflect.ValueOf(q.Client),
    87  			"Dial":                     reflect.ValueOf(q.Dial),
    88  			"DialWithDialer":           reflect.ValueOf(q.DialWithDialer),
    89  			"InsecureCipherSuites":     reflect.ValueOf(q.InsecureCipherSuites),
    90  			"Listen":                   reflect.ValueOf(q.Listen),
    91  			"LoadX509KeyPair":          reflect.ValueOf(q.LoadX509KeyPair),
    92  			"NewLRUClientSessionCache": reflect.ValueOf(q.NewLRUClientSessionCache),
    93  			"NewListener":              reflect.ValueOf(q.NewListener),
    94  			"Server":                   reflect.ValueOf(q.Server),
    95  			"X509KeyPair":              reflect.ValueOf(q.X509KeyPair),
    96  		},
    97  		TypedConsts: map[string]gossa.TypedConst{
    98  			"CurveP256":                                     {reflect.TypeOf(q.CurveP256), constant.MakeInt64(int64(q.CurveP256))},
    99  			"CurveP384":                                     {reflect.TypeOf(q.CurveP384), constant.MakeInt64(int64(q.CurveP384))},
   100  			"CurveP521":                                     {reflect.TypeOf(q.CurveP521), constant.MakeInt64(int64(q.CurveP521))},
   101  			"ECDSAWithP256AndSHA256":                        {reflect.TypeOf(q.ECDSAWithP256AndSHA256), constant.MakeInt64(int64(q.ECDSAWithP256AndSHA256))},
   102  			"ECDSAWithP384AndSHA384":                        {reflect.TypeOf(q.ECDSAWithP384AndSHA384), constant.MakeInt64(int64(q.ECDSAWithP384AndSHA384))},
   103  			"ECDSAWithP521AndSHA512":                        {reflect.TypeOf(q.ECDSAWithP521AndSHA512), constant.MakeInt64(int64(q.ECDSAWithP521AndSHA512))},
   104  			"ECDSAWithSHA1":                                 {reflect.TypeOf(q.ECDSAWithSHA1), constant.MakeInt64(int64(q.ECDSAWithSHA1))},
   105  			"Ed25519":                                       {reflect.TypeOf(q.Ed25519), constant.MakeInt64(int64(q.Ed25519))},
   106  			"NoClientCert":                                  {reflect.TypeOf(q.NoClientCert), constant.MakeInt64(int64(q.NoClientCert))},
   107  			"PKCS1WithSHA1":                                 {reflect.TypeOf(q.PKCS1WithSHA1), constant.MakeInt64(int64(q.PKCS1WithSHA1))},
   108  			"PKCS1WithSHA256":                               {reflect.TypeOf(q.PKCS1WithSHA256), constant.MakeInt64(int64(q.PKCS1WithSHA256))},
   109  			"PKCS1WithSHA384":                               {reflect.TypeOf(q.PKCS1WithSHA384), constant.MakeInt64(int64(q.PKCS1WithSHA384))},
   110  			"PKCS1WithSHA512":                               {reflect.TypeOf(q.PKCS1WithSHA512), constant.MakeInt64(int64(q.PKCS1WithSHA512))},
   111  			"PSSWithSHA256":                                 {reflect.TypeOf(q.PSSWithSHA256), constant.MakeInt64(int64(q.PSSWithSHA256))},
   112  			"PSSWithSHA384":                                 {reflect.TypeOf(q.PSSWithSHA384), constant.MakeInt64(int64(q.PSSWithSHA384))},
   113  			"PSSWithSHA512":                                 {reflect.TypeOf(q.PSSWithSHA512), constant.MakeInt64(int64(q.PSSWithSHA512))},
   114  			"RenegotiateFreelyAsClient":                     {reflect.TypeOf(q.RenegotiateFreelyAsClient), constant.MakeInt64(int64(q.RenegotiateFreelyAsClient))},
   115  			"RenegotiateNever":                              {reflect.TypeOf(q.RenegotiateNever), constant.MakeInt64(int64(q.RenegotiateNever))},
   116  			"RenegotiateOnceAsClient":                       {reflect.TypeOf(q.RenegotiateOnceAsClient), constant.MakeInt64(int64(q.RenegotiateOnceAsClient))},
   117  			"RequestClientCert":                             {reflect.TypeOf(q.RequestClientCert), constant.MakeInt64(int64(q.RequestClientCert))},
   118  			"RequireAndVerifyClientCert":                    {reflect.TypeOf(q.RequireAndVerifyClientCert), constant.MakeInt64(int64(q.RequireAndVerifyClientCert))},
   119  			"RequireAnyClientCert":                          {reflect.TypeOf(q.RequireAnyClientCert), constant.MakeInt64(int64(q.RequireAnyClientCert))},
   120  			"TLS_AES_128_GCM_SHA256":                        {reflect.TypeOf(q.TLS_AES_128_GCM_SHA256), constant.MakeInt64(int64(q.TLS_AES_128_GCM_SHA256))},
   121  			"TLS_AES_256_GCM_SHA384":                        {reflect.TypeOf(q.TLS_AES_256_GCM_SHA384), constant.MakeInt64(int64(q.TLS_AES_256_GCM_SHA384))},
   122  			"TLS_CHACHA20_POLY1305_SHA256":                  {reflect.TypeOf(q.TLS_CHACHA20_POLY1305_SHA256), constant.MakeInt64(int64(q.TLS_CHACHA20_POLY1305_SHA256))},
   123  			"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA":          {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA))},
   124  			"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256":       {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256))},
   125  			"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256":       {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256))},
   126  			"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA":          {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA))},
   127  			"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384":       {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384))},
   128  			"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305":        {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305))},
   129  			"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256": {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256))},
   130  			"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA":              {reflect.TypeOf(q.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA))},
   131  			"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA":           {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA))},
   132  			"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA":            {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA))},
   133  			"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256":         {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256))},
   134  			"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256":         {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256))},
   135  			"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA":            {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA))},
   136  			"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384":         {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384))},
   137  			"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305":          {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305))},
   138  			"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256":   {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256))},
   139  			"TLS_ECDHE_RSA_WITH_RC4_128_SHA":                {reflect.TypeOf(q.TLS_ECDHE_RSA_WITH_RC4_128_SHA), constant.MakeInt64(int64(q.TLS_ECDHE_RSA_WITH_RC4_128_SHA))},
   140  			"TLS_FALLBACK_SCSV":                             {reflect.TypeOf(q.TLS_FALLBACK_SCSV), constant.MakeInt64(int64(q.TLS_FALLBACK_SCSV))},
   141  			"TLS_RSA_WITH_3DES_EDE_CBC_SHA":                 {reflect.TypeOf(q.TLS_RSA_WITH_3DES_EDE_CBC_SHA), constant.MakeInt64(int64(q.TLS_RSA_WITH_3DES_EDE_CBC_SHA))},
   142  			"TLS_RSA_WITH_AES_128_CBC_SHA":                  {reflect.TypeOf(q.TLS_RSA_WITH_AES_128_CBC_SHA), constant.MakeInt64(int64(q.TLS_RSA_WITH_AES_128_CBC_SHA))},
   143  			"TLS_RSA_WITH_AES_128_CBC_SHA256":               {reflect.TypeOf(q.TLS_RSA_WITH_AES_128_CBC_SHA256), constant.MakeInt64(int64(q.TLS_RSA_WITH_AES_128_CBC_SHA256))},
   144  			"TLS_RSA_WITH_AES_128_GCM_SHA256":               {reflect.TypeOf(q.TLS_RSA_WITH_AES_128_GCM_SHA256), constant.MakeInt64(int64(q.TLS_RSA_WITH_AES_128_GCM_SHA256))},
   145  			"TLS_RSA_WITH_AES_256_CBC_SHA":                  {reflect.TypeOf(q.TLS_RSA_WITH_AES_256_CBC_SHA), constant.MakeInt64(int64(q.TLS_RSA_WITH_AES_256_CBC_SHA))},
   146  			"TLS_RSA_WITH_AES_256_GCM_SHA384":               {reflect.TypeOf(q.TLS_RSA_WITH_AES_256_GCM_SHA384), constant.MakeInt64(int64(q.TLS_RSA_WITH_AES_256_GCM_SHA384))},
   147  			"TLS_RSA_WITH_RC4_128_SHA":                      {reflect.TypeOf(q.TLS_RSA_WITH_RC4_128_SHA), constant.MakeInt64(int64(q.TLS_RSA_WITH_RC4_128_SHA))},
   148  			"VerifyClientCertIfGiven":                       {reflect.TypeOf(q.VerifyClientCertIfGiven), constant.MakeInt64(int64(q.VerifyClientCertIfGiven))},
   149  			"X25519":                                        {reflect.TypeOf(q.X25519), constant.MakeInt64(int64(q.X25519))},
   150  		},
   151  		UntypedConsts: map[string]gossa.UntypedConst{
   152  			"VersionSSL30": {"untyped int", constant.MakeInt64(int64(q.VersionSSL30))},
   153  			"VersionTLS10": {"untyped int", constant.MakeInt64(int64(q.VersionTLS10))},
   154  			"VersionTLS11": {"untyped int", constant.MakeInt64(int64(q.VersionTLS11))},
   155  			"VersionTLS12": {"untyped int", constant.MakeInt64(int64(q.VersionTLS12))},
   156  			"VersionTLS13": {"untyped int", constant.MakeInt64(int64(q.VersionTLS13))},
   157  		},
   158  	})
   159  }