$ the-wire · showcase
ssh CheckCert now enforces source-address, semaphore rejects negative capacity
By RepoJournal · Filed · About Go
Go's crypto and sync libraries shipped fixes that close a host-key verification gap and reject misconfigured semaphores.
golang/crypto's ssh package now enforces the source-address critical option in CheckCert [1], closing a gap where CA-signed host certificates with source-address were accepted regardless of the server's address in the host key path or direct CheckCert calls. This is a breaking change for applications relying on the old permissive behavior. golang/sync's semaphore now panics on negative capacity in NewWeighted [2], preventing semaphores where even a zero-weight acquisition cannot succeed. In golang/tools, go/ssa propagates receiver instantiation to nested functions [3], fixing nil package instances in nested closures of generic methods and preventing SSA sanity check failures. golang/go's math/big fixes DivMod when the modulus aliases the divisor [4], returning (-2, 1) instead of (0, 0) for DivMod(-5, 3); code aliasing outputs should be reviewed. The bufio fast path for WriteString [5] handles strings that fit in the buffer first, making it comparable to Write for common cases. The os package examples now use errors.Is instead of deprecated helpers [6], and cmd/compile's simd ops generation now merges from separate files [7].
Action items
- → Review applications calling CheckCert or CheckHostKey for reliance on unenforced source-address options golang/crypto [immediate]
- → Check code that constructs semaphore.NewWeighted with negative capacity; it now panics golang/sync [immediate]
- → Test math/big DivMod calls where the modulus aliases the divisor; results may change golang/go [plan]
References
- [1] ssh: don't skip the source-address critical option in CheckCert ↗ golang/crypto
- [2] semaphore: panic on negative capacity ↗ golang/sync
- [3] go/ssa: propagate receiver instantiation to nested functions ↗ golang/tools
- [4] math/big: fix DivMod when the modulus aliases the divisor ↗ golang/go
- [5] bufio: add fast path to WriteString for strings that fit in the buffer ↗ golang/go
- [6] os: update examples to use errors.Is instead of deprecated helpers ↗ golang/go
- [7] cmd/compile: change how ssa/_gen processes generic simd ops ↗ golang/go