summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2018-10-20 16:02:05 +0000
committertb <>2018-10-20 16:02:05 +0000
commit7ff63dc8bd7dbad26207de0396f83320e8e5c3a4 (patch)
treeeac306ade4db081161acde26a59b0f4a2fd0478d /src
parent108b29f9d3967dd1e6f2189a83fe627e333b132d (diff)
downloadopenbsd-7ff63dc8bd7dbad26207de0396f83320e8e5c3a4.tar.gz
openbsd-7ff63dc8bd7dbad26207de0396f83320e8e5c3a4.tar.bz2
openbsd-7ff63dc8bd7dbad26207de0396f83320e8e5c3a4.zip
With the fixed length checks in aes_wrap.c 1.11, we can remove the ugly
length checks here.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/wycheproof/wycheproof.go14
1 files changed, 3 insertions, 11 deletions
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 @@
1/* $OpenBSD: wycheproof.go,v 1.85 2018/10/19 06:12:35 tb Exp $ */ 1/* $OpenBSD: wycheproof.go,v 1.86 2018/10/20 16:02:05 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>
@@ -1703,11 +1703,7 @@ func runKWTestWrap(keySize int, key []byte, keyLen int, msg []byte, msgLen int,
1703 1703
1704 outLen := msgLen + 8 1704 outLen := msgLen + 8
1705 out := make([]byte, outLen) 1705 out := make([]byte, outLen)
1706 // XXX remove workaround once fix to aes_wrap.c is committed 1706 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))
1707 ret = -1
1708 if msgLen > 8 {
1709 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))
1710 }
1711 success := false 1707 success := false
1712 if ret == C.int(outLen) && bytes.Equal(out, ct) { 1708 if ret == C.int(outLen) && bytes.Equal(out, ct) {
1713 if acceptableAudit && wt.Result == "acceptable" { 1709 if acceptableAudit && wt.Result == "acceptable" {
@@ -1740,11 +1736,7 @@ func runKWTestUnWrap(keySize int, key []byte, keyLen int, msg []byte, msgLen int
1740 if ctLen == 0 { 1736 if ctLen == 0 {
1741 out = append(out, 0) 1737 out = append(out, 0)
1742 } 1738 }
1743 // XXX remove workaround once fix to aes_wrap.c is committed 1739 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))
1744 ret = -1
1745 if ctLen > 16 {
1746 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))
1747 }
1748 success := false 1740 success := false
1749 if ret == C.int(ctLen - 8) && bytes.Equal(out[0:ret], msg[0:ret]) { 1741 if ret == C.int(ctLen - 8) && bytes.Equal(out[0:ret], msg[0:ret]) {
1750 if acceptableAudit && wt.Result == "acceptable" { 1742 if acceptableAudit && wt.Result == "acceptable" {