64 Commits
Author SHA1 Message Date
John WoodandGitHub abfe56fea8 Fetch latest CT log info (#297) 2022-11-17 13:10:15 -08:00
Cedric StaubandGitHub 75f2ec06b4 Switch to using SSLMate's PKCS#12 library (#293) 2022-09-21 10:36:59 -07:00
John WoodandGitHub 44210f297c Remove ioutil (#289) 2022-08-11 10:59:59 -07:00
eea7ad61c3 Add zlint support (#286)
Co-authored-by: John Wood <jwood@squareup.com>
Co-authored-by: Sven Wick <sven.wick@gmx.de>
2022-08-01 12:01:38 -06:00
John WoodandGitHub 79f1ecf29f Unconditionally add forward slash in OCSP GET requests (#282) 2022-07-01 13:41:01 -07:00
John WoodandGitHub 0a56dcc30e Use Go generate instead of a makefile (#279)
* Use Go generate instead of a makefile

* Meet the go generate specifications
2022-06-30 11:09:52 -07:00
John WoodandGitHub 37a41318ba Add support for printing SCTs (#277)
* Address PR comments
2022-06-29 17:35:59 -07:00
John WoodandGitHub 4c8f1c5862 Fix OCSP checking (#274)
Fixes #272. The root of the problem is that we're asking the wrong OCSP servers. The current code does something like:

leaf, issuers := chain[0], chain[1:]
for _, issuer := range issuers {
  // check for revocation of leaf via issuer.OCSPServer
}

The main problem is that OCSPServer is the URI of the OCSP server for that certificate, and by asking issuer.OCSPServer about leaf, we're requesting OCSP responses from the wrong server. We should be checking leaf.OCSPServer in this example instead of issuer.OCSPServer.

The second problem is that the loop makes no sense. One would not expect any OCSP server in a given chain to be authoritative for a given leaf.

If you do certigo connect google.com, you'll see

Certificate has OCSP extension, but was unable to check status:
	ocsp: error from server: unauthorized

The "unauthorized" means the OCSP server we asked doesn't know anything about the cert we asked about.
2022-06-28 14:51:03 -07:00
John WoodandGitHub 8f0d49f5b3 Don't check OCSP if there are no OCSP servers in the chain (#255) 2022-02-09 10:07:55 -08:00
klyubinandGitHub ba10cd1db7 Add support for verifying server certs against SPIFFE IDs (#252)
Add support for verifying server certs against SPIFFE IDs

This adds support to "certigo connect" to verify that the
server presented a certificate for a specific hostname or
SPIFFE ID. This name can now be unrelated to the hostname
to connect to and the Server Name Indication (SNI) to send
to the server during the TLS handshake.

Prior to this commit, the name expected in the certificate
could only be a hostname, specified either via --name (SNI)
or the hostname to connect to. SPIFFE IDs -- URLs with
"spiffe" as the scheme -- are not useful as hostnames or
SNIs. As a result, this commit adds a new --expected-name
switch to certigo connect. This override provides full
control over what name to expect in the server certificate
presented during the TLS handshake. For example, this name
can now be different from the hostname connected to and the
name specified in Server Name Indication (SNI). Moreover,
if --expected-name is a URL with "spiffe" scheme, it is
only matched against Subject Alternative Names of type URI,
as per the SPIFFE spec.
2022-01-10 15:57:47 -08:00
John WoodandGitHub 4032ab142c Add the Ed25519 algo to the list of known algo names (#250) 2021-11-30 15:19:09 -08:00
Jason RiddleandGitHub 5cba65cd46 Add additional TLS 1.3 cipher suites (#208)
The new TLS 1.3 cipher suites do not specify the key exchange algorithm
and as a result "_WITH_" is no longer present.
2020-02-26 10:29:40 -08:00
Roy XuandGitHub f81df5c5a3 print input format guessed by certigo (#210) 2020-02-25 11:17:01 -08:00
23ed60d1d5 better error handling for csrs (#211)
Error when no valid certs are found when verifying instead of accessing oob.
Warn when CSRs are found instead of silently ignoring them.

Co-authored-by: Mat Byczkowski <mbyczkowski@gmail.com>
2020-02-25 10:58:06 -08:00
Matthew McPherrin 26cd65d9bd refactor certigo package main
This splits the logic into a cli, which handles parsing command line args and
reading files, and a terminal abstraction for handling user input and ouput.

All uses of os.Exit are removed in favor of returning errors.

Overall this enables better testing and reuse of code.  Previously we had to
rely on external unit testing for CLI tests, which are harder to write tests.
2020-01-13 15:58:53 -08:00
Cedric Staub 79de7d2a35 Fix panic in explainCipher for TLS 1.3 ciphers 2019-06-07 12:47:52 -07:00
Matthew McPherrin b6e169d63a Add DomainComponent from RFC 2247
I found TP-LINK routers submit some kind of logging to
n-devs.tplinkcloud.com:50443 and the CA that signed the certificate
for that domain had DCs in its subject

With this change we now get:
Issuer:
	DC=cn, DC=com, DC=tp-link, CN=TP-LINK CA P1
2019-03-27 22:51:22 -07:00
Cedric Staub d9c0b44abc Use Go 1.11, use built-in functions for URI names 2018-10-23 14:36:44 -07:00
Cedric Staub 4dba9b2f4e Improve reliability of OCSP checks 2018-04-06 13:06:05 -07:00
Cedric Staub 594b04e874 Print revocation reason & staple status 2018-04-05 16:01:17 -07:00
Matthew McPherrin f07f7d351c Support any format certigo does for CAs.
Todo: Right now it doesn't support any truststore password other than changeit.
That's what Java ships.  A follow-up commit will add better password handling
2018-04-04 21:21:46 -07:00
Matthew McPherrin c58011aee0 Move ocsp.go and verify.go into lib
This reduces a bunch of copy-paste code.
2018-04-04 21:21:46 -07:00
Cedric Staub 57f83216c3 Update vendored dependencies 2018-04-03 22:21:23 -07:00
Cedric Staub 796d17c565 Better error message for library users 2018-03-22 13:30:07 -07:00
Cedric Staub d920cab6f0 Print only CN for verify results 2018-02-27 17:24:48 -08:00
Cedric Staub 63a3260918 Better short names for printing 2018-02-27 17:09:50 -08:00
Cedric Staub 7c6b521735 Support new name constraint fields in crypto/x509 2018-02-27 16:50:42 -08:00
Cedric Staub 6a549158f0 Better language for outdated signature algorithm warning 2017-11-08 11:20:57 -08:00
Cedric Staub b0d0880545 Fix template bug from moving name constraints 2017-11-08 11:20:42 -08:00
Cedric Staub 1929b65f41 Show OCSP servers and issuing certificate URL info in verbose mode 2017-09-22 12:56:36 -07:00
Cedric Staub 2f2e914e35 Fix DNS name constraints handling 2017-08-18 12:52:26 -07:00
Cedric Staub 772a9edd2b Display SPIFFE URI names if present in certificate 2017-08-07 16:43:48 -07:00
Cedric Staub 55f84d5812 Display SPIFFE URI names if present in certificate 2017-08-07 15:59:33 -07:00
Cedric Staub 1ba652071c Add GOST algorithms in signature scheme map 2017-06-16 17:31:41 -07:00
Cedric Staub 83191051cb Better strings for TLS signature schemes 2017-06-16 17:17:07 -07:00
Cedric Staub 897051b6a5 Add warning for certs w/o subject alt names 2017-06-01 17:36:59 -07:00
Cedric Staub 589481e437 Add user id OID in lib/oids 2017-05-11 10:24:35 -07:00
Cedric Staub fe74b984aa Better error handling in certigo dump command 2017-05-09 14:41:34 -07:00
Cedric Staub 5a9a11db35 Add support for showing requested client certificate info 2017-04-08 14:55:37 -07:00
Cedric Staub 5a26bbac2a Compress output of alternative names and emails 2017-03-10 17:00:01 -08:00
Cedric Staub 9d4a46981e Only print Common Name in non-verbose output 2017-03-10 16:34:28 -08:00
Matthew McPherrin 2b1e3d0dfd Remove whitespace before colon 2017-02-26 20:29:39 -08:00
Matthew McPherrin d1f35820e3 Use one-line dates in --verbose too 2017-02-26 18:17:09 -08:00
Matthew McPherrin 5f2a57c233 Use three-letter timezone instead of fixed 'Z' 2017-02-26 18:13:11 -08:00
Matthew McPherrin 67a61e6466 Format expiry dates as 2006-01-02 15:04Z 2017-02-26 16:03:54 -08:00
Matthew McPherrin 1c1db68419 Collapse validity period to one line 2017-02-25 18:14:57 -08:00
Matthew McPherrin c71c2e9df8 Move pkix.Name formatting to a real function to fix bugs 2017-02-25 17:56:01 -08:00
Matthew McPherrin f5f617c58f Make text certs shorter, existing text output now has a --verbose flag 2017-02-25 16:33:09 -08:00
Cedric StaubandGitHub 27336504a8 Merge branch 'master' into mmc/human-tls 2017-02-25 15:35:32 -08:00
Matthew McPherrin ea85f13959 Incorporate review feedback 2017-02-25 15:29:52 -08:00