From d7320afd75964278f3f34b1191867cd0158a2e0f Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 30 Sep 2018 10:56:46 +0000 Subject: in ECDH, gather statistics where it makes more sense --- src/regress/lib/libcrypto/wycheproof/wycheproof.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index fcd806f29e..e00edc03a2 100644 --- a/src/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/src/regress/lib/libcrypto/wycheproof/wycheproof.go @@ -1,4 +1,4 @@ -/* $OpenBSD: wycheproof.go,v 1.66 2018/09/22 15:53:38 tb Exp $ */ +/* $OpenBSD: wycheproof.go,v 1.67 2018/09/30 10:56:46 tb Exp $ */ /* * Copyright (c) 2018 Joel Sing * Copyright (c) 2018 Theo Buehler @@ -1180,13 +1180,7 @@ func runECDHTest(nid int, doECpoint bool, wt *wycheproofTestECDH) bool { C.free(unsafe.Pointer(Cpub)) if pubKey == nil { - if wt.Result == "invalid" { - return true - } - if wt.Result == "acceptable" { - if acceptableAudit { - gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) - } + if wt.Result == "invalid" || wt.Result == "acceptable" { return true } fmt.Printf("FAIL: Test case %d (%q) %v - ASN decoding failed: want %v\n", wt.TCID, wt.Comment, wt.Flags, wt.Result) @@ -1223,6 +1217,9 @@ func runECDHTest(nid int, doECpoint bool, wt *wycheproofTestECDH) bool { fmt.Printf("FAIL: Test case %d (%q) %v - expected and computed shared secret do not match, want %v\n", wt.TCID, wt.Comment, wt.Flags, wt.Result) success = false } + if acceptableAudit && success && wt.Result == "acceptable" { + gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) + } return success } -- cgit v1.2.3-55-g6feb