only add crypto dependencies if -literals is passed

pull/47/head
Andrew LeFevre 5 years ago committed by Daniel Martí
parent 3e4f3821ea
commit ee18db7ef1

@ -564,8 +564,8 @@ func readBuildIDs(flags []string) error {
// Since string obfuscation adds crypto dependencies, ensure they are // Since string obfuscation adds crypto dependencies, ensure they are
// also part of the importcfg. Otherwise, the compiler or linker might // also part of the importcfg. Otherwise, the compiler or linker might
// error when trying to locate them. // error when trying to locate them.
// TODO: only do this when string obfuscation is enabled.
// TODO: this means these packages can't be garbled. never garble std? // TODO: this means these packages can't be garbled. never garble std?
if envGarbleLiterals {
toAdd := []string{ toAdd := []string{
"crypto/aes", "crypto/aes",
"crypto/cipher", "crypto/cipher",
@ -591,6 +591,8 @@ func readBuildIDs(flags []string) error {
buildInfo.imports[path] = importedPkg{packagefile: pkg.Export} buildInfo.imports[path] = importedPkg{packagefile: pkg.Export}
toAdd = append(toAdd, pkg.Deps...) toAdd = append(toAdd, pkg.Deps...)
} }
}
if err := f.Close(); err != nil { if err := f.Close(); err != nil {
return err return err
} }

Loading…
Cancel
Save