Skip to content

Commit b8599ec

Browse files
authored
config: Update openssl v2 module (#178)
* config: Update openssl v2 module * patches: update 001 patch
1 parent c8eb1f4 commit b8599ec

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

config/versions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"github.com/golang-fips/go": "main",
3-
"github.com/golang-fips/openssl": "576fe0d377882f8d0fd6537762ef2ff7918facc8",
4-
"github.com/golang/go": "go1.22.1"
2+
"github.com/golang-fips/go": "main",
3+
"github.com/golang-fips/openssl": "85d31d0d257ce842c8a1e63c4d230ae850348136",
4+
"github.com/golang/go": "go1.22.1"
55
}

patches/001-initial-openssl-for-fips.patch

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,24 +3719,24 @@ index 910679756f..44ebc7c15f 100644
37193719
} else {
37203720
testCurve = elliptic.P384()
37213721
diff --git a/src/go.mod b/src/go.mod
3722-
index c18ae7760f..0cff10a255 100644
3722+
index c18ae7760f..12a1a3a4d6 100644
37233723
--- a/src/go.mod
37243724
+++ b/src/go.mod
37253725
@@ -3,6 +3,7 @@ module std
37263726
go 1.22
37273727

37283728
require (
3729-
+ github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20240221195800-576fe0d37788
3729+
+ github.com/golang-fips/openssl/v2 v2.0.1
37303730
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb
37313731
golang.org/x/net v0.19.0
37323732
)
37333733
diff --git a/src/go.sum b/src/go.sum
3734-
index 7c3519882a..40a8b2ac04 100644
3734+
index 7c3519882a..aeb3130373 100644
37353735
--- a/src/go.sum
37363736
+++ b/src/go.sum
37373737
@@ -1,3 +1,5 @@
3738-
+github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20240221195800-576fe0d37788 h1:YCg1cLYMq0/36XzGcVt8rqnNCFC4HwK19/h3lbgBymc=
3739-
+github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20240221195800-576fe0d37788/go.mod h1:7tuBqX2Zov8Yq5mJ2yzlKhpnxOnWyEzi38AzeWRuQdg=
3738+
+github.com/golang-fips/openssl/v2 v2.0.1 h1:oNIu7tARUHmSIY7Gqn5lbSCnHSduvkFJoM2FRq294lA=
3739+
+github.com/golang-fips/openssl/v2 v2.0.1/go.mod h1:7tuBqX2Zov8Yq5mJ2yzlKhpnxOnWyEzi38AzeWRuQdg=
37403740
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb h1:1ceSY7sk6sJuiDREHpfyrqDnDljsLfEP2GuTClhBBfI=
37413741
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
37423742
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
@@ -4022,7 +4022,7 @@ index 0000000000..6461f241f8
40224022
+type BigInt []uint
40234023
diff --git a/src/vendor/github.com/golang-fips/openssl/v2/cipher.go b/src/vendor/github.com/golang-fips/openssl/v2/cipher.go
40244024
new file mode 100644
4025-
index 0000000000..ddaadfa889
4025+
index 0000000000..2b983c5411
40264026
--- /dev/null
40274027
+++ b/src/vendor/github.com/golang-fips/openssl/v2/cipher.go
40284028
@@ -0,0 +1,582 @@
@@ -4561,12 +4561,12 @@ index 0000000000..ddaadfa889
45614561
+ return
45624562
+}
45634563
+
4564-
+func newCipherCtx(kind cipherKind, mode cipherMode, encrypt cipherOp, key, iv []byte) (ctx C.GO_EVP_CIPHER_CTX_PTR, err error) {
4564+
+func newCipherCtx(kind cipherKind, mode cipherMode, encrypt cipherOp, key, iv []byte) (_ C.GO_EVP_CIPHER_CTX_PTR, err error) {
45654565
+ cipher := loadCipher(kind, mode)
45664566
+ if cipher == nil {
45674567
+ panic("crypto/cipher: unsupported cipher: " + kind.String())
45684568
+ }
4569-
+ ctx = C.go_openssl_EVP_CIPHER_CTX_new()
4569+
+ ctx := C.go_openssl_EVP_CIPHER_CTX_new()
45704570
+ if ctx == nil {
45714571
+ return nil, fail("unable to create EVP cipher ctx")
45724572
+ }
@@ -5570,7 +5570,7 @@ index 0000000000..f74bd8f8d7
55705570
+}
55715571
diff --git a/src/vendor/github.com/golang-fips/openssl/v2/evp.go b/src/vendor/github.com/golang-fips/openssl/v2/evp.go
55725572
new file mode 100644
5573-
index 0000000000..b2886e6906
5573+
index 0000000000..a9237a6a0c
55745574
--- /dev/null
55755575
+++ b/src/vendor/github.com/golang-fips/openssl/v2/evp.go
55765576
@@ -0,0 +1,471 @@
@@ -5725,7 +5725,15 @@ index 0000000000..b2886e6906
57255725
+
57265726
+func setupEVP(withKey withKeyFunc, padding C.int,
57275727
+ h, mgfHash hash.Hash, label []byte, saltLen C.int, ch crypto.Hash,
5728-
+ init initFunc) (ctx C.GO_EVP_PKEY_CTX_PTR, err error) {
5728+
+ init initFunc) (_ C.GO_EVP_PKEY_CTX_PTR, err error) {
5729+
+ var ctx C.GO_EVP_PKEY_CTX_PTR
5730+
+ withKey(func(pkey C.GO_EVP_PKEY_PTR) C.int {
5731+
+ ctx = C.go_openssl_EVP_PKEY_CTX_new(pkey, nil)
5732+
+ return 1
5733+
+ })
5734+
+ if ctx == nil {
5735+
+ return nil, newOpenSSLError("EVP_PKEY_CTX_new failed")
5736+
+ }
57295737
+ defer func() {
57305738
+ if err != nil {
57315739
+ if ctx != nil {
@@ -5734,14 +5742,6 @@ index 0000000000..b2886e6906
57345742
+ }
57355743
+ }
57365744
+ }()
5737-
+
5738-
+ withKey(func(pkey C.GO_EVP_PKEY_PTR) C.int {
5739-
+ ctx = C.go_openssl_EVP_PKEY_CTX_new(pkey, nil)
5740-
+ return 1
5741-
+ })
5742-
+ if ctx == nil {
5743-
+ return nil, newOpenSSLError("EVP_PKEY_CTX_new failed")
5744-
+ }
57455745
+ if err := init(ctx); err != nil {
57465746
+ return nil, err
57475747
+ }
@@ -9688,11 +9688,11 @@ index 0000000000..5de62f95a7
96889688
+ return nil
96899689
+}
96909690
diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
9691-
index 338c496bf9..cae6a5f4fe 100644
9691+
index 338c496bf9..187322fab6 100644
96929692
--- a/src/vendor/modules.txt
96939693
+++ b/src/vendor/modules.txt
96949694
@@ -1,3 +1,7 @@
9695-
+# github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20240221195800-576fe0d37788
9695+
+# github.com/golang-fips/openssl/v2 v2.0.1
96969696
+## explicit; go 1.20
96979697
+github.com/golang-fips/openssl/v2
96989698
+github.com/golang-fips/openssl/v2/bbig

0 commit comments

Comments
 (0)