-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Add reflection awareness to transformLinkname #883
Conversation
Can you add a test case to https://github.com/burrowers/garble/blob/master/testdata%2Fscript%2Flinkname.txtar |
Sure, it might take me a little bit as I dont fully understand how garble detects reflection on types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change overall seems fine, just needs some small changes.
You just need to add the example you already provided in your issue. I don't expect you to learn how we do reflection detection. Read https://github.com/burrowers/garble/blob/master/CONTRIBUTING.md as an introduction. |
I am yet to add the test, as it would involve writing a package that is interacted with via reflection that disabled obfuscation. As I cant use crypto/x/ssh as tests cant import packages. |
You can definitely import remote packages, but that is a bit more involved. I think in this case it's easier to just declare a Method in a package and then linknaming it from another. |
Ah sorry, I was a little unclear. I was meaning importing a remote package (in this case In this case doesnt it have to be a new package that is also then interacted with via reflection so that obfuscation is turned off? Hence me needing to understand how a package is determined to be a target for reflection |
You can use var _ = reflect.TypeOf(t{}) To exclude type |
Sweet thanks, I've added the test and made sure it fails without my changes, and passes with them :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few last comments
Right I've made those changes that you asked for. |
Just a small question on this now that its merged, what are the criteria for a release being made for this? I just have an open issue on my repo that regards this |
You can use
for now, maybe after #876 is merged. |
Is the main branch considered stable? I just dont want my builds pointing to something that may break in the future |
The code pushed to the master branch is tested extensively and doesn't really differ from the release versions. However we may deprecate old go versions on the master branch without notice. You can also use |
Here's the fix for #882
Hopefully its not too naive as I dont have a super great understanding of the codebase!