Skip to content

Commit e38dcd1

Browse files
authored
Merge branch 'main' into docs/update-sda-cmd-docs
2 parents c513bca + 9e1a44a commit e38dcd1

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

charts/sda-db/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: sda-db
3-
version: 0.8.56
4-
appVersion: v0.3.114
3+
version: 0.8.57
4+
appVersion: v0.3.119
55
kubeVersion: '>= 1.26.0'
66
description: Database component for Sensitive Data Archive (SDA) installation
77
home: https://neic-sda.readthedocs.io

charts/sda-mq/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: sda-mq
3-
version: 0.7.57
4-
appVersion: v0.3.114
3+
version: 0.7.58
4+
appVersion: v0.3.119
55
kubeVersion: '>= 1.26.0'
66
description: RabbitMQ component for Sensitive Data Archive (SDA) installation
77
home: https://neic-sda.readthedocs.io

charts/sda-svc/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: sda-svc
3-
version: 0.28.0
4-
appVersion: v0.3.114
3+
version: 0.28.1
4+
appVersion: v0.3.119
55
kubeVersion: '>= 1.26.0'
66
description: Components for Sensitive Data Archive (SDA) installation
77
home: https://neic-sda.readthedocs.io

sda-download/api/sda/sda_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"encoding/binary"
88
"errors"
99
"io"
10+
"math"
1011
"net/http"
1112
"net/http/httptest"
1213
"net/url"
@@ -677,7 +678,8 @@ func (f *fakeGRPC) ServeHTTP(w http.ResponseWriter, r *http.Request) {
677678
_, err = w.Write([]byte{0})
678679
assert.NoError(f.t, err, "Could not write response flag")
679680

680-
err = binary.Write(w, binary.BigEndian, int32(len(response)))
681+
assert.LessOrEqual(f.t, len(response), math.MaxInt32, "Response too long")
682+
err = binary.Write(w, binary.BigEndian, int32(len(response))) //nolint:gosec // we're checking the length above
681683
assert.NoError(f.t, err, "Could not write response length")
682684

683685
_, err = w.Write(response)

sda/cmd/reencrypt/reencrypt.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"crypto/x509"
88
"encoding/base64"
99
"fmt"
10+
"math"
1011
"net"
1112
"os"
1213
"os/signal"
@@ -55,10 +56,15 @@ func (s *server) ReencryptHeader(_ context.Context, in *re.ReencryptRequest) (*r
5556

5657
if len(dataEditList) > 0 { // linter doesn't like checking for nil before len
5758

58-
// Only do this if we're passed a data edit list
59+
// Check that G115: integer overflow conversion int -> uint32 is satisfied
60+
if len(dataEditList) > int(math.MaxUint32) {
61+
return nil, status.Error(400, "data edit list too long")
62+
}
63+
64+
// Only do this if we're passed a data edit whose length fits in a uint32
5965
dataEditListPacket := headers.DataEditListHeaderPacket{
6066
PacketType: headers.PacketType{PacketType: headers.DataEditList},
61-
NumberLengths: uint32(len(dataEditList)),
67+
NumberLengths: uint32(len(dataEditList)), //nolint:gosec // we're checking the length above
6268
Lengths: dataEditList,
6369
}
6470
extraHeaderPackets = append(extraHeaderPackets, dataEditListPacket)

0 commit comments

Comments
 (0)