diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-27 09:09:01 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-27 09:09:01 +0100 |
| commit | 473d90487bd18f55b035887093e17b4a0ccc3b52 (patch) | |
| tree | ba143da8d5574184b8ffa76ea2b1313ced5b836f /sys/linux/init_alg.go | |
| parent | d695195a6be9ceaf6e5ecafa2566bf1a378b8613 (diff) | |
sys/linux: improve hash generation for KEYCTL_DH_COMPUTE
KEYCTL_DH_COMPUTE used the old fixed list of algorithm names.
Use the new code for algorithm generation.
+ it needs only SHASH algs, but we passed in all alg names.
Pass only SHASH algs.
Diffstat (limited to 'sys/linux/init_alg.go')
| -rw-r--r-- | sys/linux/init_alg.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/linux/init_alg.go b/sys/linux/init_alg.go index a4265f3c4..6ef7b9359 100644 --- a/sys/linux/init_alg.go +++ b/sys/linux/init_alg.go @@ -36,6 +36,15 @@ func (arch *arch) generateSockaddrAlg(g *prog.Gen, typ *prog.StructType, old *pr return } +func (arch *arch) generateAlgHashName(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) ( + arg prog.Arg, calls []*prog.Call) { + algName := generateAlg(g.Rand(), ALG_HASH) + arg = prog.MakeGroupArg(typ, []prog.Arg{ + prog.MakeDataArg(typ.Fields[0], []byte(algName)), + }) + return +} + func generateAlgName(rnd *rand.Rand) (string, string) { typ := allTypes[rnd.Intn(len(allTypes))] name := generateAlg(rnd, typ.typ) |
