github.com/HaHadaxigua/yaegi@v1.0.1/stdlib/go1_16_crypto_tls.go (about)

     1  // Code generated by 'yaegi extract crypto/tls'. DO NOT EDIT.
     2  
     3  // +build go1.16,!go1.17
     4  
     5  package stdlib
     6  
     7  import (
     8  	"crypto/tls"
     9  	"go/constant"
    10  	"go/token"
    11  	"reflect"
    12  )
    13  
    14  func init() {
    15  	Symbols["crypto/tls/tls"] = map[string]reflect.Value{
    16  		// function, constant and variable definitions
    17  		"CipherSuiteName":                         reflect.ValueOf(tls.CipherSuiteName),
    18  		"CipherSuites":                            reflect.ValueOf(tls.CipherSuites),
    19  		"Client":                                  reflect.ValueOf(tls.Client),
    20  		"CurveP256":                               reflect.ValueOf(tls.CurveP256),
    21  		"CurveP384":                               reflect.ValueOf(tls.CurveP384),
    22  		"CurveP521":                               reflect.ValueOf(tls.CurveP521),
    23  		"Dial":                                    reflect.ValueOf(tls.Dial),
    24  		"DialWithDialer":                          reflect.ValueOf(tls.DialWithDialer),
    25  		"ECDSAWithP256AndSHA256":                  reflect.ValueOf(tls.ECDSAWithP256AndSHA256),
    26  		"ECDSAWithP384AndSHA384":                  reflect.ValueOf(tls.ECDSAWithP384AndSHA384),
    27  		"ECDSAWithP521AndSHA512":                  reflect.ValueOf(tls.ECDSAWithP521AndSHA512),
    28  		"ECDSAWithSHA1":                           reflect.ValueOf(tls.ECDSAWithSHA1),
    29  		"Ed25519":                                 reflect.ValueOf(tls.Ed25519),
    30  		"InsecureCipherSuites":                    reflect.ValueOf(tls.InsecureCipherSuites),
    31  		"Listen":                                  reflect.ValueOf(tls.Listen),
    32  		"LoadX509KeyPair":                         reflect.ValueOf(tls.LoadX509KeyPair),
    33  		"NewLRUClientSessionCache":                reflect.ValueOf(tls.NewLRUClientSessionCache),
    34  		"NewListener":                             reflect.ValueOf(tls.NewListener),
    35  		"NoClientCert":                            reflect.ValueOf(tls.NoClientCert),
    36  		"PKCS1WithSHA1":                           reflect.ValueOf(tls.PKCS1WithSHA1),
    37  		"PKCS1WithSHA256":                         reflect.ValueOf(tls.PKCS1WithSHA256),
    38  		"PKCS1WithSHA384":                         reflect.ValueOf(tls.PKCS1WithSHA384),
    39  		"PKCS1WithSHA512":                         reflect.ValueOf(tls.PKCS1WithSHA512),
    40  		"PSSWithSHA256":                           reflect.ValueOf(tls.PSSWithSHA256),
    41  		"PSSWithSHA384":                           reflect.ValueOf(tls.PSSWithSHA384),
    42  		"PSSWithSHA512":                           reflect.ValueOf(tls.PSSWithSHA512),
    43  		"RenegotiateFreelyAsClient":               reflect.ValueOf(tls.RenegotiateFreelyAsClient),
    44  		"RenegotiateNever":                        reflect.ValueOf(tls.RenegotiateNever),
    45  		"RenegotiateOnceAsClient":                 reflect.ValueOf(tls.RenegotiateOnceAsClient),
    46  		"RequestClientCert":                       reflect.ValueOf(tls.RequestClientCert),
    47  		"RequireAndVerifyClientCert":              reflect.ValueOf(tls.RequireAndVerifyClientCert),
    48  		"RequireAnyClientCert":                    reflect.ValueOf(tls.RequireAnyClientCert),
    49  		"Server":                                  reflect.ValueOf(tls.Server),
    50  		"TLS_AES_128_GCM_SHA256":                  reflect.ValueOf(tls.TLS_AES_128_GCM_SHA256),
    51  		"TLS_AES_256_GCM_SHA384":                  reflect.ValueOf(tls.TLS_AES_256_GCM_SHA384),
    52  		"TLS_CHACHA20_POLY1305_SHA256":            reflect.ValueOf(tls.TLS_CHACHA20_POLY1305_SHA256),
    53  		"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA":    reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA),
    54  		"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256),
    55  		"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256),
    56  		"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA":    reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA),
    57  		"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384),
    58  		"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305":  reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305),
    59  		"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256),
    60  		"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA":              reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA),
    61  		"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA":           reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA),
    62  		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA":            reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA),
    63  		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256),
    64  		"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256),
    65  		"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA":            reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA),
    66  		"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384),
    67  		"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305":          reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305),
    68  		"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256":   reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256),
    69  		"TLS_ECDHE_RSA_WITH_RC4_128_SHA":                reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA),
    70  		"TLS_FALLBACK_SCSV":                             reflect.ValueOf(tls.TLS_FALLBACK_SCSV),
    71  		"TLS_RSA_WITH_3DES_EDE_CBC_SHA":                 reflect.ValueOf(tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA),
    72  		"TLS_RSA_WITH_AES_128_CBC_SHA":                  reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_CBC_SHA),
    73  		"TLS_RSA_WITH_AES_128_CBC_SHA256":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_CBC_SHA256),
    74  		"TLS_RSA_WITH_AES_128_GCM_SHA256":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_GCM_SHA256),
    75  		"TLS_RSA_WITH_AES_256_CBC_SHA":                  reflect.ValueOf(tls.TLS_RSA_WITH_AES_256_CBC_SHA),
    76  		"TLS_RSA_WITH_AES_256_GCM_SHA384":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_256_GCM_SHA384),
    77  		"TLS_RSA_WITH_RC4_128_SHA":                      reflect.ValueOf(tls.TLS_RSA_WITH_RC4_128_SHA),
    78  		"VerifyClientCertIfGiven":                       reflect.ValueOf(tls.VerifyClientCertIfGiven),
    79  		"VersionSSL30":                                  reflect.ValueOf(constant.MakeFromLiteral("768", token.INT, 0)),
    80  		"VersionTLS10":                                  reflect.ValueOf(constant.MakeFromLiteral("769", token.INT, 0)),
    81  		"VersionTLS11":                                  reflect.ValueOf(constant.MakeFromLiteral("770", token.INT, 0)),
    82  		"VersionTLS12":                                  reflect.ValueOf(constant.MakeFromLiteral("771", token.INT, 0)),
    83  		"VersionTLS13":                                  reflect.ValueOf(constant.MakeFromLiteral("772", token.INT, 0)),
    84  		"X25519":                                        reflect.ValueOf(tls.X25519),
    85  		"X509KeyPair":                                   reflect.ValueOf(tls.X509KeyPair),
    86  
    87  		// type definitions
    88  		"Certificate":            reflect.ValueOf((*tls.Certificate)(nil)),
    89  		"CertificateRequestInfo": reflect.ValueOf((*tls.CertificateRequestInfo)(nil)),
    90  		"CipherSuite":            reflect.ValueOf((*tls.CipherSuite)(nil)),
    91  		"ClientAuthType":         reflect.ValueOf((*tls.ClientAuthType)(nil)),
    92  		"ClientHelloInfo":        reflect.ValueOf((*tls.ClientHelloInfo)(nil)),
    93  		"ClientSessionCache":     reflect.ValueOf((*tls.ClientSessionCache)(nil)),
    94  		"ClientSessionState":     reflect.ValueOf((*tls.ClientSessionState)(nil)),
    95  		"Config":                 reflect.ValueOf((*tls.Config)(nil)),
    96  		"Conn":                   reflect.ValueOf((*tls.Conn)(nil)),
    97  		"ConnectionState":        reflect.ValueOf((*tls.ConnectionState)(nil)),
    98  		"CurveID":                reflect.ValueOf((*tls.CurveID)(nil)),
    99  		"Dialer":                 reflect.ValueOf((*tls.Dialer)(nil)),
   100  		"RecordHeaderError":      reflect.ValueOf((*tls.RecordHeaderError)(nil)),
   101  		"RenegotiationSupport":   reflect.ValueOf((*tls.RenegotiationSupport)(nil)),
   102  		"SignatureScheme":        reflect.ValueOf((*tls.SignatureScheme)(nil)),
   103  
   104  		// interface wrapper definitions
   105  		"_ClientSessionCache": reflect.ValueOf((*_crypto_tls_ClientSessionCache)(nil)),
   106  	}
   107  }
   108  
   109  // _crypto_tls_ClientSessionCache is an interface wrapper for ClientSessionCache type
   110  type _crypto_tls_ClientSessionCache struct {
   111  	IValue interface{}
   112  	WGet   func(sessionKey string) (session *tls.ClientSessionState, ok bool)
   113  	WPut   func(sessionKey string, cs *tls.ClientSessionState)
   114  }
   115  
   116  func (W _crypto_tls_ClientSessionCache) Get(sessionKey string) (session *tls.ClientSessionState, ok bool) {
   117  	return W.WGet(sessionKey)
   118  }
   119  func (W _crypto_tls_ClientSessionCache) Put(sessionKey string, cs *tls.ClientSessionState) {
   120  	W.WPut(sessionKey, cs)
   121  }