Skip to content

Commit 4f48ad5

Browse files
FiloSottilegopherbot
authored andcommitted
cmd/link/internal/loader: fix linknames from FIPS 140 frozen tree
blockedLinknames was updated in CL 635676 after the lib/fips140 zip mechanism was last tested. linknames from crypto/internal/fips140/v1.0.0 need to be allowed if they'd be allowed from crypto/internal/fips140. Change-Id: I6a6a4656022118d4739ae14831f2ad721951c192 Reviewed-on: https://go-review.googlesource.com/c/go/+/645195 Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
1 parent 1f58ad5 commit 4f48ad5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cmd/link/internal/loader/loader.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,6 +2394,16 @@ func (l *Loader) checkLinkname(pkg, name string, s Sym) {
23942394
if pkg == p {
23952395
return // pkg is allowed
23962396
}
2397+
// crypto/internal/fips140/vX.Y.Z/... is the frozen version of
2398+
// crypto/internal/fips140/... and is similarly allowed.
2399+
if strings.HasPrefix(pkg, "crypto/internal/fips140/v") {
2400+
parts := strings.Split(pkg, "/")
2401+
parts = append(parts[:3], parts[4:]...)
2402+
pkg := strings.Join(parts, "/")
2403+
if pkg == p {
2404+
return
2405+
}
2406+
}
23972407
}
23982408
error()
23992409
}

0 commit comments

Comments
 (0)