diff --git a/README.turnutils b/README.turnutils index b76a6eb8..516219af 100644 --- a/README.turnutils +++ b/README.turnutils @@ -117,6 +117,8 @@ Flags: -Z Dual allocation (SSODA draft support). +-J Use oAuth. + Options with required values: -l Message length (Default: 100 Bytes). diff --git a/src/apps/uclient/mainuclient.c b/src/apps/uclient/mainuclient.c index 37566b95..c2bc91b9 100644 --- a/src/apps/uclient/mainuclient.c +++ b/src/apps/uclient/mainuclient.c @@ -97,6 +97,11 @@ band_limit_t bps = 0; int dual_allocation = 0; +int oauth = 0; +oauth_key_data_raw okdr = { + "north","Y2FybGVvbg==",0,0,"SHA-256","AES-256-CBC","","HMAC-SHA-256-128","" +}; + //////////////// local definitions ///////////////// static char Usage[] = @@ -130,6 +135,7 @@ static char Usage[] = " -G Generate extra requests (create permissions, channel bind).\n" " -B Random disconnect after a few initial packets.\n" " -Z Dual allocation.\n" + " -J Use oAuth.\n" "Options:\n" " -l Message length (Default: 100 Bytes).\n" " -i Certificate file (for secure connections only, optional).\n" @@ -204,8 +210,11 @@ int main(int argc, char **argv) ns_bzero(local_addr, sizeof(local_addr)); - while ((c = getopt(argc, argv, "a:d:p:l:n:L:m:e:r:u:w:i:k:z:W:C:E:F:o:ZvsyhcxXgtTSAPDNOUHMRIGB")) != -1) { + while ((c = getopt(argc, argv, "a:d:p:l:n:L:m:e:r:u:w:i:k:z:W:C:E:F:o:ZvsyhcxXgtTSAPDNOUHMRIGBJ")) != -1) { switch (c){ + case 'J': + oauth = 1; + break; case 'a': bps = (band_limit_t)atol(optarg); break; diff --git a/src/apps/uclient/uclient.h b/src/apps/uclient/uclient.h index ab56bf8b..fab59208 100644 --- a/src/apps/uclient/uclient.h +++ b/src/apps/uclient/uclient.h @@ -86,6 +86,9 @@ extern int dual_allocation; extern char origin[STUN_MAX_ORIGIN_SIZE+1]; +extern int oauth; +extern oauth_key_data_raw okdr; + #define is_TCP_relay() (relay_transport == STUN_ATTRIBUTE_TRANSPORT_TCP_VALUE) void start_mclient(const char *remote_address, int port,