From 7ff63dc8bd7dbad26207de0396f83320e8e5c3a4 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 20 Oct 2018 16:02:05 +0000 Subject: With the fixed length checks in aes_wrap.c 1.11, we can remove the ugly length checks here. --- src/regress/lib/libcrypto/wycheproof/wycheproof.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index bf9d09fb09..9bc4e5fd8b 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.85 2018/10/19 06:12:35 tb Exp $ */ +/* $OpenBSD: wycheproof.go,v 1.86 2018/10/20 16:02:05 tb Exp $ */ /* * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> @@ -1703,11 +1703,7 @@ func runKWTestWrap(keySize int, key []byte, keyLen int, msg []byte, msgLen int, outLen := msgLen + 8 out := make([]byte, outLen) - // XXX remove workaround once fix to aes_wrap.c is committed - ret = -1 - if msgLen > 8 { - ret = C.AES_wrap_key((*C.AES_KEY)(unsafe.Pointer(&aesKey)), nil, (*C.uchar)(unsafe.Pointer(&out[0])), (*C.uchar)(unsafe.Pointer(&msg[0])), (C.uint)(msgLen)) - } + ret = C.AES_wrap_key((*C.AES_KEY)(unsafe.Pointer(&aesKey)), nil, (*C.uchar)(unsafe.Pointer(&out[0])), (*C.uchar)(unsafe.Pointer(&msg[0])), (C.uint)(msgLen)) success := false if ret == C.int(outLen) && bytes.Equal(out, ct) { if acceptableAudit && wt.Result == "acceptable" { @@ -1740,11 +1736,7 @@ func runKWTestUnWrap(keySize int, key []byte, keyLen int, msg []byte, msgLen int if ctLen == 0 { out = append(out, 0) } - // XXX remove workaround once fix to aes_wrap.c is committed - ret = -1 - if ctLen > 16 { - ret = C.AES_unwrap_key((*C.AES_KEY)(unsafe.Pointer(&aesKey)), nil, (*C.uchar)(unsafe.Pointer(&out[0])), (*C.uchar)(unsafe.Pointer(&ct[0])), (C.uint)(ctLen)) - } + ret = C.AES_unwrap_key((*C.AES_KEY)(unsafe.Pointer(&aesKey)), nil, (*C.uchar)(unsafe.Pointer(&out[0])), (*C.uchar)(unsafe.Pointer(&ct[0])), (C.uint)(ctLen)) success := false if ret == C.int(ctLen - 8) && bytes.Equal(out[0:ret], msg[0:ret]) { if acceptableAudit && wt.Result == "acceptable" { -- cgit v1.2.3-55-g6feb