diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-22 11:42:10 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-24 13:56:20 +0100 |
| commit | ddf7b3e0655cf6dfeacfe509e477c1486d2cc7db (patch) | |
| tree | dd3ce89e4c92cdb4ddaaae566222ec8cbd177676 /sys/linux/init.go | |
| parent | d19770f1b9c6f1cb953b4a6e767aa914009deb20 (diff) | |
sys/linux: improve AF_ALG alg name generation
There is effectively infinite number of possible crypto
algorithm names due to templates. Plus there is tricky
relation between algorithms and algorithm type names.
This change adds custom mutator for sockaddr_alg struct
to improve variance in generated algorithms.
Diffstat (limited to 'sys/linux/init.go')
| -rw-r--r-- | sys/linux/init.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/linux/init.go b/sys/linux/init.go index c727cb5b2..539801c65 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -40,9 +40,11 @@ func initTarget(target *prog.Target) { target.MakeMmap = arch.makeMmap target.AnalyzeMmap = arch.analyzeMmap target.SanitizeCall = arch.sanitizeCall - target.SpecialStructs = map[string]func(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (prog.Arg, []*prog.Call){ - "timespec": arch.generateTimespec, - "timeval": arch.generateTimespec, + target.SpecialStructs = map[string]func(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) ( + prog.Arg, []*prog.Call){ + "timespec": arch.generateTimespec, + "timeval": arch.generateTimespec, + "sockaddr_alg": arch.generateSockaddrAlg, } target.StringDictionary = stringDictionary |
