summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-10-18 21:30:05 +0000
committertb <>2018-10-18 21:30:05 +0000
commitef19c38a86d684a838df8cefa5f8154f86f65bcc (patch)
tree48f25aefa99a2ee913de793e719b89a75bc52d08
parent5f07e3b5efd218c2a558f5960ef6a0eb72020d71 (diff)
downloadopenbsd-ef19c38a86d684a838df8cefa5f8154f86f65bcc.tar.gz
openbsd-ef19c38a86d684a838df8cefa5f8154f86f65bcc.tar.bz2
openbsd-ef19c38a86d684a838df8cefa5f8154f86f65bcc.zip
Avoid a bad out of bounds access that caused intermittent crashes.
-rw-r--r--src/regress/lib/libcrypto/wycheproof/wycheproof.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go
index ff15d30962..a4360d2904 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.81 2018/10/07 04:40:14 tb Exp $ */ 1/* $OpenBSD: wycheproof.go,v 1.82 2018/10/18 21:30: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>
@@ -1698,7 +1698,7 @@ func runRSASSATest(rsa *C.RSA, h hash.Hash, sha *C.EVP_MD, mgfSha *C.EVP_MD, sLe
1698 sig = append(sig, 0) 1698 sig = append(sig, 0)
1699 } 1699 }
1700 1700
1701 sigOut := make([]byte, sigLen) 1701 sigOut := make([]byte, C.RSA_size(rsa) - 11)
1702 if sigLen == 0 { 1702 if sigLen == 0 {
1703 sigOut = append(sigOut, 0) 1703 sigOut = append(sigOut, 0)
1704 } 1704 }