summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-09-30 10:56:47 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-09-30 10:56:47 +0000
commitf42994ee461ee93027bed412941a33c54f230d88 (patch)
treec5df462c6f3cefe9aeda6f6b931a42ba53d87d23 /regress
parentc146e4de88553a9e4e995750ded4938b710670c0 (diff)
in ECDH, gather statistics where it makes more sense
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/wycheproof/wycheproof.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/regress/lib/libcrypto/wycheproof/wycheproof.go b/regress/lib/libcrypto/wycheproof/wycheproof.go
index fcd806f29e9..e00edc03a23 100644
--- a/regress/lib/libcrypto/wycheproof/wycheproof.go
+++ b/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 <jsing@openbsd.org>
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
@@ -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
}