583 Commits
Author SHA1 Message Date
Michael Puncel e55de0bdf3 add arm64 targets for darwin and linux (#367) v1.18.0 2026-04-10 10:43:54 -07:00
Michael Weissbacher e03ddd8f12 Merge pull request #363 from square/mw/bump-go-version
bumping go version
2026-01-23 19:51:23 -05:00
Michael Weissbacher e835bb681f Holding back zcrypto
https://github.com/zmap/zcrypto/issues/422#event-19045046290
2026-01-23 19:48:59 -05:00
Michael Weissbacher 733875bca8 bumping go version 2026-01-23 13:52:09 -05:00
Nik ce09cb96b0 Merge pull request #353 from square/nunger.set-version-string-to-1.17.1
Update version to 1.17.1
v1.17.1
2025-08-07 20:01:39 -04:00
Nik Unger a32944a5dc Update version to 1.17.1
This commit sets the CLI's version string to v1.17.1
2025-08-07 19:58:50 -04:00
Nik bed6218f5c Merge pull request #352 from square/nunger.disable-cgo-via-go-env
Fix Windows build
v1.17.0
2025-08-07 19:34:51 -04:00
Nik Unger c30a3d681f Downgrade zcrypto to restore Windows support
`github.com/zmap/zcrypto` currently does not compile on Windows:
see zmap/zcrypto#422. This commit downgrades the dependency to the
newest working version, from August 2024.
2025-08-07 19:28:32 -04:00
Nik Unger a1ad684e86 Add compilation check workflow to PRs
This commit adds a new workflow that builds `certigo` for all
target platforms on push, but does not create a new release. This
should help to identify any newly introduced compilation issues.
The configuration for the build is identical to the release
workflow.
2025-08-07 18:20:59 -04:00
Nik Unger dbcf06d690 Disable cgo via go env
This commit disables cgo for builds via `go env`, rather than via
an environment variable. This should be more compatible with
Windows builds.
2025-08-07 18:13:06 -04:00
Nik 52e4b355ff Merge pull request #351 from square/nunger.disable-cgo
Disable cgo for releases
2025-08-07 17:57:16 -04:00
Nik Unger 2b11aa1b78 Disable cgo for releases
This commit disables cgo when building GitHub releases, so the
resulting binaries are statically linked.

Resolves #321
2025-08-07 17:33:39 -04:00
Nik 3053a19816 Add JCEKS integration tests (#350)
This commit adds tests for the `jceks` package against the
installed JDK's `keytool` CLI. The tests ensure that JCEKS files
created by `keytool` can be read by the package, and vice versa.
These tests are disabled by default and are enabled with the
`-jceks.keytool-tests=true` flag. This commit configures GitHub
Actions to test the package against a wide variety of JDKs.

This commit also restricts GitHub Actions permissions.
2025-08-07 17:33:08 -04:00
Nik fe6d52ce3c Add encoding support to JCEKS package (#349)
This commit adds a JCEKS encoder to the `jceks` package.
Previously, the package was only capable of reading JCEKS files.

Internally, this commmit effectively rewrites the package.

These changes are backward compatible with the previous package API
and thus do not require a new major version. However, there are
several behavioral changes that have the potential to break
existing code that relied on edge cases:

- The package now returns an error when attempting to parse a JCEKS
  file that contains an invalid X.509 certificate (either as a
  trusted certificate entry, or as part of the chain for a private
  key entry). Previously, the package silently ignored these
  certificates. JCEKS files containing invalid certificates are
  invalid, so affected files should be repaired.
- The package now returns an error by default when parsing a JCEKS
  file containing a certificate or private key larger than 20MiB.
  This limit guards against trivial memory exhaustion denial of
  service attacks from malicious files, but the default is very
  generous. Callers that need to parse larger certificates or
  private keys can override the defaults using the new
  `KeyStore.ParseWithOptions` method with appropriate options.

The internal changes to the package introduced by this commit are
substantial. Some of the highlights include:
- Fixed a bug with modified UTF-8 parsing.
- `testdata` is now generated by `go generate`, rather than
  shelling out to `openssl` and `keytool` at unit test time.
- PKCS#5 padding is now removed when parsing.
- Tests are now far more comprehensive, including fuzz tests.
- General code cleanup and linter fixes.
2025-08-07 11:06:42 -04:00
Nik 201b116b7b Merge pull request #348 from square/nunger.copyright-headers
Add and enforce copyright headers via linter
2025-07-28 13:08:07 -04:00
Nik Unger 68183f4853 Add and enforce copyright headers via linter
This commit normalizes copyright headers across the codebase.
2025-07-28 13:05:13 -04:00
Nik 4b120a5094 Merge pull request #347 from square/nunger.pin-actions
Pin GitHub Actions
2025-07-28 13:04:11 -04:00
Nik Unger 6da5c67b6c Pin GitHub Actions
This commit pins GitHub Actions from third parties using `ratchet`.
This improves supply chain security.
2025-07-25 22:09:20 -04:00
Nik d45e9bf287 Merge pull request #346 from square/nunger.upgrade-go-and-dependencies
Upgrade dependencies
2025-07-25 21:56:11 -04:00
Nik Unger dbe10ff2f4 Update golangci-lint
This commit updates `golangci-lint` from 2.1.0 to 2.3.0, though it
does not adjust the linter configuration.
2025-07-25 17:24:58 -04:00
Nik Unger 7254eb963e Update zlint
This commit updates zlint to the latest version. The new version's
`e_key_usage_and_extended_key_usage_inconsistent` linter contains a
bug, so this commit disables it. The new version also correctly
identifies an error with some of the test certificates, so the
commit adds the error to the expected output (rather than
regenerating the certificates with modern policies).
2025-07-25 17:24:55 -04:00
Nik Unger 3a0d8c2c97 Support tls.Config in psql fork
This commit modifies the psql fork to accept a `*tls.Config` when
dumping TLS info. This allows us to pass the same broad
cipher suite configuration that we use for other connection types,
which preserves compatibility with older Go defaults. It also has
the side effect of hooking up the client certificate request info
callback, which means that Certigo now reports details about the
expected client certificate for Postgres connections.

In the future, we should eliminate our need for this fork by
switching to the `pgx` package and extracting the certificates via
new hooks in the `*tls.Config` struct, rather than patching this
outdated fork.
2025-07-25 17:24:52 -04:00
Nik Unger 89abb046f6 Delete vendored ldap package in favor of upstream
`github.com/go-ldap/ldap/v3` now supports the two features that we
previously added to a local fork: extracting the TLS connection
state, and defining a connection timeout. This commit deletes the
fork and uses the upstream dependency.

This commit also adjusts the `certigo connect` TLS configuration to
support every cipher suite supported by `crypto/tls`, including
insecure ones. This improves the ability to extract certificates
from servers with poor cipher suite support. This limitation was
uncovered while testing LDAP connectivity.
2025-07-25 17:24:49 -04:00
Nik Unger 2083fae45b Perform all trivial dependency updates
This commit updates every dependency that does not break behavior
or conflict with a pseudo-vendored package.
2025-07-25 17:24:46 -04:00
Nik Unger 7534e225a6 Update to Go 1.24, sprig v3
This commit upgrades the language version to Go 1.24.4 and upgrades
the Sprig templating dependency from v2 to v3 in order to resolve
an indirect dependency issue. The major upgrade of Sprig changes
the behavior of some functions, but not in a significant way.

Go 1.23 introduced a change that rejects X.509 certificates with
negative serial numbers, due to Go's focus on the Web PKI
(see golang/go#71606). We continue to support negative serials by
setting a go:debug option for the main certigo binary, but other
users of certigo packages will need to set their own GODEBUG
settings appropriately to support this feature. If Go eventually
drops support, then we will, too.
2025-07-25 17:24:42 -04:00
Nik 01e67d4c40 Merge pull request #345 from square/nunger.fix-current-linter-errors
Fix current linter findings
2025-07-25 11:03:40 -04:00
Nik Unger 10bbc8cdc1 Fix current linter findings
This commit adds an explicit `golangci-lint` configuration that
simply matches the default linters previously in use, and then
fixes all current linter findings.

Aside from tweaking error message strings, this commit introduces
one externally visible behavior change: PEM data generated from
PKCS#12 files now correctly identifies private key blocks as
`RSA PRIVATE KEY` or `EC PRIVATE KEY`, whereas previously it
generated invalid `PRIVATE KEY` blocks with non-PKCS#8 data.

This commit lays the groundwork for more aggressive linting in the
future, and identifies some additional issues via TODOs.
2025-07-24 12:59:48 -04:00
Nik d858043c83 Merge pull request #344 from square/nunger.update-go-toolchain
Update to latest stable Go toolchain
2025-07-23 16:33:04 -04:00
Nik Unger 1365cc1462 Update to latest stable Go toolchain
The latest version of the Go compiler is always the best compiler
for old versions of the language, so this commit upgrades from
1.19 to stable (currently 1.24).

Also added a small comment about the purpose of `./build`
2025-07-23 15:43:18 -04:00
Michael Weissbacher ba52fa4862 Merge pull request #316 from testwill/replace-loop
chore: slice replace loop
2025-06-23 17:45:46 -04:00
Michael Weissbacher 702bb339e6 Merge branch 'master' into replace-loop 2025-06-23 17:40:16 -04:00
Michael Weissbacher a669dc8044 Merge pull request #342 from square/mweissbacher/ct-bump
CT Log update
2025-06-23 17:33:21 -04:00
Michael Weissbacher d3cbd15890 CT Log update
go generate ./...
2025-06-23 17:02:16 -04:00
suzy-huang bf6413f1bf Merge pull request #339 from square/lsc/update_cryptid_codeowners
[LSC] Update cryptid reference to idinfra-staff
2025-06-23 09:34:42 -07:00
Michael Weissbacher 60b217c14e Merge branch 'master' into lsc/update_cryptid_codeowners 2025-06-23 11:35:21 -04:00
Michael Weissbacher 15e0185c26 Merge pull request #337 from square/dependabot/go_modules/github.com/fatih/color-1.18.0
Bump github.com/fatih/color from 1.13.0 to 1.18.0
2025-06-20 16:29:30 -04:00
dependabot[bot] 7c63cdce9b Bump github.com/fatih/color from 1.13.0 to 1.18.0
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.13.0 to 1.18.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.13.0...v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-20 20:19:34 +00:00
Michael Weissbacher b78d9884a9 Merge pull request #338 from square/dependabot/go_modules/software.sslmate.com/src/go-pkcs12-0.5.0
Bump software.sslmate.com/src/go-pkcs12 from 0.2.0 to 0.5.0
2025-06-20 16:18:13 -04:00
dependabot[bot] 04f14af9dd Bump software.sslmate.com/src/go-pkcs12 from 0.2.0 to 0.5.0
Bumps software.sslmate.com/src/go-pkcs12 from 0.2.0 to 0.5.0.

---
updated-dependencies:
- dependency-name: software.sslmate.com/src/go-pkcs12
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-20 19:04:53 +00:00
Michael Weissbacher fa08d8599c Merge pull request #336 from square/dependabot/go_modules/github.com/mattn/go-colorable-0.1.14
Bump github.com/mattn/go-colorable from 0.1.12 to 0.1.14
2025-06-20 15:03:32 -04:00
Michael Weissbacher 130599d8ee Merge branch 'master' into dependabot/go_modules/github.com/mattn/go-colorable-0.1.14 2025-06-20 15:01:59 -04:00
Michael Weissbacher 0ab117d87e Merge pull request #333 from square/dependabot/go_modules/github.com/stretchr/testify-1.10.0
Bump github.com/stretchr/testify from 1.8.2 to 1.10.0
2025-06-20 15:01:50 -04:00
Michael Weissbacher 5fbe7a4721 Merge branch 'master' into dependabot/go_modules/github.com/mattn/go-colorable-0.1.14 2025-06-20 15:00:26 -04:00
Michael Weissbacher 96c24e3182 Merge branch 'master' into dependabot/go_modules/github.com/stretchr/testify-1.10.0 2025-06-20 15:00:05 -04:00
Michael Weissbacher 6dde1da85b Merge pull request #341 from square/mweissbacher-bump-gh-actions-test
Bumping github action versions
2025-06-20 14:53:46 -04:00
Michael Weissbacher 03db869ef5 bumping linter version 2025-06-20 14:16:28 -04:00
Michael Weissbacher 0fcfc9a458 bump action versions for release 2025-06-20 14:12:51 -04:00
Michael Weissbacher ed8ffc1ea6 bump action versions for lint 2025-06-20 13:26:42 -04:00
Michael Weissbacher 77e5eb877f Bump action versions in test.yaml 2025-06-20 13:16:50 -04:00
Suzy Huang 8a47d1fca7 update cryptid references to idinfra 2025-06-17 17:39:59 -07:00