mirror of
https://github.com/reactos/syzkaller.git
synced 2024-12-04 09:43:38 +00:00
ddf7b3e065
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.
38 lines
686 B
Go
38 lines
686 B
Go
// Copyright 2017 syzkaller project authors. All rights reserved.
|
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
package prog
|
|
|
|
import (
|
|
"math/rand"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// Export guts for testing.
|
|
|
|
func init() {
|
|
debug = true
|
|
}
|
|
|
|
var (
|
|
CalcChecksumsCall = calcChecksumsCall
|
|
InitTest = initTest
|
|
)
|
|
|
|
func initTest(t *testing.T) (*Target, rand.Source, int) {
|
|
t.Parallel()
|
|
iters := 10000
|
|
if testing.Short() {
|
|
iters = 100
|
|
}
|
|
seed := int64(time.Now().UnixNano())
|
|
rs := rand.NewSource(seed)
|
|
t.Logf("seed=%v", seed)
|
|
target, err := GetTarget("linux", "amd64")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return target, rs, iters
|
|
}
|