diff options
| author | tb <> | 2019-11-27 10:09:29 +0000 |
|---|---|---|
| committer | tb <> | 2019-11-27 10:09:29 +0000 |
| commit | b200b4821ceb6fc32085a32500fab882ab147f67 (patch) | |
| tree | 60e67dcbceb5d33f22468cd57b90557a25c9ae90 /src/regress | |
| parent | 30dbd252ccf03e704489b47616794f7130f1f113 (diff) | |
| download | openbsd-b200b4821ceb6fc32085a32500fab882ab147f67.tar.gz openbsd-b200b4821ceb6fc32085a32500fab882ab147f67.tar.bz2 openbsd-b200b4821ceb6fc32085a32500fab882ab147f67.zip | |
Prepare update of wycheproof-testvectors. Skip some tests for things
we don't support in LibreSSL and make sure we run as many tests as
possible.
Diffstat (limited to 'src/regress')
| -rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index af4f18b38b..6cc739e831 100644 --- a/src/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/src/regress/lib/libcrypto/wycheproof/wycheproof.go | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: wycheproof.go,v 1.87 2018/11/07 22:51:17 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.88 2019/11/27 10:09:29 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> |
| 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
| @@ -55,6 +55,7 @@ import ( | |||
| 55 | "log" | 55 | "log" |
| 56 | "os" | 56 | "os" |
| 57 | "path/filepath" | 57 | "path/filepath" |
| 58 | "regexp" | ||
| 58 | "sort" | 59 | "sort" |
| 59 | "unsafe" | 60 | "unsafe" |
| 60 | ) | 61 | ) |
| @@ -2081,7 +2082,8 @@ func runTestVectors(path string, webcrypto bool) bool { | |||
| 2081 | case "X25519": | 2082 | case "X25519": |
| 2082 | wtg = &wycheproofTestGroupX25519{} | 2083 | wtg = &wycheproofTestGroupX25519{} |
| 2083 | default: | 2084 | default: |
| 2084 | log.Fatalf("Unknown test vector algorithm %q", wtv.Algorithm) | 2085 | log.Printf("INFO: Unknown test vector algorithm %q", wtv.Algorithm) |
| 2086 | return false | ||
| 2085 | } | 2087 | } |
| 2086 | 2088 | ||
| 2087 | success := true | 2089 | success := true |
| @@ -2188,6 +2190,8 @@ func main() { | |||
| 2188 | 2190 | ||
| 2189 | success := true | 2191 | success := true |
| 2190 | 2192 | ||
| 2193 | skip := regexp.MustCompile(`_(p1363|sha3|sha512_256)_`) | ||
| 2194 | |||
| 2191 | for _, test := range tests { | 2195 | for _, test := range tests { |
| 2192 | webcrypto := test.name == "ECDSAWebCrypto" || test.name == "ECDHWebCrypto" | 2196 | webcrypto := test.name == "ECDSAWebCrypto" || test.name == "ECDHWebCrypto" |
| 2193 | tvs, err := filepath.Glob(filepath.Join(testVectorPath, test.pattern)) | 2197 | tvs, err := filepath.Glob(filepath.Join(testVectorPath, test.pattern)) |
| @@ -2198,6 +2202,10 @@ func main() { | |||
| 2198 | log.Fatalf("Failed to find %v test vectors at %q\n", test.name, testVectorPath) | 2202 | log.Fatalf("Failed to find %v test vectors at %q\n", test.name, testVectorPath) |
| 2199 | } | 2203 | } |
| 2200 | for _, tv := range tvs { | 2204 | for _, tv := range tvs { |
| 2205 | if skip.Match([]byte(tv)) { | ||
| 2206 | fmt.Printf("INFO: Skipping tests from %s\n", tv) | ||
| 2207 | continue | ||
| 2208 | } | ||
| 2201 | if !runTestVectors(tv, webcrypto) { | 2209 | if !runTestVectors(tv, webcrypto) { |
| 2202 | success = false | 2210 | success = false |
| 2203 | } | 2211 | } |
