Commit Graph

111 Commits

Author SHA1 Message Date
Ludovic Chenut 26cad2a383
fix: stun and dtls close (#22)
* fix: stun & dtls close

* chore: change the test names & variable names

* fix: add isClosed to DtlsConn

* feat: remove `closeEvent`/`join`/`cleanup` and replace those by `onClose` sequence of proc to be executed on close
2024-08-30 12:19:09 +02:00
Ludovic Chenut e9bda6babf
feat: add async exception tracking (#20) 2024-08-23 12:18:45 +02:00
Ludovic Chenut 5683e46422
chore: update ci (#21) 2024-08-23 12:18:05 +02:00
Ludovic Chenut d75e328e77
feat: dtls connection using mbedtls (#10)
* feat: dtls connection using mbedtls

* refactor: change according to the stun protocol rework

* chore: rename init proc into new

* docs: adds object field comments

* chore: split dtls.nim into two files & renaming

* chore: remove useless code

* chore: remove TODOs as they were addressed with a Stun refactorization

* fix: oversight on dtls.new

* feat: add dtls test

* chore: added license & used pragma on testdtls

* fix: remove usage of deprecated TrackerCounter

* fix: trackers counter

* fix:
- add windows linking library
- make stun stop asynchronous (causing issue on macos)
- store private key and certificate

* chore: renaming test

* docs: update DtlsConn comment

* fix: remove code duplicate

* chore: update comment

* chore: remove duplication mbedtls initialization code in accept/connect and un-expose mbedtls context

* feat: add exception management to dtls_transport

* fix: check address family before handshake

* fix: exhaustive case

* fix: do not create dtlsConn if the address family is not IP

* chore: remove entropy from MbedTLSCtx

* chore: remove asyncspawn of cleanupdtlsconn

* chore: ctx is no longer public

* test: add a test with more than 2 nodes

* chore: started is now useful

* chore: update Dtls.stop

* chore: removed unecessary todos

* docs: add comments on DtlsConn.read and getters

* feat: add tracker for dtls connection and transport

* chore: privatize local and remote certificate

* style: use nph

* fix: remove laddr from dtls_conn (not used)

* style: sort imports

* chore: clean Dtls.stop

* fix: remote address is no longer exposed

* fix: raddr change oversight

* chore: change `verify` name

* chore: changed `sendFuture: Future[void]` into `dataToSend: seq[byte]`

* chore: avoid sequence copy

* chore: change assert message

---------

Co-authored-by: diegomrsantos <diegomrsantos@gmail.com>
2024-08-13 15:54:03 +02:00
Ludovic Chenut 81b91e32a9
feat: add a proper tracker management (#17)
* feat: add a proper tracker management

* chore: remove newline

* fix: use closeWait instead of close

* chore: replace custom made checkTrackers by chronos checkLeaks

* chore: renamed UdpTransport.stop into close

* chore: remove flakyAsyncTest
2024-07-05 11:55:36 +00:00
Ludovic Chenut 11111e6fc7
chore: rename different object and procedure to be more accurate (#13)
* chore: rename UdpConn into UdpTransport

* chore: stun_attributes.nim comments improvement
2024-06-12 12:19:27 +02:00
Ludovic Chenut 6cda0c8d68
feat: stun protocol & stun connection (#9)
* feat: stun protocol & stun connection

* rename getResponse into getPong and test it

* add Username attribute

* genUfrag procedure

* Add generateRandomSeq to generate a transaction id

* First draft of getPing

* Use UdpPacketInfo tuple

* Change closing debug message

* Add proper exception tracking

* Change StunConn init behavior

* Add a last UdpPacketInfo

* Add comments

* refactor: change connection management

* Add a lot of comments/Finish refactor

* Add copyright headers on test files

* simplify newRng proc for testing

* add exception tracking for stun transport asynchronous proc

* remove ping/pong example building in the ci

* rename getPong test

* remove maximum connections

* Add ICE stun attributes

* Stun rework

* feat: getBindingRequest

* fix oversight & add comments

* Test rework

* Adds continue in stunMessageHandler loop

* remove `doAssert(false)` from Stun.connect()

* Update TODO

* fix comment typo

* fix: test lacking precision

* docs: add StunConn.init() comments

* chore: make teststun more readable

* feat: use withValue instead of getOrDefault in Stun.connect()

* feat: add check if Fingerprint is valid

* refactor: getAttribute and username/password provider

* chore: removes genUfrag, should be in libp2p instead

* chore: remove redundant test

* chore: change warn log to debug

* docs: update getBindingResponse/Request comments

* chore: renames init into new

* fix: compilation warnings

* chore: change closed line to be at the end of the close procedure

* feat: limit queues size
2024-05-24 14:14:30 +02:00
Ludovic Chenut 928fc59a62
feat: udp connection (#8) 2024-04-02 14:04:14 +02:00
Ludovic Chenut a0f6c777d8
Resetting master 2024-03-08 13:50:59 +01:00
Ludovic Chenut 4406004a0d
Merge pull request #7 from status-im/remove-usrsctp
chore: remove usrsctp
2024-03-08 12:57:11 +01:00
Ludovic Chenut 309f66700a
remove installation from nimble & usrsctp.nim file 2024-03-08 12:48:03 +01:00
Ludovic Chenut 1b25f32d25
add nim-usrsctp to the nimble file 2024-03-08 12:33:45 +01:00
Ludovic Chenut 0d8ef54a7d
remove usrsctp 2024-03-08 12:33:07 +01:00
Ludovic Chenut dd624fd8a2
chore: remove outdated examples 2024-03-08 11:46:34 +01:00
Ludovic Chenut 97cd366402
Merge pull request #1 from status-im/ci
Add CI
2024-03-08 11:35:53 +01:00
Ludovic Chenut 0d10bddcdd
remove unused import/variable 2024-03-08 11:35:13 +01:00
Ludovic Chenut f445c5c47d
add tests/asyncunit & helpers 2024-03-07 17:23:21 +01:00
Ludovic Chenut 0521012ffc
fix sctp wrong addr call & remove gcsafe 2024-03-07 17:18:49 +01:00
Ludovic Chenut 56ca60c534
add gcsafe pragma 2024-03-07 16:34:18 +01:00
Ludovic Chenut 6298f3709c
try ci without dtls timer callback 2024-03-07 16:28:37 +01:00
Ludovic Chenut 79982f3dd4
update nim version 2024-03-07 16:10:58 +01:00
Ludovic Chenut 7859daac3e
change comments/message test 2024-03-07 16:06:47 +01:00
Ludovic Chenut c677b9e4fa
Fix teststun & add runalltest.nim 2024-03-07 13:25:57 +01:00
Ludovic Chenut fc0267de46
Add nimble test 2024-03-07 12:16:48 +01:00
Ludovic Chenut e4b98d379e
Merge remote-tracking branch 'origin/master' into ci 2024-03-07 09:13:11 +01:00
Ludovic Chenut d525da3d62
fix: oversight on renaming variable 2024-03-06 16:47:39 +01:00
Ludovic Chenut 758c2ac4ae
Merge pull request #6 from status-im/add-tests-comments
docs/chore: adds comments & refactor & clean
2024-03-06 16:20:28 +01:00
Ludovic Chenut b1f8d71f71
harmonize sctp new/init 2024-03-06 16:17:09 +01:00
Ludovic Chenut 5343605c49
update header year 2024-03-06 16:05:53 +01:00
Ludovic Chenut f49ca90491
Sctp comments + refacto 2024-03-06 13:47:32 +01:00
Ludovic Chenut 359a81df4a
Dtls comments + close + minor improvements 2024-03-01 13:49:05 +01:00
Ludovic Chenut 4c1eb13926
StunConn adds debug 2024-03-01 12:11:04 +01:00
Ludovic Chenut 1f98fae1af
Udp comments 2024-02-29 16:55:48 +01:00
Ludovic Chenut e377262919
Stun comments 2024-02-29 15:15:55 +01:00
Ludovic Chenut 1f27c163b0
Merge pull request #5 from status-im/sctp-dtls-client
Sctp / Dtls Client
2024-02-28 14:07:57 +01:00
Ludovic Chenut 6ccad5732d
add a todo to usrsctp_accept return check 2024-02-28 14:06:51 +01:00
Ludovic Chenut f6ba794281
sctp/dtls client done 2024-02-28 13:49:43 +01:00
Ludovic Chenut 0fa09ba6f7
first draft 2024-02-23 15:14:54 +01:00
Ludovic Chenut 474f3d30ad
Merge pull request #4 from status-im/datachannel
DataChannel
2024-02-23 11:08:20 +01:00
Ludovic Chenut 2591a158ba
A lot of fixes 2024-02-23 11:06:59 +01:00
Ludovic Chenut 9a6657922a
add logs & fix some bugs in sctp 2023-12-15 09:53:20 +01:00
Ludovic Chenut 525fb37882
Make authmode optional 2023-11-29 16:19:31 +01:00
Ludovic Chenut ec51a19880
add localcert for Dtls 2023-11-28 16:20:43 +01:00
Ludovic Chenut de12f43ef9
Dtls set local certificate 2023-11-28 16:06:26 +01:00
Ludovic Chenut 7d14cdcb48
expose dtls connection 2023-11-22 14:54:48 +01:00
Ludovic Chenut 070aa11854
fix 2023-11-14 16:32:08 +01:00
Ludovic Chenut 1132a5e42d
Fix dtlsRecv / read & add certificate request 2023-11-14 16:02:44 +01:00
Ludovic Chenut 6391a3f2e5
fix small errors on sctp 2023-11-09 15:54:45 +01:00
Ludovic Chenut dee08191cf
Fix remote certificate 2023-11-07 16:33:29 +01:00
Ludovic Chenut a36708a5a0
Fix chronicles 2023-10-20 11:15:00 +02:00