MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / ParseCurveList

Function ParseCurveList

tlsutil/util.go:90–107  ·  view source on GitHub ↗
(curves string)

Source from the content-addressed store, hash-verified

88}
89
90func ParseCurveList(curves string) ([]tls.CurveID, error) {
91 if curves == "" {
92 return nil, nil
93 }
94
95 curveNameList := strings.Split(curves, ":")
96 curveIDList := make([]tls.CurveID, 0, len(curveNameList))
97
98 for _, name := range curveNameList {
99 id, ok := curveNameToID[name]
100 if !ok {
101 return nil, fmt.Errorf("unknown curve %q", name)
102 }
103 curveIDList = append(curveIDList, id)
104 }
105
106 return curveIDList, nil
107}
108
109func ParseVersion(s string) (uint16, error) {
110 var ver uint16

Callers 2

makeServerTLSConfigFunction · 0.92
TLSConfigFromURLFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected