Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade gothemis compatibility #253

Closed
vixentael opened this issue Nov 6, 2017 · 2 comments
Closed

Downgrade gothemis compatibility #253

vixentael opened this issue Nov 6, 2017 · 2 comments
Assignees
Labels
compatibility Backward and forward compatibility, platform interoperability issues, breaking changes enhancement W-GoThemis 🐹 Wrapper: GoThemis, Go API

Comments

@vixentael
Copy link
Contributor

It seems that gothemis uses syntax incompatible with old Go versions (TODO: check exact version, but it's definitely below 1.2).

We should re-write this line to smth more compatible
https://github.com/cossacklabs/themis/blob/master/gothemis/session/session.go#L93

As example we used this code in Hermes:

//CArrayToSlice return buffer as byte slice with len/cap equals to bufferLength
func CArrayToSlice(buffer unsafe.Pointer, bufferLength int) []byte {
	sliceHeader := reflect.SliceHeader{uintptr(buffer), int(bufferLength), bufferLength}
	data := *(*[]byte)(unsafe.Pointer(&sliceHeader))
	return data
}

(from https://github.com/cossacklabs/hermes-core/blob/master/gohermes/utils.go)

Although this code is 100% valid, but it would be nice to support previous versions.

@vixentael vixentael added enhancement W-GoThemis 🐹 Wrapper: GoThemis, Go API labels Nov 6, 2017
@vixentael vixentael added the compatibility Backward and forward compatibility, platform interoperability issues, breaking changes label Nov 6, 2017
@vixentael
Copy link
Contributor Author

vixentael commented Nov 6, 2017

Self-check:
Internal buildbot builds that are supposed to be fixed after this fix:

  • themis-test-ubuntu_precise-x86_64
  • themis-test-ubuntu_precise-i386 (go1)
  • themis-test-debian_wheezy-i386

@vixentael
Copy link
Contributor Author

closed by #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Backward and forward compatibility, platform interoperability issues, breaking changes enhancement W-GoThemis 🐹 Wrapper: GoThemis, Go API
Projects
None yet
Development

No branches or pull requests

2 participants