Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to verify a CSR causes panic: runtime error: index out of range #177

Open
lpar opened this issue Jan 8, 2019 · 6 comments
Open
Assignees

Comments

@lpar
Copy link

lpar commented Jan 8, 2019

% certigo verify --name=REDACTED -f pem server2019.csr 
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/square/certigo/lib.VerifyChain(0xc62e38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffc75d487a2, 0x18, 0x0, 0x0, ...)
        /home/meta/go/src/github.com/square/certigo/lib/verify.go:129 +0x8e3
main.main()
        /home/meta/go/src/github.com/square/certigo/main.go:183 +0x1033
@csstaub
Copy link
Contributor

csstaub commented Jan 8, 2019

We don't support verify on cert requests (CSRs) at the moment, only on (issued) certificates. We should probably fix the output/error handling though. Out of curiosity, what kind of verification did you want to do on a CSR?

@lpar
Copy link
Author

lpar commented Jan 8, 2019

I just wanted to double check it was the right one, as I'm juggling TLS updates for a couple of machines right now. I understand it's not supported functionality, just thought you'd want to issue an error rather than crashing :-)

@egrieco
Copy link

egrieco commented Feb 18, 2020

I'm seeing the same panic with the connect command:

Command: certigo connect google.com

Result

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/square/certigo/lib.explainCipher(0xc0000cf750, 0xc, 0xc0000cf750, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/certigo-20200106-66700-nqvrn2/certigo-1.11.0/lib/tls.go:182 +0x1e3
github.com/square/certigo/lib.EncodeTLSInfoToText(0xc0001e4000, 0x0, 0x2, 0x0)
	/private/tmp/certigo-20200106-66700-nqvrn2/certigo-1.11.0/lib/tls.go:62 +0x148
main.main()
	/private/tmp/certigo-20200106-66700-nqvrn2/certigo-1.11.0/main.go:162 +0x667

@egrieco
Copy link

egrieco commented Feb 28, 2020

Is issue #213 related?
@siebenmann mentions commit f81df5c as a possible culprit.

@egrieco
Copy link

egrieco commented Feb 28, 2020

As suggested by @siebenmann, commenting out line 166 resolves the error for me.

cli/cli.go:166 fmt.Fprintf(stdout, "Input Format: %s\n", result.Formats[i])

@mbyczkowski
Copy link
Contributor

@egrieco yes, the issue is related and we will track it in #213. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants