From ddd7dccb873af6a9c5072e66897fa28fa9c0559d Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 27 Apr 2020 19:42:34 +0000 Subject: 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 --- src/regress/lib/libcrypto/wycheproof/wycheproof.go | 6 +++--- 1 file 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 @@ -/* $OpenBSD: wycheproof.go,v 1.117 2020/04/27 19:34:59 tb Exp $ */ +/* $OpenBSD: wycheproof.go,v 1.118 2020/04/27 19:42:34 tb Exp $ */ /* * Copyright (c) 2018 Joel Sing * Copyright (c) 2018, 2019 Theo Buehler @@ -605,13 +605,13 @@ func checkAesCbcPkcs5(ctx *C.EVP_CIPHER_CTX, doEncrypt int, key []byte, keyLen i return false } - openedMsg := out[0:cipherOutLen] + openedMsg := cipherOut[0:cipherOutLen] if outLen == 0 { out = nil } success := false - if bytes.Equal(openedMsg, out) || wt.Result == "invalid" { + if bytes.Equal(openedMsg, out) == (wt.Result != "invalid") { success = true if acceptableAudit && wt.Result == "acceptable" { gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) -- cgit v1.2.3-55-g6feb