Rebase to 1.16.6

This commit is contained in:
Derek Parker 2021-07-20 11:30:58 -07:00
parent 0e136d9176
commit 677ea6b2c5
5 changed files with 18 additions and 101 deletions

2
.gitignore vendored
View File

@ -36,3 +36,5 @@
/go-go-1.15.7-1-openssl-fips.tar.gz
/go-go-1.16.1-2-openssl-fips.tar.gz
/go-go-1.16.4-1-openssl-fips.tar.gz
/go-go-1.16.6-2-openssl-fips.tar.gz
/go-go-1.16.6-3-openssl-fips.tar.gz

View File

@ -96,12 +96,12 @@
%endif
%global go_api 1.16
%global go_version 1.16.4
%global pkg_release 1
%global go_version 1.16.6
%global pkg_release 3
Name: golang
Version: %{go_version}
Release: 3%{?dist}
Release: 1%{?dist}
Summary: The Go Programming Language
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
License: BSD and Public Domain
@ -151,14 +151,6 @@ Patch223: golang-1.15-warnCN.patch
Patch1939923: skip_test_rhbz1939923.patch
# cmd/link/internal: fix use of DynlinkingGo with ppc64le trampolines
# https://go-review.googlesource.com/c/go/+/315289
Patch1957961: rhbz1957961.patch
# cmd/link: disable plugin support if cgo is disabled
# https://go-review.googlesource.com/c/go/+/314449/
Patch1955035: rhbz1955035.patch
# Port to openssl 3.0
Patch1952381: rhbz1952381.patch
@ -261,10 +253,6 @@ Requires: %{name} = %{version}-%{release}
%patch1939923 -p1
%patch1957961 -p1
%patch1955035 -p1
cp %{SOURCE1} ./src/runtime/
%build
@ -578,6 +566,14 @@ cd ..
%endif
%changelog
* Tue Jul 20 2021 Derek Parker <deparker@redhat.com> - 1.16.6-1
- Rebase to 1.16.6
- Resolves: rhbz#1984124
- Replace symbols no longer present in OpenSSL 3.0 ABI
- Resolves: rhbz#1984110
- Fix TestBoringServerCurves failing when ran by itself
- Resolves: rhbz#1977914
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 1.16.4-3
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065

View File

@ -16,9 +16,9 @@ index 2ca64bf..8111b6d 100644
C._goboringcrypto_EVP_CipherUpdate(c.dec_ctx, (*C.uchar)(unsafe.Pointer(&dst[0])), &outlen, (*C.uchar)(unsafe.Pointer(&src[0])), C.int(aesBlockSize))
runtime.KeepAlive(c)
@@ -165,6 +169,11 @@ func (x *aesCBC) CryptBlocks(dst, src []byte) {
panic("crypto/cipher: CipherInit_ex failed")
}
runtime.KeepAlive(x)
if len(src) > 0 {
outlen := C.int(0)
+ // Workaround - padding detection is broken but we don't need it
+ // since we check for full blocks
+ if C._goboringcrypto_EVP_CIPHER_CTX_set_padding(x.ctx, 0) != 1 {
@ -202,14 +202,6 @@ index 3585458..0762c95 100644
#include <openssl/rand.h>
@@ -632,6 +656,7 @@ DEFINEFUNC(int, EVP_DecryptUpdate,
DEFINEFUNC(int, EVP_DecryptFinal_ex,
(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl),
(ctx, outm, outl))
+DEFINEFUNC(int, EVP_CIPHER_CTX_set_padding, (EVP_CIPHER_CTX *x, int padding), (x, padding))
DEFINEFUNC(const EVP_CIPHER*, EVP_aes_128_gcm, (void), ())
DEFINEFUNC(const EVP_CIPHER*, EVP_aes_128_cbc, (void), ())
@@ -716,6 +741,7 @@ static inline int
_goboringcrypto_EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) {
return _goboringcrypto_EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, EVP_PKEY_CTRL_MD, 0, (void *)md);

View File

@ -1,75 +0,0 @@
From 079dfdbb94013e05660e54e6c7c3654468bc4160 Mon Sep 17 00:00:00 2001
From: Lynn Boger <laboger@linux.vnet.ibm.com>
Date: Thu, 29 Apr 2021 16:07:25 -0500
Subject: [PATCH] cmd/link/internal: fix use of DynlinkingGo with ppc64le
trampolines
When creating programs with large text sections on ppc64le,
trampolines are needed for calls that are too far; however
they are not created if the code is generated such that the TOC
register r2 is initialized and maintained in the code because
then the external linker can create the trampolines. Previously
the function DynlinkingGo was used to determine this but in the
case where plugins are used, this could return true even though
r2 is not valid.
To fix this problem I've added a new function r2Valid which returns
true when the build options indicate that the r2 is
initialized and maintained. Because of the ways that
DynlinkingGo is used I wanted to maintain its previous
behavior.
Fixes #45850
Change-Id: I6d902eba6ad41757aa6474948b79acdbd479cb38
Reviewed-on: https://go-review.googlesource.com/c/go/+/315289
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
---
src/cmd/link/internal/ppc64/asm.go | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go
index 602f0b5299..539afac187 100644
--- a/src/cmd/link/internal/ppc64/asm.go
+++ b/src/cmd/link/internal/ppc64/asm.go
@@ -642,6 +642,16 @@ func archrelocaddr(ldr *loader.Loader, target *ld.Target, syms *ld.ArchSyms, r l
return int64(o2)<<32 | int64(o1)
}
+// Determine if the code was compiled so that the TOC register R2 is initialized and maintained
+func r2Valid(ctxt *ld.Link) bool {
+ switch ctxt.BuildMode {
+ case ld.BuildModeCArchive, ld.BuildModeCShared, ld.BuildModePIE, ld.BuildModeShared, ld.BuildModePlugin:
+ return true
+ }
+ // -linkshared option
+ return ctxt.IsSharedGoLink()
+}
+
// resolve direct jump relocation r in s, and add trampoline if necessary
func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) {
@@ -649,7 +659,7 @@ func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) {
// For internal linking, trampolines are always created for long calls.
// For external linking, the linker can insert a call stub to handle a long call, but depends on having the TOC address in
// r2. For those build modes with external linking where the TOC address is not maintained in r2, trampolines must be created.
- if ctxt.IsExternal() && (ctxt.DynlinkingGo() || ctxt.BuildMode == ld.BuildModeCArchive || ctxt.BuildMode == ld.BuildModeCShared || ctxt.BuildMode == ld.BuildModePIE) {
+ if ctxt.IsExternal() && r2Valid(ctxt) {
// No trampolines needed since r2 contains the TOC
return
}
@@ -703,7 +713,7 @@ func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) {
}
}
if ldr.SymType(tramp) == 0 {
- if ctxt.DynlinkingGo() || ctxt.BuildMode == ld.BuildModeCArchive || ctxt.BuildMode == ld.BuildModeCShared || ctxt.BuildMode == ld.BuildModePIE {
+ if r2Valid(ctxt) {
// Should have returned for above cases
ctxt.Errorf(s, "unexpected trampoline for shared or dynamic linking")
} else {
--
2.30.2

View File

@ -1 +1,3 @@
SHA512 (go-go-1.16.4-1-openssl-fips.tar.gz) = c99957801440519fa5145a6901fd513baa087584a7d51c726e2ac61094cf65e81798b2773c4a74fa7e904934452709a97c91e3d9cd1695b8537e4858e15b5e47
SHA512 (go-go-1.16.6-2-openssl-fips.tar.gz) = 8398c1860c7277ac61a7957fe702f0d869d291b45f08e031364c35a68319d25cbef62755c1dc790d24d080017163e469251e0fb70e68d1cbd04390b9a6c540dd
SHA512 (go-go-1.16.6-3-openssl-fips.tar.gz) = 2cf8da0ba5c35e5d319c15505a146e00a256233b9f3a2f5bd88e9524a738d7a8ed1bbeeaaa01e3a9e0fce3b24b326e10171c1e588dfbd87959ff29abf2a68dc2