cloud-game/vendor/github.com/pion/dtls
giongto35 f49a347de2 Update vendor and makefile (#76)
* Update dependencies

* Update vendor

* Update vendor with C package

* Update Make file
2019-09-01 04:56:27 +08:00
..
internal Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
.editorconfig Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
.gitignore Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
.golangci.yml Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
.travis.yml Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
alert.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
application_data.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
change_cipher_spec.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
cipher_suite.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
cipher_suite_tls_ecdhe_ecdsa_with_aes_128_gcm_sha256.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
cipher_suite_tls_ecdhe_ecdsa_with_aes_256_cbc_sha.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
cipher_suite_tls_ecdhe_rsa_with_aes_128_gcm_sha256.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
cipher_suite_tls_ecdhe_rsa_with_aes_256_cbc_sha.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
cipher_suite_tls_psk_with_aes_128_ccm8.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
cipher_suite_tls_psk_with_aes_128_gcm_sha256.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
client_certificate_type.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
client_handlers.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
compression_method.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
config.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
conn.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
content.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
crypto.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
crypto_cbc.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
crypto_ccm.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
crypto_gcm.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
curve_type.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
errors.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
extension.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
extension_supported_elliptic_curves.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
extension_supported_point_formats.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
extension_supported_signature_algorithms.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
extension_use_srtp.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
fingerprint.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
flight.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
fragment_buffer.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
fuzz.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
go.mod Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
go.sum Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_cache.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_header.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_certificate.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
handshake_message_certificate_request.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_certificate_verify.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_client_hello.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_client_key_exchange.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
handshake_message_finished.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_hello_verify_request.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_server_hello.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
handshake_message_server_hello_done.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
handshake_message_server_key_exchange.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
handshake_random.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
hash_algorithm.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
LICENSE Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
listener.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
Makefile Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
named_curve.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
prf.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
README.md Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
record_layer.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
record_layer_header.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
resume.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
server_handlers.go Update vendor and makefile (#76) 2019-09-01 04:56:27 +08:00
signature_algorithm.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
signature_hash_algorithm.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
srtp_protection_profile.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
state.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00
util.go Introduce Makefile and go vendor directory for faster build (#67) 2019-08-17 00:13:36 +08:00


Pion DTLS

A Go implementation of DTLS

Pion DTLS Sourcegraph Widget Slack Widget
Build Status GoDoc Coverage Status Go Report Card Codacy Badge License: MIT


Go DTLS 1.2 implementation. The original user is pion-WebRTC, but we would love to see it work for everyone.

A long term goal is a professional security review, and maye inclusion in stdlib.

Goals/Progress

This will only be targeting DTLS 1.2, and the most modern/common cipher suites. We would love contributes that fall under the 'Planned Features' and fixing any bugs!

Current features

  • DTLS 1.2 Client/Server
  • Key Exchange via ECDHE(curve25519 and nistp256) and PSK
  • Packet loss and re-ordering is handled during handshaking
  • Key export (RFC 5705)
  • Serialization and Resumption of sessions

Supported ciphers

ECDHE
  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (RFC 5289)
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (RFC 5289)
  • TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (RFC 8422)
  • TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (RFC 8422)
PSK
  • TLS_PSK_WITH_AES_128_CCM_8 (RFC 6655)
  • TLS_PSK_WITH_AES_128_GCM_SHA256 (RFC 5487)

Planned Features

  • Extended master secret support (RFC7627)
  • Chacha20Poly1305

Excluded Features

  • DTLS 1.0
  • Renegotiation
  • Compression

Using

Pion DTLS

For a DTLS 1.2 Server that listens on 127.0.0.1:4444

go run examples/listen/main.go

For a DTLS 1.2 Client that connects to 127.0.0.1:4444

go run examples/dial/main.go

OpenSSL

Pion DTLS can connect to itself and OpenSSL.

  // Generate a certificate
  openssl ecparam -out key.pem -name prime256v1 -genkey
  openssl req -new -sha256 -key key.pem -out server.csr
  openssl x509 -req -sha256 -days 365 -in server.csr -signkey key.pem -out cert.pem

  // Use with examples/dial/main.go
  openssl s_server -dtls1_2 -cert cert.pem -key key.pem -accept 4444

  // Use with examples/listen/main.go
  openssl s_client -dtls1_2 -connect 127.0.0.1:4444 -debug -cert cert.pem -key key.pem

Using with PSK

Pion DTLS also comes with examples that do key exchange via PSK

Pion DTLS

go run examples/listen-psk/main.go
go run examples/dial-psk/main.go

OpenSSL

  // Use with examples/dial-psk/main.go
  openssl s_server -dtls1_2 -accept 4444 -nocert -psk abc123 -cipher PSK-AES128-CCM8

  // Use with examples/listen-psk/main.go
  openssl s_client -dtls1_2 -connect 127.0.0.1:4444 -psk abc123 -cipher PSK-AES128-CCM8

Contributing

Check out the contributing wiki to join the group of amazing people making this project possible:

License

MIT License - see LICENSE for full text