Certdump handles DER certificates as well now.
This commit is contained in:
parent
0b493e1060
commit
14bf511195
|
@ -184,10 +184,13 @@ func displayCert(cert *x509.Certificate) {
|
||||||
|
|
||||||
func displayAllCerts(in []byte, leafOnly bool) {
|
func displayAllCerts(in []byte, leafOnly bool) {
|
||||||
certs, err := helpers.ParseCertificatesPEM(in)
|
certs, err := helpers.ParseCertificatesPEM(in)
|
||||||
|
if err != nil {
|
||||||
|
certs, _, err = helpers.ParseCertificatesDER(in, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Warn(TranslateCFSSLError(err), "failed to parse certificates")
|
Warn(TranslateCFSSLError(err), "failed to parse certificates")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(certs) == 0 {
|
if len(certs) == 0 {
|
||||||
Warnx("no certificates found")
|
Warnx("no certificates found")
|
||||||
|
|
|
@ -4,6 +4,8 @@ package lib
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// ExitSuccess is the successful exit status.
|
// ExitSuccess is the successful exit status.
|
||||||
|
//
|
||||||
|
// It should be called on successful exit.
|
||||||
ExitSuccess = 0
|
ExitSuccess = 0
|
||||||
|
|
||||||
// ExitFailure is the failing exit status.
|
// ExitFailure is the failing exit status.
|
||||||
|
|
|
@ -11,6 +11,8 @@ var progname = filepath.Base(os.Args[0])
|
||||||
|
|
||||||
// ProgName returns what lib thinks the program name is, namely the
|
// ProgName returns what lib thinks the program name is, namely the
|
||||||
// basename of of argv0.
|
// basename of of argv0.
|
||||||
|
//
|
||||||
|
// It is similar to the Linux __progname.
|
||||||
func ProgName() string {
|
func ProgName() string {
|
||||||
return progname
|
return progname
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue