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

Panic on no supported client-requested "namedCurves" #82

Closed
RyanGordon opened this issue Aug 1, 2019 · 2 comments · Fixed by #83
Closed

Panic on no supported client-requested "namedCurves" #82

RyanGordon opened this issue Aug 1, 2019 · 2 comments · Fixed by #83
Labels
good first issue Good for newcomers triaged Has been reviewed

Comments

@RyanGordon
Copy link

RyanGordon commented Aug 1, 2019

Your environment.

  • Version: 1.5.0
  • Browser: Node.JS @nodertc/dtls library
  • Other Information:
panic: runtime error: index out of range

goroutine 266 [running]:
github.com/pion/dtls.serverHandshakeHandler.func1(0xc0000cc360, 0x52, 0x60, 0x1, 0xc0000c4050)
	/go/pkg/mod/github.com/pion/dtls@v1.5.0/server_handlers.go:38 +0x13cd
github.com/pion/dtls.serverHandshakeHandler(0xc0000ec500, 0x1c9eed8, 0xc0000ec500)
	/go/pkg/mod/github.com/pion/dtls@v1.5.0/server_handlers.go:163 +0x5af
github.com/pion/dtls.(*Conn).handleIncomingPacket(0xc0000ec500, 0xc000128000, 0x5f, 0x2000, 0x0, 0x0)
	/go/pkg/mod/github.com/pion/dtls@v1.5.0/conn.go:417 +0x4bc
github.com/pion/dtls.(*Conn).inboundLoop(0xc0000ec500)
	/go/pkg/mod/github.com/pion/dtls@v1.5.0/conn.go:360 +0x1bb
created by github.com/pion/dtls.createConn
	/go/pkg/mod/github.com/pion/dtls@v1.5.0/conn.go:170 +0x600

What did you do?

  1. Started a pion/dtls listen server.
  2. Using openssl 1.0.2s client:
    openssl s_client -dtls1_2 -connect 127.0.0.1:4444 -debug -cipher ECDHE-ECDSA-AES128-GCM-SHA256 -curves secp384r1

What did you expect?

Connection closes gracefully, rather than a panic

What happened?

The application panic'ed and crashed.

The offending line is here: 6dec1ec#diff-84f73d0d6a8b3cb71ba4ae9da4d57470R51

This assumes the client provides at least one supported Elliptic Curve, but in some cases the server may not support any of Elliptic Curve's that the client is requesting be used.

@Sean-Der
Copy link
Member

Sean-Der commented Aug 1, 2019

Nice find!

You interested in fixing @RyanGordon? That would be an awesome first issue! If there is anything I can do to help please tell me.

If you don't have the time/aren't allowed I can grab instead!

@Sean-Der Sean-Der added good first issue Good for newcomers triaged Has been reviewed labels Aug 1, 2019
@RyanGordon
Copy link
Author

Yes, I will gladly put up a PR tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers triaged Has been reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants