Skip to content

Commit

Permalink
Add both uint64 and int64 to tlscommon types unpack methods
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Apr 16, 2024
1 parent 8fcae27 commit d79e0c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions transport/tlscommon/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func (m *TLSVerificationMode) Unpack(in interface{}) error {
return fmt.Errorf("unknown verification mode '%v'", o)
}
*m = mode
case int64:
*m = TLSVerificationMode(o)
case uint64:
*m = TLSVerificationMode(o)
default:
Expand Down Expand Up @@ -244,6 +246,8 @@ func (cs *CipherSuite) Unpack(i interface{}) error {
}

*cs = suite
case int64:
*cs = CipherSuite(o)
case uint64:
*cs = CipherSuite(o)
default:
Expand All @@ -270,6 +274,8 @@ func (ct *tlsCurveType) Unpack(i interface{}) error {
}

*ct = t
case int64:
*ct = tlsCurveType(o)
case uint64:
*ct = tlsCurveType(o)
default:
Expand All @@ -296,6 +302,8 @@ func (r *TLSRenegotiationSupport) Unpack(i interface{}) error {
}

*r = t
case int64:
*r = TLSRenegotiationSupport(o)
case uint64:
*r = TLSRenegotiationSupport(o)
default:
Expand Down
2 changes: 2 additions & 0 deletions transport/tlscommon/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func (v *TLSVersion) Unpack(i interface{}) error {
return fmt.Errorf("invalid tls version '%v'", o)
}
*v = version
case int64:
*v = TLSVersion(o)
case uint64:
*v = TLSVersion(o)
default:
Expand Down

0 comments on commit d79e0c4

Please sign in to comment.