Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pion/dtls
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.7
Choose a base ref
...
head repository: pion/dtls
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 13, 2023

  1. Update module golang.org/x/crypto to v0.10.0

    Generated by renovateBot
    renovate[bot] committed Jun 13, 2023
    Copy the full SHA
    4b76abf View commit details
  2. Update module golang.org/x/net to v0.11.0

    Generated by renovateBot
    renovate[bot] committed Jun 13, 2023
    Copy the full SHA
    4fc3d8f View commit details

Commits on Jun 28, 2023

  1. Remove extraneous error checks in handshaker

    Removes extraneous checks for flight error after alert error occurs. If
    we are sending alert then we already know that a flight error occurred.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jun 28, 2023
    Copy the full SHA
    8a11cf2 View commit details

Commits on Jun 30, 2023

  1. Update e2e Go image to 1.20

    Updates the e2e Go base image to 1.20.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jun 30, 2023
    Copy the full SHA
    159122f View commit details
  2. Wait for OpenSSL server shutdown in e2e test

    Updates e2e tests to wait until server shutdown before completing to
    ensure that we do not trigger errors due to leaked watchCtx goroutine,
    which was added to os/exec.Command in Go 1.20. We do so by moving from
    implicit shutdown via context cancellation to explicit shutdown.
    
    https://tip.golang.org/doc/go1.20
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jun 30, 2023
    Copy the full SHA
    d7303d0 View commit details

Commits on Jul 6, 2023

  1. Enable Elliptic Curve Supported Point Formats

    Enables parsing the elliptic curve supported points format extension.
    
    https://www.rfc-editor.org/rfc/rfc8422.html#section-5.1.2
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 6, 2023
    Copy the full SHA
    265bf11 View commit details
  2. Enable Supported Signature Algorithms

    Enables parsing the supported signature algorithms extension.
    
    https://datatracker.ietf.org/doc/html/rfc5246#autoid-39
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 6, 2023
    Copy the full SHA
    cabe5b8 View commit details
  3. Add Daniel Mangum to AUTHORS.txt

    Adds Daniel Mangum to AUTHORS.txt.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 6, 2023
    Copy the full SHA
    93704b3 View commit details
  4. Fix parsing supported EC point formats

    Fixes error in parsing supported elliptic curve point formats extension.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 6, 2023
    Copy the full SHA
    0736d45 View commit details
  5. Add unmarshal unit tests for extensions

    Adds missing unmarshal unit tests for extensions that did not have them.
    These ensure that marshal / unmarshal is round-trippable.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 6, 2023
    Copy the full SHA
    b905606 View commit details

Commits on Jul 11, 2023

  1. Fix return of nil alertErrors

    Fixes two cases where nil alert errors were being returned rather than
    the underlying error. Calling methods on these nil alert errors can lead
    to panics.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 11, 2023
    Copy the full SHA
    7307f62 View commit details
  2. Clean up unneccessary nested logic

    Cleans up a few unneccessary else blocks and nested if statements.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Jul 11, 2023
    Copy the full SHA
    b033847 View commit details

Commits on Aug 1, 2023

  1. Update module golang.org/x/net to v0.12.0

    Generated by renovateBot
    renovate[bot] committed Aug 1, 2023
    Copy the full SHA
    c9eb5f2 View commit details

Commits on Aug 2, 2023

  1. Update module golang.org/x/net to v0.13.0

    Generated by renovateBot
    renovate[bot] committed Aug 2, 2023
    Copy the full SHA
    eb34e7d View commit details

Commits on Aug 5, 2023

  1. Update CI configs to v0.10.11

    Update lint scripts and CI configs.
    pionbot authored and Sean-Der committed Aug 5, 2023
    Copy the full SHA
    a6eca6c View commit details

Commits on Aug 9, 2023

  1. Update module golang.org/x/crypto to v0.12.0

    Generated by renovateBot
    renovate[bot] committed Aug 9, 2023
    Copy the full SHA
    a1d270f View commit details
  2. Update pion/transport to latest

    Updates pion/transport to v2.2.2-0.20230802201558-f2dffd80896b to
    consume the new netctx packages and the replaydetector updates.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    e9b3ce0 View commit details
  3. Add DTLS connection ID extension

    Adds the DTLS 1.2 connection ID extension to supported handshake
    extensions. Connection ID uses 54 as its identifier and includes a
    potentially empty connection ID.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    9e4a4e7 View commit details
  4. Add support for parsing CID records

    Adds support for parsing CID records, which wrap an internal in inner
    plaintext. Consumers of ContentAwareUnpackDatagram must specify the CID
    length. The HeaderSize of 13 is now referred to as FixedHeaderSize to
    indicate that CID records will have variable sized headers.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    2005135 View commit details
  5. Add support for CID related generators

    ConnectionIDGenerator generates connection identifiers that should be
    sent by the remote party if it supports the DTLS Connection Identifier
    extension, as determined during the handshake. Generated connection
    identifiers must always have the same length. Returning a zero-length
    connection identifier indicates that the local party supports sending
    connection identifiers but does not require the remote party to send
    them. A nil ConnectionIDGenerator indicates that connection identifiers
    are not supported.
    
    https://datatracker.ietf.org/doc/html/rfc9146
    
    PaddingLengthGenerator generates the number of padding bytes used to
    inflate ciphertext size in order to obscure content size from observers.
    The length of the content is passed to the generator such that both
    deterministic and random padding schemes can be applied while not
    exceeding maximum record size.
    If no PaddingLengthGenerator is specified, padding will not be applied.
    
    https://datatracker.ietf.org/doc/html/rfc9146#section-4
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    b7b1e44 View commit details
  6. Allow packets to specify CID wrapped

    Updates the packet structure to allow for specifying the a given packet
    should be stuffed in the inner plaintext of a CID record.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    6af61b1 View commit details
  7. Add CID content type

    Adds the connection ID content type, which used 25 as identifier.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    1ce6f27 View commit details
  8. Implement AddUint48 utility

    Adds the AddUint48 utility used to handle sequence numbers in DTLS
    records. This should be removed when
    golang/crypto#265 is implemented.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    9a37bfd View commit details
  9. Add local and remote CID to state

    Adds local and remote CID to state, but does not serialize them. CIDs
    should be renogotiated on session resumption.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    27fd131 View commit details
  10. Implement AEAD additional data with CID

    Implements AEAD additional data generation when using connection IDs as
    described in
    https://datatracker.ietf.org/doc/html/rfc9146#name-aead-ciphers.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    8ba47cb View commit details
  11. Update ciphersuites to support CIDs

    Updates ciphersuites to add support for handling connection ID records.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    8922879 View commit details
  12. Update handshaker to handle CID extension

    Updates handshaker to handle negotiating CIDs. Local connection ID is
    only set if the local party generates one and the remote indicates
    support. Remote connection id is only set if remote generates one and
    connection IDs are supported locally
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    e5420de View commit details
  13. Add Conn to PacketConn utility

    Adds a utility used to translate net.Conn's to net.PacketConn's for use
    in DTLS package. This utility may be promoted to a public package in the
    future if consumers require using net.Conn, particularly if they are
    using connected UDP sockets.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    d082911 View commit details
  14. Update DTLS Conn to use PacketConn and CID

    Updates DTLS Conn to take a net.PacketConn and support connection IDs.
    Moving to net.PacketConn allows for updating the remote address when
    utilizing connection IDs, alleviating the need to re-handshake every
    time an IP address or port changes.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    afb61f1 View commit details
  15. Wrap net.Conn in DTLS listener

    Wraps the net.Conn returned from the UDP listener in the DTLS listener.
    The underlying UDP listener will be adapted in the future to support
    returning net.PacketConn.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    f960a37 View commit details
  16. Update tests to wrap net.Conn

    Updates tests that use net.Conn to wrap in net.PacketConn so that new
    Client / Server constructors may be used.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    ee04141 View commit details
  17. Add e2e CID tests

    Adds e2e tests for connection ID support. OpenSSL does not currently
    support connection IDs, so tests are only run between pion/dtls client
    and server. Support for other libraries, such as californium and mbedTLS
    will be added in the future.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    2f2bc8d View commit details
  18. Add basic connection ID generators

    Adds simple connection ID generators that can be used to generate
    random connection IDs of a given length, or indicate support for
    connection IDs without requiring the remote to send one.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 9, 2023
    Copy the full SHA
    d29c6f0 View commit details

Commits on Aug 10, 2023

  1. Set timeout to 10 minutes on e2e workflow

    Sets the timeout to 10 minutes on the e2e workflow. Previously, if the
    workflow did not terminate, it would run for the default of 360 minutes.
    
    See https://docs.github.com/en/actions/using-workflows for more
    information.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan authored and edaniels committed Aug 10, 2023
    Copy the full SHA
    818feb8 View commit details

Commits on Aug 14, 2023

  1. Fix name of cipher suite initialization function

    Fixes misspelling in name of cipher suite initialization function.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 14, 2023
    Copy the full SHA
    83b1254 View commit details

Commits on Aug 22, 2023

  1. Convert nil CIDs to empty byte slice

    Adds a check on the generated CID in flight 1 to convert to an empty
    byte slice if the CID is nil. This allows us to distinguish not
    supporting CIDs to only suppporting sending CIDs in the second
    ClientHello in flight 3.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 22, 2023
    Copy the full SHA
    3082313 View commit details

Commits on Aug 23, 2023

  1. Wrap Alerts when CID is negotiated

    Updates to conditionally wrap Alert messages when a non-zero length
    connection ID has been negotiated. From the DTLS 1.2 Connection ID RFC:
    
    If DTLS peers have negotiated the use of a non-zero-length CID for a
    given direction, then once encryption is enabled, they MUST send with
    the record format defined in Figure 3 (see Section 4) with the new
    Message Authentication Code (MAC) computation defined in Section 5 and
    the content type tls12_cid. Plaintext payloads never use the new record
    format or the CID content type.
    
    https://datatracker.ietf.org/doc/html/rfc9146#section-3
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 23, 2023
    Copy the full SHA
    f1d8b0a View commit details

Commits on Aug 27, 2023

  1. Introduce net package

    Introduces a new net package, which defines networking interfaces used
    throughout the pion/dtls code base, as well as utilities to help
    consumers convert standard library net types into pion/dtls compatible
    ones.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    4f53ce1 View commit details
  2. Consume net package in tests

    Updates unit and e2e tests to consume new utilities from the dtls net
    package.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    703da0c View commit details
  3. Introduce net PacketBuffer

    Introduce a network PacketBuffer which maintains a ring buffer of
    network packets constituted of the packet payload and the remote address
    from which it was received. This package borrows heavily from the bytes
    based ring buffer in pion/transport/packetio.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    eb305b1 View commit details
  4. Add PacketBuffer unit tests

    Adds PacketBuffer unit tests.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    3afeb7d View commit details
  5. Introduce UDP net.PacketListener

    Introduces a UDP based net.PacketListener that allows for routing UDP
    datagrams based on remote address _or_ an alternate identifier. It is
    configured by the DatagramRouter and ConnectionIdentifier functions,
    which are provided by the caller. The former introspects outgoing
    datagrams for potential connection identifiers, while the latter routes
    incoming datagrams by introspecting their contents. This package borrows
    heavily from pion/transport/udp.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    71db42b View commit details
  6. Add UDP net.PacketListener unit tests

    Adds unit tests for UDP net.PacketListener.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    a8998af View commit details
  7. Add CID based datagram routing

    Adds functions to route datagrams and identify connections by DTLS 1.2
    Connection IDs.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    9db84b5 View commit details
  8. Add CID routing unit tests

    Adds unit tests for CID routing functions.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    e663309 View commit details
  9. Set UDP routing if CID is enabled

    Sets UDP routing functions in the default DTLS listener if a connection
    ID generator is provided. Also updates to accept a dtls
    net.PacketListener when a caller wishes to provide their own.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    f5875c1 View commit details
  10. Add CID listener example

    Adds an example for setting up a CID-enabled DTLS listener.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    6df50a6 View commit details
  11. Add CID send only client example

    Adds an example for a client that only sends connection IDs (i.e. does
    not request to received them). This is the most common scenario for DTLS
    clients.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 27, 2023
    Copy the full SHA
    37fbc04 View commit details

Commits on Aug 28, 2023

  1. Serialize CIDs in state

    Updates state serialization and deserialization to include connection
    IDs if they were negotiated.
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 28, 2023
    Copy the full SHA
    e142ee1 View commit details
  2. Clear CIDs on potential session resumption

    Updates the flight0handler to clear connection IDs in the event the
    client is attempting to resume an existing session. If connection IDs
    are to be used in the resumed session, they should be negotiated afresh.
    
    https://datatracker.ietf.org/doc/html/rfc9146#section-3
    
    Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
    hasheddan committed Aug 28, 2023
    Copy the full SHA
    609e5be View commit details
Showing with 8,750 additions and 2,319 deletions.
  1. +3 −6 .github/workflows/{generate-authors.yml → api.yaml}
  2. +2 −1 .github/workflows/e2e.yaml
  3. +1 −1 .github/workflows/release.yml
  4. +5 −3 .github/workflows/test.yaml
  5. +1 −1 .github/workflows/tidy-check.yaml
  6. +38 −37 .golangci.yml
  7. +2 −2 .reuse/dep5
  8. +0 −57 AUTHORS.txt
  9. +3 −3 README.md
  10. +18 −11 bench_test.go
  11. +12 −2 certificate.go
  12. +2 −2 certificate_test.go
  13. +62 −33 cipher_suite.go
  14. +4 −2 cipher_suite_go114.go
  15. +11 −11 cipher_suite_go114_test.go
  16. +13 −12 cipher_suite_test.go
  17. +1 −1 compression_method.go
  18. +75 −31 config.go
  19. +11 −7 config_test.go
  20. +580 −282 conn.go
  21. +33 −47 conn_go_test.go
  22. +1,163 −237 conn_test.go
  23. +105 −0 connection_id.go
  24. +290 −0 connection_id_test.go
  25. +71 −45 crypto.go
  26. +30 −16 crypto_test.go
  27. +1 −1 e2e/Dockerfile
  28. +60 −24 e2e/e2e_lossy_test.go
  29. +7 −3 e2e/e2e_openssl_test.go
  30. +308 −31 e2e/e2e_test.go
  31. +121 −51 errors.go
  32. +19 −5 errors_errno_test.go
  33. +11 −11 errors_test.go
  34. +57 −0 examples/dial/cid/main.go
  35. +11 −4 examples/dial/psk/main.go
  36. +10 −4 examples/dial/selfsign/main.go
  37. +9 −3 examples/dial/verify/main.go
  38. +78 −0 examples/listen/cid/main.go
  39. +12 −11 examples/listen/psk/main.go
  40. +11 −11 examples/listen/selfsign/main.go
  41. +134 −0 examples/listen/verify-brute-force-protection/main.go
  42. +10 −10 examples/listen/verify/main.go
  43. +5 −4 examples/util/hub.go
  44. +5 −6 examples/util/util.go
  45. +1 −1 flight.go
  46. +52 −15 flight0handler.go
  47. +64 −22 flight1handler.go
  48. +285 −0 flight1handler_test.go
  49. +19 −6 flight2handler.go
  50. +114 −48 flight3handler.go
  51. +115 −0 flight3handler_test.go
  52. +40 −21 flight4bhandler.go
  53. +133 −46 flight4handler.go
  54. +76 −6 flight4handler_test.go
  55. +18 −7 flight5bhandler.go
  56. +80 −31 flight5handler.go
  57. +20 −7 flight6handler.go
  58. +12 −6 flighthandler.go
  59. +21 −13 fragment_buffer.go
  60. +46 −13 fragment_buffer_test.go
  61. +27 −0 fuzz_test.go
  62. +8 −6 go.mod
  63. +8 −58 go.sum
  64. +26 −13 handshake_cache.go
  65. +18 −6 handshake_cache_test.go
  66. +7 −4 handshake_test.go
  67. +109 −97 handshaker.go
  68. +80 −36 handshaker_test.go
  69. +13 −5 internal/ciphersuite/aes_128_ccm.go
  70. +13 −5 internal/ciphersuite/aes_256_ccm.go
  71. +27 −20 internal/ciphersuite/aes_ccm.go
  72. +15 −13 internal/ciphersuite/ciphersuite.go
  73. +11 −4 internal/ciphersuite/tls_ecdhe_ecdsa_with_aes_128_ccm.go
  74. +11 −4 internal/ciphersuite/tls_ecdhe_ecdsa_with_aes_128_ccm8.go
  75. +27 −19 internal/ciphersuite/tls_ecdhe_ecdsa_with_aes_128_gcm_sha256.go
  76. +20 −18 internal/ciphersuite/tls_ecdhe_ecdsa_with_aes_256_cbc_sha.go
  77. +4 −4 internal/ciphersuite/tls_ecdhe_ecdsa_with_aes_256_gcm_sha384.go
  78. +20 −18 internal/ciphersuite/tls_ecdhe_psk_with_aes_128_cbc_sha256.go
  79. +4 −4 internal/ciphersuite/tls_ecdhe_rsa_with_aes_128_gcm_sha256.go
  80. +4 −4 internal/ciphersuite/tls_ecdhe_rsa_with_aes_256_cbc_sha.go
  81. +4 −4 internal/ciphersuite/tls_ecdhe_rsa_with_aes_256_gcm_sha384.go
  82. +20 −18 internal/ciphersuite/tls_psk_with_aes_128_cbc_sha256.go
  83. +11 −4 internal/ciphersuite/tls_psk_with_aes_128_ccm.go
  84. +11 −4 internal/ciphersuite/tls_psk_with_aes_128_ccm8.go
  85. +6 −6 internal/ciphersuite/tls_psk_with_aes_128_gcm_sha256.go
  86. +11 −4 internal/ciphersuite/tls_psk_with_aes_256_ccm8.go
  87. +2 −2 internal/ciphersuite/types/authentication_type.go
  88. +1 −1 internal/ciphersuite/types/key_exchange_algorithm.go
  89. +9 −7 internal/closer/closer.go
  90. +242 −0 internal/net/buffer.go
  91. +423 −0 internal/net/buffer_test.go
  92. +413 −0 internal/net/udp/packet_conn.go
  93. +742 −0 internal/net/udp/packet_conn_test.go
  94. +15 −4 internal/util/util.go
  95. +66 −0 internal/util/util_test.go
  96. +19 −11 listener.go
  97. +2 −1 nettest_test.go
  98. +4 −1 packet.go
  99. +20 −13 pkg/crypto/ccm/ccm.go
  100. +98 −50 pkg/crypto/ccm/ccm_test.go
  101. +106 −33 pkg/crypto/ciphersuite/cbc.go
  102. +36 −24 pkg/crypto/ciphersuite/ccm.go
  103. +44 −11 pkg/crypto/ciphersuite/ciphersuite.go
  104. +61 −0 pkg/crypto/ciphersuite/ciphersuite_test.go
  105. +30 −19 pkg/crypto/ciphersuite/gcm.go
  106. +2 −2 pkg/crypto/clientcertificate/client_certificate.go
  107. +9 −7 pkg/crypto/elliptic/elliptic.go
  108. +1 −1 pkg/crypto/fingerprint/fingerprint.go
  109. +24 −17 pkg/crypto/fingerprint/fingerprint_test.go
  110. +3 −1 pkg/crypto/fingerprint/hash.go
  111. +2 −1 pkg/crypto/fingerprint/hash_test.go
  112. +12 −5 pkg/crypto/hash/hash.go
  113. +5 −2 pkg/crypto/hash/hash_test.go
  114. +26 −16 pkg/crypto/prf/prf.go
  115. +169 −25 pkg/crypto/prf/prf_test.go
  116. +19 −14 pkg/crypto/selfsign/selfsign.go
  117. +2 −2 pkg/crypto/signature/signature.go
  118. +1 −0 pkg/crypto/signaturehash/errors.go
  119. +14 −9 pkg/crypto/signaturehash/signaturehash.go
  120. +2 −2 pkg/crypto/signaturehash/signaturehash_test.go
  121. +111 −0 pkg/net/net.go
  122. +10 −9 pkg/protocol/alert/alert.go
  123. +4 −3 pkg/protocol/application_data.go
  124. +3 −3 pkg/protocol/change_cipher_spec.go
  125. +7 −5 pkg/protocol/compression_method.go
  126. +3 −2 pkg/protocol/content.go
  127. +14 −11 pkg/protocol/errors.go
  128. +11 −8 pkg/protocol/extension/alpn.go
  129. +6 −6 pkg/protocol/extension/alpn_test.go
  130. +61 −0 pkg/protocol/extension/connection_id.go
  131. +30 −0 pkg/protocol/extension/connection_id_test.go
  132. +26 −8 pkg/protocol/extension/errors.go
  133. +16 −6 pkg/protocol/extension/extension.go
  134. +19 −0 pkg/protocol/extension/fuzz_test.go
  135. +4 −3 pkg/protocol/extension/renegotiation_info.go
  136. +4 −1 pkg/protocol/extension/renegotiation_info_test.go
  137. +6 −4 pkg/protocol/extension/server_name.go
  138. +8 −0 pkg/protocol/extension/srtp_protection_profile.go
  139. +8 −7 pkg/protocol/extension/supported_elliptic_curves.go
  140. +10 −3 pkg/protocol/extension/supported_elliptic_curves_test.go
  141. +13 −9 pkg/protocol/extension/supported_point_formats.go
  142. +13 −3 pkg/protocol/extension/supported_point_formats_test.go
  143. +9 −9 pkg/protocol/extension/supported_signature_algorithms.go
  144. +18 −5 pkg/protocol/extension/supported_signature_algorithms_test.go
  145. +4 −3 pkg/protocol/extension/use_master_secret.go
  146. +34 −10 pkg/protocol/extension/use_srtp.go
  147. +68 −12 pkg/protocol/extension/use_srtp_test.go
  148. +3 −1 pkg/protocol/handshake/cipher_suite.go
  149. +44 −16 pkg/protocol/handshake/errors.go
  150. +58 −11 pkg/protocol/handshake/fuzz_test.go
  151. +15 −13 pkg/protocol/handshake/handshake.go
  152. +6 −4 pkg/protocol/handshake/header.go
  153. +12 −7 pkg/protocol/handshake/message_certificate.go
  154. +12 −11 pkg/protocol/handshake/message_certificate_request.go
  155. +4 −4 pkg/protocol/handshake/message_certificate_request_test.go
  156. +5 −5 pkg/protocol/handshake/message_certificate_test.go
  157. +8 −6 pkg/protocol/handshake/message_certificate_verify.go
  158. +2 −2 pkg/protocol/handshake/message_certificate_verify_test.go
  159. +14 −13 pkg/protocol/handshake/message_client_hello.go
  160. +11 −5 pkg/protocol/handshake/message_client_hello_test.go
  161. +5 −5 pkg/protocol/handshake/message_client_key_exchange.go
  162. +1 −1 pkg/protocol/handshake/message_client_key_exchange_test.go
  163. +4 −3 pkg/protocol/handshake/message_finished.go
  164. +5 −4 pkg/protocol/handshake/message_hello_verify_request.go
  165. +5 −2 pkg/protocol/handshake/message_hello_verify_request_test.go
  166. +12 −10 pkg/protocol/handshake/message_server_hello.go
  167. +4 −4 pkg/protocol/handshake/message_server_hello_done.go
  168. +6 −3 pkg/protocol/handshake/message_server_hello_test.go
  169. +14 −12 pkg/protocol/handshake/message_server_key_exchange.go
  170. +6 −6 pkg/protocol/handshake/message_server_key_exchange_test.go
  171. +5 −5 pkg/protocol/handshake/random.go
  172. +11 −6 pkg/protocol/recordlayer/errors.go
  173. +22 −27 pkg/protocol/recordlayer/fuzz_test.go
  174. +32 −10 pkg/protocol/recordlayer/header.go
  175. +49 −0 pkg/protocol/recordlayer/inner_plaintext.go
  176. +58 −15 pkg/protocol/recordlayer/recordlayer.go
  177. +3 −3 pkg/protocol/recordlayer/recordlayer_test.go
  178. +2 −2 pkg/protocol/version.go
  179. +6 −3 replayprotection_test.go
  180. +3 −8 resume.go
  181. +28 −8 resume_test.go
  182. +1 −1 session.go
  183. +5 −1 srtp_protection_profile.go
  184. +106 −22 state.go
  185. BIN testdata/seed/TestResumeClient.raw
  186. +1 −0 testdata/seed/TestResumeServer.raw
  187. +2 −0 util.go
Original file line number Diff line number Diff line change
@@ -11,13 +11,10 @@
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: Generate Authors

name: API
on:
pull_request:

jobs:
generate:
uses: pion/.goassets/.github/workflows/generate-authors.reusable.yml@master
secrets:
token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
check:
uses: pion/.goassets/.github/workflows/api.reusable.yml@master
3 changes: 2 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -14,9 +14,10 @@ jobs:
e2e-test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: test
run: |
docker build -t pion-dtls-e2e -f e2e/Dockerfile .
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -21,4 +21,4 @@ jobs:
release:
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
go-version: "1.22" # auto-update/latest-go-version
8 changes: 5 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -23,21 +23,23 @@ jobs:
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
strategy:
matrix:
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}
secrets: inherit

test-i386:
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
strategy:
matrix:
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}

test-wasm:
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
go-version: "1.23" # auto-update/latest-go-version
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/tidy-check.yaml
Original file line number Diff line number Diff line change
@@ -22,4 +22,4 @@ jobs:
tidy:
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
go-version: "1.22" # auto-update/latest-go-version
75 changes: 38 additions & 37 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

run:
timeout: 5m

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
misspell:
locale: US
exhaustive:
@@ -21,18 +25,32 @@ linters-settings:
- ^os.Exit$
- ^panic$
- ^print(ln)?$
varnamelen:
max-distance: 12
min-name-length: 2
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
ignore-decls:
- i int
- n int
- w io.Writer
- r io.Reader
- b []byte

linters:
enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- containedctx # containedctx is a linter that detects struct contained context.Context field
- contextcheck # check the function whether use a non-inherited context
- cyclop # checks function and package cyclomatic complexity
- decorder # check declaration order and count of types, constants, variables and functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- dupl # Tool for code clone detection
- durationcheck # check for two durations multiplied together
- err113 # Golang linter to check the errors handling expressions
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted.
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
@@ -43,95 +61,78 @@ linters:
- forcetypeassert # finds forced type assertions
- gci # Gci control golang package import order and make it always deterministic.
- gochecknoglobals # Checks that no globals are present in Go code
- gochecknoinits # Checks that no init functions are present in Go code
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- godox # Tool for detection of FIXME, TODO and other comment keywords
- goerr113 # Golang linter to check the errors handling expressions
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- goheader # Checks is file header matches to pattern
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
- gosec # Inspects source code for security problems
- gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- grouper # An analyzer to analyze expression groups.
- importas # Enforces consistent import aliases
- ineffassign # Detects when assignments to existing variables are not used
- lll # Reports long lines
- maintidx # maintidx measures the maintainability index of each function.
- makezero # Finds slice declarations with non-zero initial length
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- nestif # Reports deeply nested if statements
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
- noctx # noctx finds sending http request without context.Context
- predeclared # find code that shadows one of Go's predeclared identifiers
- revive # golint replacement, finds style mistakes
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- stylecheck # Stylecheck is a replacement for golint
- tagliatelle # Checks the struct tags.
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- unused # Checks Go code for unused constants, variables, functions and types
- varnamelen # checks that the length of a variable's name matches its scope
- wastedassign # wastedassign finds wasted assignment statements
- whitespace # Tool for detection of leading and trailing whitespace
disable:
- containedctx # containedctx is a linter that detects struct contained context.Context field
- cyclop # checks function and package cyclomatic complexity
- exhaustivestruct # Checks if all struct's fields are initialized
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- funlen # Tool for detection of long functions
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- gomnd # An analyzer to detect magic numbers.
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
- gochecknoinits # Checks that no init functions are present in Go code
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
- interfacebloat # A linter that checks length of interface.
- ireturn # Accept Interfaces, Return Concrete Types
- lll # Reports long lines
- maintidx # maintidx measures the maintainability index of each function.
- makezero # Finds slice declarations with non-zero initial length
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
- nestif # Reports deeply nested if statements
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
- mnd # An analyzer to detect magic numbers
- nolintlint # Reports ill-formed or insufficient nolint directives
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
- prealloc # Finds slice declarations that could potentially be preallocated
- promlinter # Check Prometheus metrics naming via promlint
- rowserrcheck # checks whether Err of rows is checked successfully
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
- testpackage # linter that makes you use a separate _test package
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- varnamelen # checks that the length of a variable's name matches its scope
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
- wrapcheck # Checks that errors returned from external packages are wrapped
- wsl # Whitespace Linter - Forces you to use empty lines!

issues:
exclude-use-default: false
exclude-dirs-use-default: false
exclude-rules:
# Allow complex tests, better to be self contained
- path: _test\.go
# Allow complex tests and examples, better to be self contained
- path: (examples|main\.go|_test\.go)
linters:
- gocognit
- forbidigo

# Allow complex main function in examples
- path: examples
text: "of func `main` is high"
linters:
- gocognit

# Allow forbidden identifiers in examples
- path: examples
linters:
- forbidigo

# Allow forbidden identifiers in CLI commands
- path: cmd
linters:
- forbidigo

run:
skip-dirs-use-default: false
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Pion
Source: https://github.com/pion/

Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum .eslintrc.json package.json examples/examples.json
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json
Copyright: 2023 The Pion community <https://pion.ly>
License: MIT

Files: testdata/fuzz/* **/testdata/fuzz/* api/*.txt
Files: testdata/seed/* testdata/fuzz/* **/testdata/fuzz/* api/*.txt
Copyright: 2023 The Pion community <https://pion.ly>
License: CC0-1.0
57 changes: 0 additions & 57 deletions AUTHORS.txt

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
<a href="https://pion.ly/slack"><img src="https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen" alt="Slack Widget"></a>
<br>
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/pion/dtls/test.yaml">
<a href="https://pkg.go.dev/github.com/pion/dtls/v2"><img src="https://pkg.go.dev/badge/github.com/pion/dtls/v2.svg" alt="Go Reference"></a>
<a href="https://pkg.go.dev/github.com/pion/dtls/v3"><img src="https://pkg.go.dev/badge/github.com/pion/dtls/v3.svg" alt="Go Reference"></a>
<a href="https://codecov.io/gh/pion/dtls"><img src="https://codecov.io/gh/pion/dtls/branch/master/graph/badge.svg" alt="Coverage Status"></a>
<a href="https://goreportcard.com/report/github.com/pion/dtls/v2"><img src="https://goreportcard.com/badge/github.com/pion/dtls/v2" alt="Go Report Card"></a>
<a href="https://goreportcard.com/report/github.com/pion/dtls/v3"><img src="https://goreportcard.com/badge/github.com/pion/dtls/v3" alt="Go Report Card"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
</p>
<br>
@@ -145,7 +145,7 @@ We are always looking to support **your projects**. Please reach out if you have
If you need commercial support or don't want to use public methods you can contact us at [team@pion.ly](mailto:team@pion.ly)

### Contributing
Check out the [contributing wiki](https://github.com/pion/webrtc/wiki/Contributing) to join the group of amazing people making this project possible: [AUTHORS.txt](./AUTHORS.txt)
Check out the [contributing wiki](https://github.com/pion/webrtc/wiki/Contributing) to join the group of amazing people making this project possible

### License
MIT License - see [LICENSE](LICENSE) for full text
Loading