Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GOLANG_MAIN_VERSION = go1.24
GOLANGT_TAG = go1.24.4
GOLANG_VERSOIN = 1.24~2
GOLANG_VERSOIN = 1.24.4-1
GOLANG_VERSOIN_FIPS = $(GOLANG_VERSOIN)+fips
GOLANG = golang-$(GOLANG_MAIN_VERSION)_$(GOLANG_VERSOIN_FIPS)_all.deb
$(GOLANG)_SRC_PATH = $(SRC_PATH)/golang
Expand Down
12 changes: 11 additions & 1 deletion src/golang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ $(MAIN_TARGET):
scripts/full-initialize-repo.sh $(GOLANGT_TAG)
cp -r ../golang-debian/debian go/
cd go
sed -i "s/$(GOLANG_VERSOIN)/$(GOLANG_VERSOIN)+fips/" debian/changelog
VERSION=$$(dpkg-parsechangelog --show-field Version) && \
sed -i "s/$$VERSION/$${VERSION}+fips/" debian/changelog
cp ../../golang/patches/*.patch debian/patches/
comm -23 --nocheck-order ../../golang/patches/series debian/patches/series >> debian/patches/series
dpkg-buildpackage -b -d -rfakeroot -us -uc
# Verify sonic-fips patches were applied to the built package
VERIFY_DIR=$$(mktemp -d)
dpkg-deb -x ../golang-$(GOLANG_MAIN_VERSION)-go_*+fips*.deb $$VERIFY_DIR
grep -q "sonic_fips" $$VERIFY_DIR/usr/share/go-*/src/crypto/internal/backend/hostfips.go \
|| { echo "ERROR: sonic_fips patch not applied to Go package"; rm -rf $$VERIFY_DIR; exit 1; }
grep -q "symcryptprovider" $$VERIFY_DIR/usr/share/go-*/src/vendor/github.com/golang-fips/openssl/v2/openssl.go \
|| { echo "ERROR: symcryptprovider patch not applied to Go package"; rm -rf $$VERIFY_DIR; exit 1; }
echo "Go FIPS patch verification passed"
rm -rf $$VERIFY_DIR
cp ../*.deb $(DEST)

$(addprefix $(DEST)/, $(TARGETS)) : $(DEST)/%: $(MAIN_TARGET)
Expand Down
Loading