diff options
author | tb <> | 2020-04-27 19:42:34 +0000 |
---|---|---|
committer | tb <> | 2020-04-27 19:42:34 +0000 |
commit | ddd7dccb873af6a9c5072e66897fa28fa9c0559d (patch) | |
tree | faf5e8d6f1634f29d335ca90b6b7fb7ba2709788 | |
parent | 3dc4b54835daf17c64839ec42736a755195c54cf (diff) | |
download | openbsd-ddd7dccb873af6a9c5072e66897fa28fa9c0559d.tar.gz openbsd-ddd7dccb873af6a9c5072e66897fa28fa9c0559d.tar.bz2 openbsd-ddd7dccb873af6a9c5072e66897fa28fa9c0559d.zip |
Fix two bugs in the AES-CBC-PKCS5 tests that didn't hide failing tests:
1. Use the correct slice for comparing the cipher output
2. Fix logic error similar to the one in AES-GCM in the previous commit
Diffstat (limited to '')
-rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index 23e3b46431..5e3c5e46e6 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.117 2020/04/27 19:34:59 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.118 2020/04/27 19:42:34 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, 2019 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018, 2019 Theo Buehler <tb@openbsd.org> |
@@ -605,13 +605,13 @@ func checkAesCbcPkcs5(ctx *C.EVP_CIPHER_CTX, doEncrypt int, key []byte, keyLen i | |||
605 | return false | 605 | return false |
606 | } | 606 | } |
607 | 607 | ||
608 | openedMsg := out[0:cipherOutLen] | 608 | openedMsg := cipherOut[0:cipherOutLen] |
609 | if outLen == 0 { | 609 | if outLen == 0 { |
610 | out = nil | 610 | out = nil |
611 | } | 611 | } |
612 | 612 | ||
613 | success := false | 613 | success := false |
614 | if bytes.Equal(openedMsg, out) || wt.Result == "invalid" { | 614 | if bytes.Equal(openedMsg, out) == (wt.Result != "invalid") { |
615 | success = true | 615 | success = true |
616 | if acceptableAudit && wt.Result == "acceptable" { | 616 | if acceptableAudit && wt.Result == "acceptable" { |
617 | gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) | 617 | gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) |