summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-09-04 16:38:40 +0000
committertb <>2025-09-04 16:38:40 +0000
commitbb812db6e0414f9cfb2b1f7ea0af5111584a080c (patch)
tree0b4ccab714535fd80bce8a36b1ef3c2841682a88 /src
parent99f066b0e074e44bab8174651b96c62ac333cc64 (diff)
downloadopenbsd-bb812db6e0414f9cfb2b1f7ea0af5111584a080c.tar.gz
openbsd-bb812db6e0414f9cfb2b1f7ea0af5111584a080c.tar.bz2
openbsd-bb812db6e0414f9cfb2b1f7ea0af5111584a080c.zip
wycheproof: start migrating to testvectors_v1
In https://github.com/C2SP/wycheproof/pull/169, upstream removed the testvector/ path, thereby creating the need to migrate if we want to benefit from future changes and tests. While this has been around for a very long time and generally provided more and better coverage, there never was sufficient motivation to do so. As a first step, change use of the testVectorPath constant to use of a path variable so we can switch the tests one by one by appending _v1 when appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/wycheproof/wycheproof.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go
index 8f0dfc8b2e..7ecb344b5c 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.161 2024/11/24 10:13:16 tb Exp $ */ 1/* $OpenBSD: wycheproof.go,v 1.162 2025/09/04 16:38:40 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2018,2019,2022-2024 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2018,2019,2022-2024 Theo Buehler <tb@openbsd.org>
@@ -2767,16 +2767,17 @@ func main() {
2767 skipNormal := regexp.MustCompile(`_(ecpoint|p1363|sect\d{3}[rk]1|secp(160|192))_`) 2767 skipNormal := regexp.MustCompile(`_(ecpoint|p1363|sect\d{3}[rk]1|secp(160|192))_`)
2768 2768
2769 for _, test := range tests { 2769 for _, test := range tests {
2770 tvs, err := filepath.Glob(filepath.Join(testVectorPath, test.pattern)) 2770 path := testVectorPath
2771 tvs, err := filepath.Glob(filepath.Join(path, test.pattern))
2771 if err != nil { 2772 if err != nil {
2772 log.Fatalf("Failed to glob %v test vectors: %v", test.name, err) 2773 log.Fatalf("Failed to glob %v test vectors: %v", test.name, err)
2773 } 2774 }
2774 if len(tvs) == 0 { 2775 if len(tvs) == 0 {
2775 log.Fatalf("Failed to find %v test vectors at %q\n", test.name, testVectorPath) 2776 log.Fatalf("Failed to find %v test vectors at %q\n", test.name, path)
2776 } 2777 }
2777 for _, tv := range tvs { 2778 for _, tv := range tvs {
2778 if test.variant == Skip || (test.variant == Normal && skipNormal.Match([]byte(tv))) { 2779 if test.variant == Skip || (test.variant == Normal && skipNormal.Match([]byte(tv))) {
2779 fmt.Printf("INFO: Skipping tests from \"%s\"\n", strings.TrimPrefix(tv, testVectorPath+"/")) 2780 fmt.Printf("INFO: Skipping tests from \"%s\"\n", strings.TrimPrefix(tv, path+"/"))
2780 continue 2781 continue
2781 } 2782 }
2782 wg.Add(1) 2783 wg.Add(1)