Skip to content

Comments

Add zrest authentication support#1

Merged
sysvinit merged 3 commits intowireappfrom
sysvinit/zrest-auth
Mar 28, 2022
Merged

Add zrest authentication support#1
sysvinit merged 3 commits intowireappfrom
sysvinit/zrest-auth

Conversation

@sysvinit
Copy link

These commits add and document a --zrest option which enables the "zrest" authentication scheme supported by restund, which derives passwords based on the HMAC of the username using a secret shared between the TURN server and an external application.

This functionality is very similar to the existing "TURN REST API" support in coturn (which is an implementation of I-D.uberti-behave-turn-rest), so the additions in this PR are mostly based on the existing code. In particular, the zrest authentication code reuses the existing authentication secrets which can be configured either using --static-auth-secret or in an external database.

When the --zrest flag is enabled, it will turn on the TURN REST API code, but use the zrest-specific username and password handling code paths.

Copy link

@arthurwolf arthurwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C looks fine.

Copy link
Collaborator

@supersven supersven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite some minor things, this looks really great!

This is suprisingly similar to coturn's existing TURN REST API authentication
scheme, described in I-D.uberti-behave-turn-rest-00, so the new code is based
on this existing implementation.

This commit introduces a --zrest option, which enables the zrest algorithm when
TURN REST API long-term credentials are already enabled and configured.
@sysvinit sysvinit force-pushed the sysvinit/zrest-auth branch from 207ce16 to 85597cc Compare March 15, 2022 12:02
@sysvinit
Copy link
Author

@supersven I've just pushed a revision to address some of your comments -- please take a look.

@supersven
Copy link
Collaborator

Hey @sysvinit ,

Sorry for the long delay. I'll have a look, now.

@supersven
Copy link
Collaborator

@sysvinit ,
I think this can be merged, now. 👍

@sysvinit sysvinit merged commit 934e0e2 into wireapp Mar 28, 2022
@sysvinit sysvinit deleted the sysvinit/zrest-auth branch March 28, 2022 10:17
sysvinit added a commit that referenced this pull request Mar 29, 2022
* Implement Wire Swiss GmbH's "zrest" authentication mechanism.

This is suprisingly similar to coturn's existing TURN REST API authentication
scheme, described in I-D.uberti-behave-turn-rest-00, so the new code is based
on this existing implementation.

This commit introduces a --zrest option, which enables the zrest algorithm when
TURN REST API long-term credentials are already enabled and configured.

* Document the --zrest option for enabling zrest authentication.

* Add --zrest flag summary to usage message.
sysvinit pushed a commit that referenced this pull request Nov 8, 2022
```
==6418==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4e7530 in bcmp /src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:906:10
    #1 0x55463d in stun_check_message_integrity_by_key_str coturn/src/client/ns_turn_msg.c:1989:5
    #2 0x554acc in stun_check_message_integrity_str coturn/src/client/ns_turn_msg.c:2008:9
    #3 0x5358c0 in LLVMFuzzerTestOneInput coturn/fuzz/FuzzStun.c:37:5
    #4 0x43ede3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #5 0x42a542 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
    #6 0x42fdec in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
    #7 0x459322 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #8 0x7f4cb21790b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/libc-start.c:308:16
    #9 0x42070d in _start
  Uninitialized value was created by an allocation of 'new_hmac' in the stack frame of function 'stun_check_message_integrity_by_key_str'
    #0 0x5538c0 in stun_check_message_integrity_by_key_str coturn/src/client/ns_turn_msg.c:1927
```
sysvinit added a commit that referenced this pull request Nov 8, 2022
* Implement Wire Swiss GmbH's "zrest" authentication mechanism.

This is suprisingly similar to coturn's existing TURN REST API authentication
scheme, described in I-D.uberti-behave-turn-rest-00, so the new code is based
on this existing implementation.

This commit introduces a --zrest option, which enables the zrest algorithm when
TURN REST API long-term credentials are already enabled and configured.

* Document the --zrest option for enabling zrest authentication.

* Add --zrest flag summary to usage message.
sgodin added a commit that referenced this pull request Apr 21, 2023
* Implement Wire Swiss GmbH's "zrest" authentication mechanism.

This is suprisingly similar to coturn's existing TURN REST API authentication
scheme, described in I-D.uberti-behave-turn-rest-00, so the new code is based
on this existing implementation.

This commit introduces a --zrest option, which enables the zrest algorithm when
TURN REST API long-term credentials are already enabled and configured.

* Document the --zrest option for enabling zrest authentication.

* Add --zrest flag summary to usage message.
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

Successfully merging this pull request may close these issues.

3 participants