diff options
author | tb <> | 2018-09-02 17:28:01 +0000 |
---|---|---|
committer | tb <> | 2018-09-02 17:28:01 +0000 |
commit | 370f9fa0367534079ddbc8803a5865cad0ebfb4c (patch) | |
tree | a61ed2faf4d88c31a18063c7b593a849a5e75e3d /src | |
parent | cc02eab4436984cdd6418f08392dc7247b5d6aab (diff) | |
download | openbsd-370f9fa0367534079ddbc8803a5865cad0ebfb4c.tar.gz openbsd-370f9fa0367534079ddbc8803a5865cad0ebfb4c.tar.bz2 openbsd-370f9fa0367534079ddbc8803a5865cad0ebfb4c.zip |
Unify FAIL printfs.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index ac7d3e964b..4fcd3e2043 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.42 2018/09/02 17:24:02 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.43 2018/09/02 17:28:01 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> |
@@ -555,7 +555,7 @@ func checkAesCcmOrGcm(algorithm string, ctx *C.EVP_CIPHER_CTX, doEncrypt int, ke | |||
555 | if wt.Result == "invalid" { | 555 | if wt.Result == "invalid" { |
556 | return true | 556 | return true |
557 | } | 557 | } |
558 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CipherUpdate failed: got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 558 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CipherUpdate() = %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
559 | return false | 559 | return false |
560 | } | 560 | } |
561 | 561 | ||
@@ -565,7 +565,7 @@ func checkAesCcmOrGcm(algorithm string, ctx *C.EVP_CIPHER_CTX, doEncrypt int, ke | |||
565 | 565 | ||
566 | ret = C.EVP_CipherFinal_ex(ctx, (*C.uchar)(unsafe.Pointer(&dummyOut[0])), &tmpLen) | 566 | ret = C.EVP_CipherFinal_ex(ctx, (*C.uchar)(unsafe.Pointer(&dummyOut[0])), &tmpLen) |
567 | if ret != 1 { | 567 | if ret != 1 { |
568 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CipherFinal_ex() failed: got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 568 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CipherFinal_ex() = %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
569 | return false | 569 | return false |
570 | } | 570 | } |
571 | cipherOutLen += tmpLen | 571 | cipherOutLen += tmpLen |
@@ -585,7 +585,7 @@ func checkAesCcmOrGcm(algorithm string, ctx *C.EVP_CIPHER_CTX, doEncrypt int, ke | |||
585 | tagOut := make([]byte, tagLen) | 585 | tagOut := make([]byte, tagLen) |
586 | ret = C.EVP_CIPHER_CTX_ctrl(ctx, ctrlGetTag, C.int(tagLen), unsafe.Pointer(&tagOut[0])) | 586 | ret = C.EVP_CIPHER_CTX_ctrl(ctx, ctrlGetTag, C.int(tagLen), unsafe.Pointer(&tagOut[0])) |
587 | if ret != 1 { | 587 | if ret != 1 { |
588 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CIPHER_CTX_ctrl() failed: got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 588 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CIPHER_CTX_ctrl() = %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
589 | return false | 589 | return false |
590 | } | 590 | } |
591 | // XXX audit acceptable cases... | 591 | // XXX audit acceptable cases... |
@@ -739,13 +739,13 @@ func runAesCmacTest(cipher *C.EVP_CIPHER, wt *wycheproofTestAesCmac) bool { | |||
739 | 739 | ||
740 | ret := C.CMAC_Init(ctx, unsafe.Pointer(&key[0]), C.size_t(keyLen), cipher, nil) | 740 | ret := C.CMAC_Init(ctx, unsafe.Pointer(&key[0]), C.size_t(keyLen), cipher, nil) |
741 | if ret != 1 { | 741 | if ret != 1 { |
742 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Init() failed. got %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) | 742 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Init() = %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) |
743 | return false | 743 | return false |
744 | } | 744 | } |
745 | 745 | ||
746 | ret = C.CMAC_Update(ctx, unsafe.Pointer(&msg[0]), C.size_t(msgLen)) | 746 | ret = C.CMAC_Update(ctx, unsafe.Pointer(&msg[0]), C.size_t(msgLen)) |
747 | if ret != 1 { | 747 | if ret != 1 { |
748 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Update() failed. got %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) | 748 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Update() = %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) |
749 | return false | 749 | return false |
750 | } | 750 | } |
751 | 751 | ||
@@ -754,7 +754,7 @@ func runAesCmacTest(cipher *C.EVP_CIPHER, wt *wycheproofTestAesCmac) bool { | |||
754 | 754 | ||
755 | ret = C.CMAC_Final(ctx, (*C.uchar)(unsafe.Pointer(&outTag[0])), &outLen) | 755 | ret = C.CMAC_Final(ctx, (*C.uchar)(unsafe.Pointer(&outTag[0])), &outLen) |
756 | if ret != 1 { | 756 | if ret != 1 { |
757 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Final() failed. got %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) | 757 | fmt.Printf("FAIL: Test case %d (%q) - CMAC_Final() = %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) |
758 | return false | 758 | return false |
759 | } | 759 | } |
760 | 760 | ||
@@ -1092,7 +1092,7 @@ func runECDHTest(nid int, doECpoint bool, wt *wycheproofTestECDH) bool { | |||
1092 | 1092 | ||
1093 | ret := C.EC_KEY_set_private_key(privKey, bnPriv) | 1093 | ret := C.EC_KEY_set_private_key(privKey, bnPriv) |
1094 | if ret != 1 { | 1094 | if ret != 1 { |
1095 | fmt.Printf("FAIL: Test case %d (%q) - EC_KEY_set_private_key failed: got %d want %v\n", wt.TCID, wt.Comment, ret, wt.Result) | 1095 | fmt.Printf("FAIL: Test case %d (%q) - EC_KEY_set_private_key() = %d, want %v\n", wt.TCID, wt.Comment, ret, wt.Result) |
1096 | return false | 1096 | return false |
1097 | } | 1097 | } |
1098 | 1098 | ||