Compare commits
No commits in common. "imports/c8-beta-stream-rhel8/golang-1.20.6-2.module_el8+658+f14b2092" and "c8-stream-rhel8" have entirely different histories.
imports/c8
...
c8-stream-
|
@ -1,2 +1,2 @@
|
|||
SOURCES/go1.20.6-1-openssl-fips.tar.gz
|
||||
SOURCES/go1.20.6.tar.gz
|
||||
SOURCES/go1.20.12-2-openssl-fips.tar.gz
|
||||
SOURCES/go1.20.12.tar.gz
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
f6dd720106f39e9398c0ca2a327f1705704778b4 SOURCES/go1.20.6-1-openssl-fips.tar.gz
|
||||
ea70e31718a67c736667f7f6dbe2c23d7708255d SOURCES/go1.20.6.tar.gz
|
||||
f57205df5fc5d2e0392ca39c795c6d60d22f0c80 SOURCES/go1.20.12-2-openssl-fips.tar.gz
|
||||
6d5bc127443fc42b1af8d9ba4115abe18554feb7 SOURCES/go1.20.12.tar.gz
|
||||
|
|
|
@ -0,0 +1,172 @@
|
|||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go
|
||||
index 56adf47bf6..9537870e3c 100644
|
||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go
|
||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go
|
||||
@@ -22,22 +22,10 @@ var (
|
||||
type PublicKeyECDH struct {
|
||||
_pkey *C.GO_EVP_PKEY
|
||||
bytes []byte
|
||||
-
|
||||
- // priv is only set when PublicKeyECDH is derived from a private key,
|
||||
- // in which case priv's finalizer is responsible for freeing _pkey.
|
||||
- // This ensures priv is not finalized while the public key is alive,
|
||||
- // which could cause use-after-free and double-free behavior.
|
||||
- //
|
||||
- // We could avoid this altogether by using EVP_PKEY_up_ref
|
||||
- // when instantiating a derived public key, unfortunately
|
||||
- // it is not available on OpenSSL 1.0.2.
|
||||
- priv *PrivateKeyECDH
|
||||
}
|
||||
|
||||
func (k *PublicKeyECDH) finalize() {
|
||||
- if k.priv == nil {
|
||||
- C._goboringcrypto_EVP_PKEY_free(k._pkey)
|
||||
- }
|
||||
+ C._goboringcrypto_EVP_PKEY_free(k._pkey)
|
||||
}
|
||||
|
||||
type PrivateKeyECDH struct {
|
||||
@@ -58,7 +46,7 @@ func NewPublicKeyECDH(curve string, bytes []byte) (*PublicKeyECDH, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
- k := &PublicKeyECDH{pkey, append([]byte(nil), bytes...), nil}
|
||||
+ k := &PublicKeyECDH{pkey, append([]byte(nil), bytes...)}
|
||||
runtime.SetFinalizer(k, (*PublicKeyECDH).finalize)
|
||||
return k, nil
|
||||
}
|
||||
@@ -87,14 +75,22 @@ func (k *PrivateKeyECDH) PublicKey() (*PublicKeyECDH, error) {
|
||||
var bytes []byte
|
||||
var cbytes *C.uchar
|
||||
|
||||
- n := C._goboringcrypto_EVP_PKEY_get1_encoded_ecdh_public_key(k._pkey, &cbytes)
|
||||
+ pkey := C._goboringcrypto_EVP_PKEY_ref(k._pkey)
|
||||
+ if pkey == nil {
|
||||
+ return nil, NewOpenSSLError("EVP_PKEY_ref")
|
||||
+ }
|
||||
+ defer func() {
|
||||
+ C._goboringcrypto_EVP_PKEY_free(pkey)
|
||||
+ }()
|
||||
+ n := C._goboringcrypto_EVP_PKEY_get1_encoded_ecdh_public_key(pkey, &cbytes)
|
||||
if n == 0 {
|
||||
return nil, NewOpenSSLError("EVP_PKEY_get1_encoded_ecdh_public_key")
|
||||
}
|
||||
bytes = C.GoBytes(unsafe.Pointer(cbytes), C.int(n))
|
||||
C.free(unsafe.Pointer(cbytes))
|
||||
|
||||
- pub := &PublicKeyECDH{k._pkey, bytes, k}
|
||||
+ pub := &PublicKeyECDH{pkey, bytes}
|
||||
+ pkey = nil
|
||||
runtime.SetFinalizer(pub, (*PublicKeyECDH).finalize)
|
||||
return pub, nil
|
||||
}
|
||||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h b/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h
|
||||
index a900b3f9e7..03367d5520 100644
|
||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h
|
||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h
|
||||
@@ -827,6 +827,9 @@ DEFINEFUNC(GO_EVP_PKEY *, EVP_PKEY_new, (void), ())
|
||||
DEFINEFUNC(void, EVP_PKEY_free, (GO_EVP_PKEY * arg0), (arg0))
|
||||
DEFINEFUNC(int, EVP_PKEY_set1_RSA, (GO_EVP_PKEY * arg0, GO_RSA *arg1), (arg0, arg1))
|
||||
DEFINEFUNC(int, EVP_PKEY_set1_EC_KEY, (GO_EVP_PKEY * arg0, GO_EC_KEY *arg1), (arg0, arg1))
|
||||
+DEFINEFUNC(const GO_EC_KEY *, EVP_PKEY_get0_EC_KEY, (const GO_EVP_PKEY *pkey), (pkey))
|
||||
+GO_EVP_PKEY *_goboringcrypto_EVP_PKEY_ref(GO_EVP_PKEY *pkey);
|
||||
+
|
||||
DEFINEFUNC(int, EVP_PKEY_verify,
|
||||
(EVP_PKEY_CTX *ctx, const unsigned char *sig, unsigned int siglen, const unsigned char *tbs, size_t tbslen),
|
||||
(ctx, sig, siglen, tbs, tbslen))
|
||||
@@ -1083,15 +1086,6 @@ enum {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
DEFINEFUNC(int, EVP_PKEY_set1_encoded_public_key, (GO_EVP_PKEY *pkey, const unsigned char *pub, size_t publen), (pkey, pub, publen))
|
||||
DEFINEFUNC(size_t, EVP_PKEY_get1_encoded_public_key, (GO_EVP_PKEY *pkey, unsigned char **ppub), (pkey, ppub))
|
||||
-
|
||||
-DEFINEFUNC(const GO_EC_KEY *, EVP_PKEY_get0_EC_KEY, (const GO_EVP_PKEY *pkey), (pkey))
|
||||
-#else
|
||||
-DEFINEFUNCINTERNAL(void *, EVP_PKEY_get0, (const GO_EVP_PKEY *pkey), (pkey))
|
||||
-static const GO_EC_KEY *
|
||||
-_goboringcrypto_EVP_PKEY_get0_EC_KEY(const GO_EVP_PKEY *pkey)
|
||||
-{
|
||||
- return _goboringcrypto_internal_EVP_PKEY_get0(pkey);
|
||||
-}
|
||||
#endif
|
||||
|
||||
GO_EVP_PKEY *_goboringcrypto_EVP_PKEY_new_for_ecdh(int nid, const uint8_t *bytes, size_t len, int is_private);
|
||||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
index 24a9615108..c6b23a984b 100644
|
||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
@@ -5,6 +5,7 @@
|
||||
// +build !msan
|
||||
|
||||
#include "goopenssl.h"
|
||||
+#include <assert.h>
|
||||
|
||||
int _goboringcrypto_EVP_sign(EVP_MD *md, EVP_PKEY_CTX *ctx, const uint8_t *msg,
|
||||
size_t msgLen, uint8_t *sig, size_t *slen,
|
||||
@@ -138,3 +139,52 @@ err:
|
||||
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
+DEFINEFUNCINTERNAL(int, EVP_PKEY_up_ref, (GO_EVP_PKEY *pkey), (pkey))
|
||||
+
|
||||
+GO_EVP_PKEY *
|
||||
+_goboringcrypto_EVP_PKEY_ref(GO_EVP_PKEY *pkey)
|
||||
+{
|
||||
+ if (_goboringcrypto_internal_EVP_PKEY_up_ref(pkey) != 1)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return pkey;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+GO_EVP_PKEY *
|
||||
+_goboringcrypto_EVP_PKEY_ref(GO_EVP_PKEY *pkey)
|
||||
+{
|
||||
+ GO_EVP_PKEY *result = NULL;
|
||||
+
|
||||
+ if (pkey->type != EVP_PKEY_EC && pkey->type != EVP_PKEY_RSA)
|
||||
+ return NULL;
|
||||
+
|
||||
+ result = _goboringcrypto_EVP_PKEY_new();
|
||||
+ if (!result)
|
||||
+ goto err;
|
||||
+
|
||||
+ switch (pkey->type) {
|
||||
+ case EVP_PKEY_EC:
|
||||
+ if (_goboringcrypto_EVP_PKEY_set1_EC_KEY(result, _goboringcrypto_EVP_PKEY_get0_EC_KEY()) != 1)
|
||||
+ goto err;
|
||||
+ break;
|
||||
+
|
||||
+ case EVP_PKEY_RSA:
|
||||
+ if (_goboringcrypto_EVP_PKEY_set1_RSA_KEY(result, _goboringcrypto_EVP_PKEY_get0_RSA_KEY()) != 1)
|
||||
+ goto err;
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ assert(0);
|
||||
+ }
|
||||
+
|
||||
+ return result;
|
||||
+
|
||||
+err:
|
||||
+ _goboringcrypto_EVP_PKEY_free(result);
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go
|
||||
index 75ba7a8a59..1e016676a0 100644
|
||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go
|
||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go
|
||||
@@ -116,7 +116,9 @@ func (k *PrivateKeyRSA) withKey(f func(*C.GO_RSA) C.int) C.int {
|
||||
|
||||
func setupRSA(withKey func(func(*C.GO_RSA) C.int) C.int,
|
||||
padding C.int, h hash.Hash, label []byte, saltLen int, ch crypto.Hash,
|
||||
- init func(*C.GO_EVP_PKEY_CTX) C.int) (pkey *C.GO_EVP_PKEY, ctx *C.GO_EVP_PKEY_CTX, err error) {
|
||||
+ init func(*C.GO_EVP_PKEY_CTX) C.int) (_ *C.GO_EVP_PKEY,_ *C.GO_EVP_PKEY_CTX, err error) {
|
||||
+ var pkey *C.GO_EVP_PKEY
|
||||
+ var ctx *C.GO_EVP_PKEY_CTX
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if pkey != nil {
|
|
@ -1,48 +0,0 @@
|
|||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
index 76bac5b..24a9615 100644
|
||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
||||
@@ -43,7 +43,11 @@ int _goboringcrypto_EVP_sign_raw(EVP_MD *md, EVP_PKEY_CTX *ctx, const uint8_t *m
|
||||
GO_RSA *rsa_key) {
|
||||
int ret = 0;
|
||||
GO_EVP_PKEY *pk = _goboringcrypto_EVP_PKEY_new();
|
||||
- _goboringcrypto_EVP_PKEY_assign_RSA(pk, rsa_key);
|
||||
+ if (!pk)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!(_goboringcrypto_EVP_PKEY_set1_RSA(pk, rsa_key)))
|
||||
+ goto err;
|
||||
|
||||
if (!ctx && !(ctx = _goboringcrypto_EVP_PKEY_CTX_new(pk, NULL)))
|
||||
goto err;
|
||||
@@ -63,6 +67,8 @@ int _goboringcrypto_EVP_sign_raw(EVP_MD *md, EVP_PKEY_CTX *ctx, const uint8_t *m
|
||||
err:
|
||||
if (ctx)
|
||||
_goboringcrypto_EVP_PKEY_CTX_free(ctx);
|
||||
+ if (pk)
|
||||
+ _goboringcrypto_EVP_PKEY_free(pk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -103,7 +109,11 @@ int _goboringcrypto_EVP_verify_raw(const uint8_t *msg, size_t msgLen,
|
||||
int ret = 0;
|
||||
EVP_PKEY_CTX *ctx;
|
||||
GO_EVP_PKEY *pk = _goboringcrypto_EVP_PKEY_new();
|
||||
- _goboringcrypto_EVP_PKEY_assign_RSA(pk, rsa_key);
|
||||
+ if (!pk)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!(_goboringcrypto_EVP_PKEY_set1_RSA(pk, rsa_key)))
|
||||
+ goto err;
|
||||
|
||||
if (!(ctx = _goboringcrypto_EVP_PKEY_CTX_new(pk, NULL)))
|
||||
goto err;
|
||||
@@ -123,6 +133,8 @@ int _goboringcrypto_EVP_verify_raw(const uint8_t *msg, size_t msgLen,
|
||||
err:
|
||||
if (ctx)
|
||||
_goboringcrypto_EVP_PKEY_CTX_free(ctx);
|
||||
+ if (pk)
|
||||
+ _goboringcrypto_EVP_PKEY_free(pk);
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/src/crypto/rsa/pkcs1v15_test.go b/src/crypto/rsa/pkcs1v15_test.go
|
||||
index 0853178e3a..16eb37734b 100644
|
||||
--- a/src/crypto/rsa/pkcs1v15_test.go
|
||||
+++ b/src/crypto/rsa/pkcs1v15_test.go
|
||||
@@ -247,6 +247,10 @@ func TestVerifyPKCS1v15(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOverlongMessagePKCS1v15(t *testing.T) {
|
||||
+ // OpenSSL now returns a random string instead of an error
|
||||
+ if boring.Enabled() {
|
||||
+ t.Skip("Not relevant in boring mode")
|
||||
+ }
|
||||
ciphertext := decodeBase64("fjOVdirUzFoLlukv80dBllMLjXythIf22feqPrNo0YoIjzyzyoMFiLjAc/Y4krkeZ11XFThIrEvw\nkRiZcCq5ng==")
|
||||
_, err := DecryptPKCS1v15(nil, rsaPrivateKey, ciphertext)
|
||||
if err == nil {
|
|
@ -92,12 +92,12 @@
|
|||
%endif
|
||||
|
||||
%global go_api 1.20
|
||||
%global version 1.20.6
|
||||
%global pkg_release 1
|
||||
%global version 1.20.12
|
||||
%global pkg_release 2
|
||||
|
||||
Name: golang
|
||||
Version: %{version}
|
||||
Release: 2%{?dist}
|
||||
Release: 8%{?dist}
|
||||
|
||||
Summary: The Go Programming Language
|
||||
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
|
||||
|
@ -140,12 +140,14 @@ Requires: diffutils
|
|||
|
||||
# Proposed patch by jcajka https://golang.org/cl/86541
|
||||
Patch221: fix_TestScript_list_std.patch
|
||||
Patch222: skip-test-overlong-message.patch
|
||||
|
||||
Patch1939923: skip_test_rhbz1939923.patch
|
||||
|
||||
Patch2: disable_static_tests_part1.patch
|
||||
Patch3: disable_static_tests_part2.patch
|
||||
Patch6: fix-memory-leak-evp-sign-verify.patch
|
||||
Patch2: disable_static_tests_part1.patch
|
||||
Patch3: disable_static_tests_part2.patch
|
||||
|
||||
Patch229: fix-memleak-rsa-ecdh.patch
|
||||
|
||||
# Having documentation separate was broken
|
||||
Obsoletes: %{name}-docs < 1.1-4
|
||||
|
@ -242,8 +244,10 @@ Requires: %{name} = %{version}-%{release}
|
|||
pushd ..
|
||||
tar -xf %{SOURCE1}
|
||||
popd
|
||||
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/000-initial-setup.patch
|
||||
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/001-initial-openssl-for-fips.patch
|
||||
|
||||
for patch in ../go-go%{version}-%{pkg_release}-openssl-fips/patches/*.patch; do
|
||||
patch -p1 < "${patch}"
|
||||
done
|
||||
|
||||
# Configure crypto tests
|
||||
pushd ../go-go%{version}-%{pkg_release}-openssl-fips
|
||||
|
@ -253,12 +257,15 @@ popd
|
|||
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch6 -p1
|
||||
|
||||
%patch221 -p1
|
||||
%patch222 -p1
|
||||
|
||||
%patch229 -p1
|
||||
|
||||
%patch1939923 -p1
|
||||
|
||||
|
||||
cp %{SOURCE2} ./src/runtime/
|
||||
|
||||
%build
|
||||
|
@ -519,6 +526,33 @@ cd ..
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Apr 10 2024 David Benoit <dbenoit@redhat.com> - 1.20.12-8
|
||||
- Update sources file
|
||||
- Related: RHEL-27928
|
||||
|
||||
* Tue Apr 09 2024 David Benoit <dbenoit@redhat.com> - 1.20.12-7
|
||||
- Fix CVE-2024-1394
|
||||
- Resolves: RHEL-27928
|
||||
|
||||
* Mon Apr 08 2024 Derek Parker <deparker@redhat.com> - 1.20.12-6
|
||||
- Fix CVE-2023-45288
|
||||
- Resolves: RHEL-31914
|
||||
|
||||
* Wed Dec 13 2023 David Benoit <dbenoit@redhat.com> - 1.20.12-2
|
||||
- Fix sources file
|
||||
- Related: RHEL-19231
|
||||
|
||||
* Tue Dec 12 2023 David Benoit <dbenoit@redhat.com> - 1.20.12-1
|
||||
- Update to Go 1.20.12
|
||||
- Fix CVE-2023-39326
|
||||
- Resolves: RHEL-19231
|
||||
|
||||
* Fri Oct 13 2023 David Benoit <dbenoit@redhat.com> - 1.20.10-1
|
||||
- Update to Go 1.20.10
|
||||
- Fix CVE-2023-39325
|
||||
- Midstream patches
|
||||
- Resolves: RHEL-12619
|
||||
|
||||
* Mon Aug 14 2023 Alejandro Sáez <asm@redhat.com> - 1.20.6-2
|
||||
- Retire golang-race package
|
||||
- Resolves: rhbz#2230599
|
||||
|
|
Loading…
Reference in New Issue